Changes For Folder Feature
This commit is contained in:
@@ -11,16 +11,14 @@ android {
|
||||
applicationId = "devs.org.calculator"
|
||||
minSdk = 26
|
||||
targetSdk = 34
|
||||
versionCode = 3
|
||||
versionName = "1.2"
|
||||
versionCode = 4
|
||||
versionName = "1.3"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Calculator"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activities.HiddenActivity"
|
||||
android:exported="false" />
|
||||
|
||||
@@ -89,7 +89,6 @@ class HiddenActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
binding = ActivityHiddenBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
//initialized animations for fabs
|
||||
@@ -116,6 +115,10 @@ class HiddenActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
binding.settings.setOnClickListener {
|
||||
startActivity(Intent(this, SettingsActivity::class.java))
|
||||
}
|
||||
|
||||
binding.addImage.setOnClickListener { openFilePicker("image/*") }
|
||||
binding.addVideo.setOnClickListener { openFilePicker("video/*") }
|
||||
binding.addAudio.setOnClickListener { openFilePicker("audio/*") }
|
||||
@@ -302,7 +305,6 @@ class HiddenActivity : AppCompatActivity() {
|
||||
binding.recyclerView.layoutManager = GridLayoutManager(this, 3)
|
||||
|
||||
val fileAdapter = FileAdapter(this, this, folder).apply {
|
||||
// Set up the callback for file operations
|
||||
fileOperationCallback = object : FileAdapter.FileOperationCallback {
|
||||
override fun onFileDeleted(file: File) {
|
||||
// Refresh the file list
|
||||
@@ -318,6 +320,18 @@ class HiddenActivity : AppCompatActivity() {
|
||||
// Refresh the file list
|
||||
refreshCurrentFolder()
|
||||
}
|
||||
|
||||
override fun onSelectionModeChanged(
|
||||
isSelectionMode: Boolean,
|
||||
selectedCount: Int
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
override fun onSelectionCountChanged(selectedCount: Int) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
submitList(files)
|
||||
|
||||
@@ -49,6 +49,10 @@ class PreviewActivity : AppCompatActivity() {
|
||||
}
|
||||
})
|
||||
|
||||
binding.back.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun setupFileType() {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package devs.org.calculator.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import devs.org.calculator.R
|
||||
import devs.org.calculator.databinding.ActivitySettingsBinding
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivitySettingsBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -31,11 +31,13 @@ class FileAdapter(
|
||||
private val selectedItems = mutableSetOf<Int>()
|
||||
private var isSelectionMode = false
|
||||
|
||||
// Callback interface for handling file operations
|
||||
// Callback interface for handling file operations and selection changes
|
||||
interface FileOperationCallback {
|
||||
fun onFileDeleted(file: File)
|
||||
fun onFileRenamed(oldFile: File, newFile: File)
|
||||
fun onRefreshNeeded()
|
||||
fun onSelectionModeChanged(isSelectionMode: Boolean, selectedCount: Int)
|
||||
fun onSelectionCountChanged(selectedCount: Int)
|
||||
}
|
||||
|
||||
var fileOperationCallback: FileOperationCallback? = null
|
||||
@@ -44,6 +46,8 @@ class FileAdapter(
|
||||
val imageView: ImageView = view.findViewById(R.id.fileIconImageView)
|
||||
val fileNameTextView: TextView = view.findViewById(R.id.fileNameTextView)
|
||||
val playIcon: ImageView = view.findViewById(R.id.videoPlay)
|
||||
val selectionOverlay: View? = view.findViewById(R.id.selectedLayer) // Optional overlay for selection
|
||||
val checkIcon: ImageView? = view.findViewById(R.id.selected) // Optional check icon
|
||||
|
||||
fun bind(file: File) {
|
||||
val fileType = FileManager(context, lifecycleOwner).getFileType(file)
|
||||
@@ -51,7 +55,8 @@ class FileAdapter(
|
||||
setupClickListeners(file, fileType)
|
||||
|
||||
// Handle selection state
|
||||
itemView.isSelected = selectedItems.contains(adapterPosition)
|
||||
val isSelected = selectedItems.contains(adapterPosition)
|
||||
updateSelectionUI(isSelected)
|
||||
}
|
||||
|
||||
fun bind(file: File, payloads: List<Any>) {
|
||||
@@ -70,10 +75,28 @@ class FileAdapter(
|
||||
"SIZE_CHANGED", "MODIFIED_DATE_CHANGED" -> {
|
||||
// Could update file info if displayed
|
||||
}
|
||||
"SELECTION_CHANGED" -> {
|
||||
val isSelected = selectedItems.contains(adapterPosition)
|
||||
updateSelectionUI(isSelected)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateSelectionUI(isSelected: Boolean) {
|
||||
// Update visual selection state
|
||||
itemView.isSelected = isSelected
|
||||
|
||||
// If you have a selection overlay, show/hide it
|
||||
selectionOverlay?.visibility = if (isSelected) View.VISIBLE else View.GONE
|
||||
|
||||
// If you have a check icon, show/hide it
|
||||
checkIcon?.visibility = if (isSelected) View.VISIBLE else View.GONE
|
||||
|
||||
// You can also change the background or add other visual indicators
|
||||
itemView.alpha = if (isSelectionMode && !isSelected) 0.7f else 1.0f
|
||||
}
|
||||
|
||||
private fun setupFileDisplay(file: File, fileType: FileManager.FileType) {
|
||||
when (fileType) {
|
||||
FileManager.FileType.IMAGE -> {
|
||||
@@ -141,7 +164,8 @@ class FileAdapter(
|
||||
showFileOptionsDialog(file)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
toggleSelection(adapterPosition)
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,6 +241,7 @@ class FileAdapter(
|
||||
private fun showFileOptionsDialog(file: File) {
|
||||
val options = arrayOf(
|
||||
context.getString(R.string.un_hide),
|
||||
context.getString(R.string.select_multiple),
|
||||
context.getString(R.string.rename),
|
||||
context.getString(R.string.delete),
|
||||
context.getString(R.string.share)
|
||||
@@ -227,9 +252,10 @@ class FileAdapter(
|
||||
.setItems(options) { dialog, which ->
|
||||
when (which) {
|
||||
0 -> unHideFile(file)
|
||||
1 -> renameFile(file)
|
||||
2 -> deleteFile(file)
|
||||
3 -> shareFile(file)
|
||||
1 -> enableSelectMultipleFiles()
|
||||
2 -> renameFile(file)
|
||||
3 -> deleteFile(file)
|
||||
4 -> shareFile(file)
|
||||
}
|
||||
dialog.dismiss()
|
||||
}
|
||||
@@ -237,15 +263,21 @@ class FileAdapter(
|
||||
.show()
|
||||
}
|
||||
|
||||
private fun enableSelectMultipleFiles() {
|
||||
// Enable multiple selection mode and select current item
|
||||
enterSelectionMode()
|
||||
selectedItems.add(adapterPosition)
|
||||
notifyItemChanged(adapterPosition, listOf("SELECTION_CHANGED"))
|
||||
fileOperationCallback?.onSelectionCountChanged(selectedItems.size)
|
||||
}
|
||||
|
||||
private fun unHideFile(file: File) {
|
||||
FileManager(context, lifecycleOwner).unHideFile(
|
||||
file = file,
|
||||
onSuccess = {
|
||||
fileOperationCallback?.onFileDeleted(file)
|
||||
|
||||
},
|
||||
onError = { errorMessage ->
|
||||
|
||||
Toast.makeText(context, "Failed to unhide: $errorMessage", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
)
|
||||
@@ -315,11 +347,14 @@ class FileAdapter(
|
||||
selectedItems.add(position)
|
||||
}
|
||||
|
||||
// Exit selection mode if no items are selected
|
||||
if (selectedItems.isEmpty()) {
|
||||
isSelectionMode = false
|
||||
exitSelectionMode()
|
||||
} else {
|
||||
fileOperationCallback?.onSelectionCountChanged(selectedItems.size)
|
||||
}
|
||||
|
||||
notifyItemChanged(position)
|
||||
notifyItemChanged(position, listOf("SELECTION_CHANGED"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,15 +379,179 @@ class FileAdapter(
|
||||
}
|
||||
|
||||
// Public methods for external control
|
||||
fun clearSelection() {
|
||||
selectedItems.clear()
|
||||
isSelectionMode = false
|
||||
notifyDataSetChanged()
|
||||
|
||||
/**
|
||||
* Enter selection mode
|
||||
*/
|
||||
fun enterSelectionMode() {
|
||||
if (!isSelectionMode) {
|
||||
isSelectionMode = true
|
||||
fileOperationCallback?.onSelectionModeChanged(true, selectedItems.size)
|
||||
notifyDataSetChanged() // Refresh all items to show selection UI
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exit selection mode and clear all selections
|
||||
*/
|
||||
fun exitSelectionMode() {
|
||||
if (isSelectionMode) {
|
||||
isSelectionMode = false
|
||||
selectedItems.clear()
|
||||
fileOperationCallback?.onSelectionModeChanged(false, 0)
|
||||
notifyDataSetChanged() // Refresh all items to hide selection UI
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear selection without exiting selection mode
|
||||
*/
|
||||
fun clearSelection() {
|
||||
if (selectedItems.isNotEmpty()) {
|
||||
val previouslySelected = selectedItems.toSet()
|
||||
selectedItems.clear()
|
||||
fileOperationCallback?.onSelectionCountChanged(0)
|
||||
|
||||
// Only update previously selected items
|
||||
previouslySelected.forEach { position ->
|
||||
notifyItemChanged(position, listOf("SELECTION_CHANGED"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Select all items
|
||||
*/
|
||||
fun selectAll() {
|
||||
if (!isSelectionMode) {
|
||||
enterSelectionMode()
|
||||
}
|
||||
|
||||
val previouslySelected = selectedItems.toSet()
|
||||
selectedItems.clear()
|
||||
|
||||
// Add all positions to selection
|
||||
for (i in 0 until itemCount) {
|
||||
selectedItems.add(i)
|
||||
}
|
||||
|
||||
fileOperationCallback?.onSelectionCountChanged(selectedItems.size)
|
||||
|
||||
// Update UI for changed items
|
||||
val allPositions = (0 until itemCount).toSet()
|
||||
val changedPositions = allPositions - previouslySelected + previouslySelected - allPositions
|
||||
changedPositions.forEach { position ->
|
||||
notifyItemChanged(position, listOf("SELECTION_CHANGED"))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected files
|
||||
*/
|
||||
fun getSelectedItems(): List<File> {
|
||||
return selectedItems.mapNotNull { position ->
|
||||
if (position < itemCount) getItem(position) else null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected file count
|
||||
*/
|
||||
fun getSelectedCount(): Int = selectedItems.size
|
||||
|
||||
/**
|
||||
* Check if in selection mode
|
||||
*/
|
||||
fun isInSelectionMode(): Boolean = isSelectionMode
|
||||
|
||||
/**
|
||||
* Delete selected files
|
||||
*/
|
||||
fun deleteSelectedFiles() {
|
||||
val selectedFiles = getSelectedItems()
|
||||
var deletedCount = 0
|
||||
var failedCount = 0
|
||||
|
||||
selectedFiles.forEach { file ->
|
||||
if (file.delete()) {
|
||||
deletedCount++
|
||||
fileOperationCallback?.onFileDeleted(file)
|
||||
} else {
|
||||
failedCount++
|
||||
}
|
||||
}
|
||||
|
||||
exitSelectionMode()
|
||||
|
||||
// Show result message
|
||||
when {
|
||||
deletedCount > 0 && failedCount == 0 -> {
|
||||
Toast.makeText(context, "Deleted $deletedCount file(s)", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
deletedCount > 0 && failedCount > 0 -> {
|
||||
Toast.makeText(context, "Deleted $deletedCount file(s), failed to delete $failedCount", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
failedCount > 0 -> {
|
||||
Toast.makeText(context, "Failed to delete $failedCount file(s)", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Share selected files
|
||||
*/
|
||||
fun shareSelectedFiles() {
|
||||
val selectedFiles = getSelectedItems()
|
||||
if (selectedFiles.isEmpty()) return
|
||||
|
||||
if (selectedFiles.size == 1) {
|
||||
// Share single file
|
||||
val file = selectedFiles.first()
|
||||
val uri = FileProvider.getUriForFile(
|
||||
context,
|
||||
"${context.packageName}.fileprovider",
|
||||
file
|
||||
)
|
||||
val shareIntent = Intent(Intent.ACTION_SEND).apply {
|
||||
type = context.contentResolver.getType(uri) ?: "*/*"
|
||||
putExtra(Intent.EXTRA_STREAM, uri)
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
}
|
||||
context.startActivity(
|
||||
Intent.createChooser(shareIntent, context.getString(R.string.share_file))
|
||||
)
|
||||
} else {
|
||||
// Share multiple files
|
||||
val uris = selectedFiles.map { file ->
|
||||
FileProvider.getUriForFile(
|
||||
context,
|
||||
"${context.packageName}.fileprovider",
|
||||
file
|
||||
)
|
||||
}
|
||||
val shareIntent = Intent(Intent.ACTION_SEND_MULTIPLE).apply {
|
||||
type = "*/*"
|
||||
putParcelableArrayListExtra(Intent.EXTRA_STREAM, ArrayList(uris))
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
}
|
||||
context.startActivity(
|
||||
Intent.createChooser(shareIntent, "Share ${selectedFiles.size} files")
|
||||
)
|
||||
}
|
||||
|
||||
exitSelectionMode()
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle back press - exit selection mode if active
|
||||
* @return true if selection mode was active and has been exited, false otherwise
|
||||
*/
|
||||
fun onBackPressed(): Boolean {
|
||||
return if (isSelectionMode) {
|
||||
exitSelectionMode()
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,13 +129,15 @@ class ImagePreviewAdapter(
|
||||
mediaPlayer = MediaPlayer().apply {
|
||||
setDataSource(file.absolutePath)
|
||||
setOnPreparedListener { mp ->
|
||||
binding.audioSeekBar.max = mp.duration
|
||||
binding.audioSeekBar.valueTo = mp.duration.toFloat()
|
||||
|
||||
isMediaPlayerPrepared = true
|
||||
}
|
||||
setOnCompletionListener {
|
||||
// isPlaying = false
|
||||
binding.playPause.setImageResource(R.drawable.play)
|
||||
binding.audioSeekBar.progress = 0
|
||||
binding.audioSeekBar.value = 0f
|
||||
|
||||
seekHandler.removeCallbacks(seekRunnable!!)
|
||||
}
|
||||
prepareAsync()
|
||||
@@ -143,27 +145,23 @@ class ImagePreviewAdapter(
|
||||
}
|
||||
|
||||
private fun setupSeekBar() {
|
||||
binding.audioSeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
||||
if (fromUser) {
|
||||
mediaPlayer?.seekTo(progress)
|
||||
}
|
||||
binding.audioSeekBar.addOnChangeListener { slider, value, fromUser ->
|
||||
if (fromUser && mediaPlayer != null && isMediaPlayerPrepared) {
|
||||
mediaPlayer?.seekTo(value.toInt())
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar?) {}
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar?) {}
|
||||
})
|
||||
}
|
||||
|
||||
seekRunnable = Runnable {
|
||||
mediaPlayer?.let { mp ->
|
||||
if (mp.isPlaying) {
|
||||
binding.audioSeekBar.progress = mp.currentPosition
|
||||
binding.audioSeekBar.value = mp.currentPosition.toFloat()
|
||||
seekHandler.postDelayed(seekRunnable!!, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun setupPlaybackControls() {
|
||||
binding.playPause.setOnClickListener {
|
||||
if (isPlaying) {
|
||||
@@ -177,7 +175,7 @@ class ImagePreviewAdapter(
|
||||
mediaPlayer?.let { mp ->
|
||||
val newPosition = mp.currentPosition - 10000
|
||||
mp.seekTo(maxOf(0, newPosition))
|
||||
binding.audioSeekBar.progress = mp.currentPosition
|
||||
binding.audioSeekBar.value = mp.currentPosition.toFloat()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +183,7 @@ class ImagePreviewAdapter(
|
||||
mediaPlayer?.let { mp ->
|
||||
val newPosition = mp.currentPosition + 10000
|
||||
mp.seekTo(minOf(mp.duration, newPosition))
|
||||
binding.audioSeekBar.progress = mp.currentPosition
|
||||
binding.audioSeekBar.value = mp.currentPosition.toFloat()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
<path android:fillColor="#00000000"
|
||||
android:pathData="M7.7,6.36L3.533,11.36C3.224,11.731 3.224,12.269 3.533,12.64L7.7,17.64C7.89,17.868 8.172,18 8.468,18H18C19.657,18 21,16.657 21,15V9C21,7.343 19.657,6 18,6H8.468C8.172,6 7.89,6.132 7.7,6.36Z"
|
||||
android:strokeColor="@color/textColor" android:strokeLineCap="round"
|
||||
android:strokeColor="@color/white" android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" android:strokeWidth="2"/>
|
||||
|
||||
<path android:fillColor="#00000000"
|
||||
android:pathData="M15,10L13,12M13,12L11,14M13,12L11,10M13,12L15,14"
|
||||
android:strokeColor="@color/textColor"
|
||||
android:strokeColor="@color/white"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"/>
|
||||
|
||||
5
app/src/main/res/drawable/gradient_bg.xml
Normal file
5
app/src/main/res/drawable/gradient_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="15dp"/>
|
||||
<gradient android:startColor="?attr/colorPrimary" android:endColor="?attr/colorPrimary" android:angle="75"/>
|
||||
</shape>
|
||||
@@ -1,10 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M12,3v10.55c-0.59,-0.34 -1.27,-0.55 -2,-0.55 -2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4V7h4V3h-6z"/>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||
|
||||
<path android:fillColor="?attr/colorPrimary" android:pathData="M13.75,2C13.75,1.586 13.414,1.25 13,1.25C12.586,1.25 12.25,1.586 12.25,2V14.536C11.4,13.738 10.257,13.25 9,13.25C6.377,13.25 4.25,15.377 4.25,18C4.25,20.623 6.377,22.75 9,22.75C11.623,22.75 13.75,20.623 13.75,18V6.243C14.988,7.772 16.879,8.75 19,8.75C19.414,8.75 19.75,8.414 19.75,8C19.75,7.586 19.414,7.25 19,7.25C16.101,7.25 13.75,4.899 13.75,2Z"/>
|
||||
|
||||
</vector>
|
||||
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M13.75,2C13.75,1.586 13.414,1.25 13,1.25C12.586,1.25 12.25,1.586 12.25,2V14.536C11.4,13.738 10.257,13.25 9,13.25C6.377,13.25 4.25,15.377 4.25,18C4.25,20.623 6.377,22.75 9,22.75C11.623,22.75 13.75,20.623 13.75,18V6.243C14.988,7.772 16.879,8.75 19,8.75C19.414,8.75 19.75,8.414 19.75,8C19.75,7.586 19.414,7.25 19,7.25C16.101,7.25 13.75,4.899 13.75,2Z"
|
||||
android:fillColor="@color/textColor"/>
|
||||
</vector>
|
||||
@@ -5,6 +5,6 @@
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M5,7.766c0,-1.554 1.696,-2.515 3.029,-1.715l7.056,4.234c1.295,0.777 1.295,2.653 0,3.43l-7.056,4.234c-1.333,0.8 -3.029,-0.16 -3.029,-1.715V7.766zM14.056,12L7,7.766v8.468L14.056,12zM18,6a1,1 0,0 0,-1 1v10a1,1 0,1 0,2 0V7a1,1 0,0 0,-1 -1z"
|
||||
android:fillColor="@color/textColor"
|
||||
android:fillColor="?attr/colorPrimary"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M2,6C2,4.114 2,3.172 2.586,2.586C3.172,2 4.114,2 6,2C7.886,2 8.828,2 9.414,2.586C10,3.172 10,4.114 10,6V18C10,19.886 10,20.828 9.414,21.414C8.828,22 7.886,22 6,22C4.114,22 3.172,22 2.586,21.414C2,20.828 2,19.886 2,18V6Z"
|
||||
android:fillColor="@color/textColor"/>
|
||||
android:fillColor="?attr/colorPrimary"/>
|
||||
<path
|
||||
android:pathData="M14,6C14,4.114 14,3.172 14.586,2.586C15.172,2 16.114,2 18,2C19.886,2 20.828,2 21.414,2.586C22,3.172 22,4.114 22,6V18C22,19.886 22,20.828 21.414,21.414C20.828,22 19.886,22 18,22C16.114,22 15.172,22 14.586,21.414C14,20.828 14,19.886 14,18V6Z"
|
||||
android:fillColor="@color/textColor"/>
|
||||
android:fillColor="?attr/colorPrimary"/>
|
||||
</vector>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M19,7.766c0,-1.554 -1.696,-2.515 -3.029,-1.715l-7.056,4.234c-1.295,0.777 -1.295,2.653 0,3.43l7.056,4.234c1.333,0.8 3.029,-0.16 3.029,-1.715V7.766zM9.944,12L17,7.766v8.468L9.944,12zM6,6a1,1 0,0 1,1 1v10a1,1 0,1 1,-2 0V7a1,1 0,0 1,1 -1z"
|
||||
android:fillColor="@color/textColor"
|
||||
android:fillColor="?attr/colorPrimary"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
||||
@@ -15,24 +15,26 @@
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:id="@+id/toolBar"
|
||||
android:layout_marginTop="25dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageButton
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_back"
|
||||
android:scaleType="fitCenter"
|
||||
android:background="#00000000"
|
||||
android:padding="7dp"
|
||||
android:padding="8dp"
|
||||
android:id="@+id/back"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hidden_space"
|
||||
android:textSize="18sp"
|
||||
android:textSize="22sp"
|
||||
android:singleLine="true"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/folderName"/>
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activities.MainActivity">
|
||||
|
||||
<!-- Calculator Display -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/displayContainer"
|
||||
android:layout_width="0dp"
|
||||
@@ -52,7 +51,6 @@
|
||||
tools:ignore="Suspicious0dp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
@@ -75,255 +73,270 @@
|
||||
tools:ignore="Suspicious0dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- Calculator Buttons -->
|
||||
<androidx.gridlayout.widget.GridLayout
|
||||
android:id="@+id/buttonGrid"
|
||||
<LinearLayout
|
||||
android:id="@+id/buttonContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="8dp"
|
||||
app:columnCount="4"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/displayContainer"
|
||||
app:rowCount="5">
|
||||
app:layout_constraintTop_toBottomOf="@id/displayContainer">
|
||||
|
||||
<!-- Row 1 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnClear"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="C"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPercent"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnClear"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="C"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPercent"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="%"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDivide"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="÷"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/cut"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:background="@drawable/gradient_bg"
|
||||
android:src="@drawable/backspace"
|
||||
android:scaleType="centerInside"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="%"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDivide"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn7"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="7"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn8"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="8"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn9"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="9"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnMultiply"
|
||||
style="@style/CustomMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="×"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="÷"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/cut"
|
||||
android:layout_width="0dp"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn4"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="4"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn5"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="5"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn6"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="6"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnMinus"
|
||||
style="@style/CustomMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="-"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:gravity="center"
|
||||
android:textAlignment="center"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:icon="@drawable/backspace"
|
||||
app:iconSize="32dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- Row 2 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn7"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="1"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn2"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="2"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn3"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="3"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPlus"
|
||||
style="@style/CustomMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="+"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="7"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn8"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="8"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn0"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="2"
|
||||
android:text="0"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn9"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="9"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDot"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="."
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnMultiply"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="×"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnEquals"
|
||||
style="@style/CustomMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="="
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp" />
|
||||
|
||||
<!-- Row 3 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn4"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="4"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn5"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="5"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn6"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="6"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnMinus"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="-"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<!-- Row 4 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="1"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn2"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="2"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn3"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="3"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPlus"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="+"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<!-- Row 5 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn0"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="0"
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnSpan="2"
|
||||
app:layout_columnWeight="2"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDot"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="."
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnEquals"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="="
|
||||
android:textSize="30sp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_rowWeight="1" />
|
||||
|
||||
</androidx.gridlayout.widget.GridLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -15,6 +15,14 @@
|
||||
android:paddingLeft="15dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" >
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_back"
|
||||
android:scaleType="fitCenter"
|
||||
android:background="#00000000"
|
||||
android:padding="8dp"
|
||||
android:id="@+id/back"/>
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -46,16 +54,19 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/unHide"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="6dp"
|
||||
android:minWidth="120dp"
|
||||
android:layout_weight="1"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:text="Unhide" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="6dp"
|
||||
android:minWidth="120dp"
|
||||
android:text="Delete" />
|
||||
|
||||
10
app/src/main/res/layout/activity_settings.xml
Normal file
10
app/src/main/res/layout/activity_settings.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activities.SettingsActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -20,7 +20,7 @@
|
||||
android:id="@+id/selectedLayer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:alpha="0.2"
|
||||
android:alpha="0.3"
|
||||
android:background="?attr/colorControlNormal"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -14,11 +13,26 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/selectedLayer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:alpha="0.2"
|
||||
android:background="?attr/colorControlNormal"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
android:layout_margin="5dp"
|
||||
app:cardElevation="3dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -34,12 +48,22 @@
|
||||
android:src="@drawable/add_image" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
<ImageView
|
||||
android:id="@+id/selected"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:padding="3dp"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/selected"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<ImageView
|
||||
android:id="@+id/videoPlay"
|
||||
android:layout_width="43dp"
|
||||
android:layout_height="43dp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:contentDescription=""
|
||||
android:visibility="gone"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/play"
|
||||
@@ -54,7 +78,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="5dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:text="File Name" />
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/folderNameTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:text="Folder Name" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -41,8 +41,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="20dp"
|
||||
style="@style/Widget.Material3.CardView.Outlined">
|
||||
app:cardCornerRadius="15dp"
|
||||
app:cardElevation="10dp"
|
||||
android:layout_margin="20dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -53,7 +54,7 @@
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_margin="5dp"
|
||||
android:src="@drawable/music"
|
||||
android:src="@drawable/ic_audio"
|
||||
android:padding="3dp"/>
|
||||
|
||||
<TextView
|
||||
@@ -61,11 +62,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="audio.mp3"
|
||||
android:layout_margin="5dp"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:id="@+id/audioTitle"/>
|
||||
<SeekBar
|
||||
<com.google.android.material.slider.Slider
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:scaleY="0.6"
|
||||
android:id="@+id/audioSeekBar"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="white">#FF000000</color>
|
||||
<color name="black">#FFFFFFFF</color>
|
||||
|
||||
<!-- Material You dynamic colors -->
|
||||
<color name="primary">#00B43B</color>
|
||||
|
||||
@@ -18,4 +18,9 @@
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomMaterialButton" parent="Widget.MaterialComponents.Button">
|
||||
<item name="android:background">@drawable/gradient_bg</item>
|
||||
<item name="backgroundTint">@null</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -10,8 +10,13 @@
|
||||
<string name="rename_file">Rename File</string>
|
||||
<string name="share_file">Share File</string>
|
||||
<string name="add_document">Add Document</string>
|
||||
<string name="failed_to_hide_audio">Failed to hide Audios</string>
|
||||
<string name="failed_to_hide_documents">Failed to hide Documents</string>
|
||||
<string name="no_files_selected">No files selected</string>
|
||||
<string name="documents_hidden_successfully">Files hidden successfully</string>
|
||||
<string name="documents_hidden_successfully"> Files hidden successfully</string>
|
||||
<string name="failed_to_hide_unhide_photo">Failed to hide/unhide photo</string>
|
||||
<string name="images_hidden_successfully"> Images hidden successfully</string>
|
||||
<string name="failed_to_hide_images">Failed to hide images</string>
|
||||
<string name="failed_to_hide_files">Failed to hide files</string>
|
||||
<string name="storage_permissions_granted">Storage permissions granted</string>
|
||||
<string name="storage_permissions_denied">Storage permissions denied</string>
|
||||
@@ -43,22 +48,47 @@
|
||||
<string name="answer_cannot_be_empty">Answer cannot be empty!</string>
|
||||
<string name="password_successfully_reset">Password successfully reset.</string>
|
||||
<string name="invalid_answer">Invalid answer!</string>
|
||||
<string name="videos_hidden_successfully"> Videos hidden successfully</string>
|
||||
<string name="failed_to_hide_videos">Failed to hide videos</string>
|
||||
<string name="image">IMAGE</string>
|
||||
<string name="video">VIDEO</string>
|
||||
<string name="audio">AUDIO</string>
|
||||
<string name="delete">Delete</string>
|
||||
<string name="create">Create</string>
|
||||
<string name="delete_folder">Delete Folder</string>
|
||||
<string name="rename">Rename</string>
|
||||
<string name="cannot_delete_folder">Cannot Delete Folder</string>
|
||||
<string name="document">DOCUMENT</string>
|
||||
<string name="no_audio_player_found">No audio player found!</string>
|
||||
<string name="no_suitable_app_found_to_open_this_document">No suitable app found to open this document!</string>
|
||||
<string name="enter_123456">Enter 123456</string>
|
||||
<string name="unknown_file">Unknown File</string>
|
||||
<string name="details"> DETAILS</string>
|
||||
<string name="audio_hidded_successfully">Audios hidden successfully</string>
|
||||
<string name="no_items_available_add_one_by_clicking_on_the_plus_button">No Items Available, Add one by clicking on the</string>
|
||||
<string name="now_enter_button">Now Enter \'=\' button</string>
|
||||
<string name="enter_123456">Enter 123456</string>
|
||||
<string name="create_folder">Create Folder</string>
|
||||
<string name="enter_folder_name">Enter folder name</string>
|
||||
<string name="folder_already_exists">Folder already exists</string>
|
||||
<string name="folder_options">Folder Options</string>
|
||||
<string name="rename_folder">Rename Folder</string>
|
||||
<string name="enter_new_folder_name">Enter new folder name</string>
|
||||
<string name="failed_to_create_folder">Failed to create folder</string>
|
||||
<string name="are_you_sure_you_want_to_delete_this_folder">Are you sure you want to delete this folder?</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="error_loading_files">Error loading files</string>
|
||||
<string name="delete_items">Delete Folder</string>
|
||||
<string name="are_you_sure_you_want_to_delete_selected_items">Are you sure you want to delete selected Folders?</string>
|
||||
<string name="items_deleted_successfully">Items deleted successfully</string>
|
||||
<string name="folder_deleted_successfully">Folder deleted successfully</string>
|
||||
<string name="some_items_could_not_be_deleted">Some items could not be deleted</string>
|
||||
<string name="hidden_space">Hidden Space</string>
|
||||
<string name="there_was_a_problem_in_the_folder">There was a problem in the Folder</string>
|
||||
<string name="hiding_files">Hiding Files</string>
|
||||
<string name="file_unhidden_successfully">File Will Now Show In Gallery</string>
|
||||
<string name="file_unhidden_but_failed_to_remove_from_hidden_folder">File unhidden but failed to remove from hidden folder</string>
|
||||
<string name="failed_to_unhidden_file">Failed to unhidden file</string>
|
||||
<string name="failed_to_create_uri_for_file">Failed to create URI for file</string>
|
||||
<string name="error_unhiding_file">Error unhiding file: %1$s</string>
|
||||
<string name="select_multiple">Select Multiple</string>
|
||||
</resources>
|
||||
@@ -20,4 +20,9 @@
|
||||
</style>
|
||||
|
||||
<style name="Theme.Calculator" parent="Base.Theme.Calculator" />
|
||||
|
||||
<style name="CustomMaterialButton" parent="Widget.MaterialComponents.Button">
|
||||
<item name="android:background">@drawable/gradient_bg</item>
|
||||
<item name="backgroundTint">@null</item>
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user