Changes For Folder Feature
This commit is contained in:
@@ -47,7 +47,6 @@ class HiddenActivity : AppCompatActivity() {
|
|||||||
binding = ActivityHiddenBinding.inflate(layoutInflater)
|
binding = ActivityHiddenBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|
||||||
// Initialize managers
|
|
||||||
fileManager = FileManager(this, this)
|
fileManager = FileManager(this, this)
|
||||||
folderManager = FolderManager(this)
|
folderManager = FolderManager(this)
|
||||||
dialogUtil = DialogUtil(this)
|
dialogUtil = DialogUtil(this)
|
||||||
@@ -56,16 +55,16 @@ class HiddenActivity : AppCompatActivity() {
|
|||||||
setupClickListeners()
|
setupClickListeners()
|
||||||
setupBackPressedHandler()
|
setupBackPressedHandler()
|
||||||
|
|
||||||
// Initialize permissions and load data
|
|
||||||
fileManager.askPermission(this)
|
fileManager.askPermission(this)
|
||||||
|
|
||||||
// Set initial orientation icon based on saved preference
|
|
||||||
refreshCurrentView()
|
refreshCurrentView()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupInitialUIState() {
|
private fun setupInitialUIState() {
|
||||||
|
|
||||||
binding.addFolder.visibility = View.VISIBLE
|
binding.addFolder.visibility = View.VISIBLE
|
||||||
|
binding.settings.visibility = View.VISIBLE
|
||||||
|
binding.folderOrientation.visibility = View.VISIBLE
|
||||||
binding.deleteSelected.visibility = View.GONE
|
binding.deleteSelected.visibility = View.GONE
|
||||||
binding.delete.visibility = View.GONE
|
binding.delete.visibility = View.GONE
|
||||||
binding.menuButton.visibility = View.GONE
|
binding.menuButton.visibility = View.GONE
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ class PreviewActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
private fun clickListeners() {
|
private fun clickListeners() {
|
||||||
binding.delete.setOnClickListener {
|
binding.delete.setOnClickListener {
|
||||||
val fileUri = FileManager.FileManager().getContentUriImage(this, files[binding.viewPager.currentItem], filetype)
|
val fileUri = FileManager.FileManager().getContentUriImage(this, files[binding.viewPager.currentItem])
|
||||||
if (fileUri != null) {
|
if (fileUri != null) {
|
||||||
dialogUtil.showMaterialDialog(
|
dialogUtil.showMaterialDialog(
|
||||||
getString(R.string.delete_file),
|
getString(R.string.delete_file),
|
||||||
@@ -153,7 +153,7 @@ class PreviewActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.unHide.setOnClickListener {
|
binding.unHide.setOnClickListener {
|
||||||
val fileUri = FileManager.FileManager().getContentUriImage(this, files[binding.viewPager.currentItem], filetype)
|
val fileUri = FileManager.FileManager().getContentUriImage(this, files[binding.viewPager.currentItem])
|
||||||
if (fileUri != null) {
|
if (fileUri != null) {
|
||||||
dialogUtil.showMaterialDialog(
|
dialogUtil.showMaterialDialog(
|
||||||
getString(R.string.un_hide_file),
|
getString(R.string.un_hide_file),
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import devs.org.calculator.utils.DialogUtil
|
|||||||
import devs.org.calculator.utils.FileManager
|
import devs.org.calculator.utils.FileManager
|
||||||
import devs.org.calculator.utils.FileManager.Companion.HIDDEN_DIR
|
import devs.org.calculator.utils.FileManager.Companion.HIDDEN_DIR
|
||||||
import devs.org.calculator.utils.FolderManager
|
import devs.org.calculator.utils.FolderManager
|
||||||
import devs.org.calculator.utils.PrefsUtil
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
private var customDialog: androidx.appcompat.app.AlertDialog? = null
|
private var customDialog: androidx.appcompat.app.AlertDialog? = null
|
||||||
|
|
||||||
private var dialogShowTime: Long = 0
|
private var dialogShowTime: Long = 0
|
||||||
private val MINIMUM_DIALOG_DURATION = 1700L
|
private val MINIMUM_DIALOG_DURATION = 1200L
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@@ -110,6 +109,7 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
private fun showCustomDialog(count: Int) {
|
private fun showCustomDialog(count: Int) {
|
||||||
val dialogView = ProccessingDialogBinding.inflate(layoutInflater)
|
val dialogView = ProccessingDialogBinding.inflate(layoutInflater)
|
||||||
customDialog = MaterialAlertDialogBuilder(this)
|
customDialog = MaterialAlertDialogBuilder(this)
|
||||||
@@ -129,16 +129,26 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
mainHandler.postDelayed({
|
mainHandler.postDelayed({
|
||||||
customDialog?.dismiss()
|
customDialog?.dismiss()
|
||||||
customDialog = null
|
customDialog = null
|
||||||
|
updateFilesToAdapter()
|
||||||
}, remainingTime)
|
}, remainingTime)
|
||||||
} else {
|
} else {
|
||||||
customDialog?.dismiss()
|
customDialog?.dismiss()
|
||||||
customDialog = null
|
customDialog = null
|
||||||
|
updateFilesToAdapter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateFilesToAdapter() {
|
||||||
|
openFolder(currentFolder!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun processSelectedFiles(uriList: List<Uri>) {
|
private fun processSelectedFiles(uriList: List<Uri>) {
|
||||||
val targetFolder = currentFolder ?: hiddenDir
|
val targetFolder = currentFolder ?: hiddenDir
|
||||||
|
if (!targetFolder.exists()) {
|
||||||
|
targetFolder.mkdirs()
|
||||||
|
File(targetFolder, ".nomedia").createNewFile()
|
||||||
|
}
|
||||||
|
|
||||||
showCustomDialog(uriList.size)
|
showCustomDialog(uriList.size)
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
@@ -147,8 +157,9 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
object : FileProcessCallback {
|
object : FileProcessCallback {
|
||||||
override fun onFilesProcessedSuccessfully(copiedFiles: List<File>) {
|
override fun onFilesProcessedSuccessfully(copiedFiles: List<File>) {
|
||||||
mainHandler.post {
|
mainHandler.post {
|
||||||
refreshCurrentView()
|
mainHandler.postDelayed({
|
||||||
dismissCustomDialog()
|
dismissCustomDialog()
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,6 +199,11 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun openFolder(folder: File) {
|
private fun openFolder(folder: File) {
|
||||||
|
// Ensure folder exists and has .nomedia file
|
||||||
|
if (!folder.exists()) {
|
||||||
|
folder.mkdirs()
|
||||||
|
File(folder, ".nomedia").createNewFile()
|
||||||
|
}
|
||||||
|
|
||||||
val files = folderManager.getFilesInFolder(folder)
|
val files = folderManager.getFilesInFolder(folder)
|
||||||
binding.folderName.text = folder.name
|
binding.folderName.text = folder.name
|
||||||
@@ -212,7 +228,7 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
fileAdapter = FileAdapter(this, this, folder, prefs.getBoolean("showFileName", true),
|
fileAdapter = FileAdapter(this, this, folder, prefs.getBoolean("showFileName", true),
|
||||||
onFolderLongClick = { isSelected ->
|
onFolderLongClick = { isSelected ->
|
||||||
handleFileSelectionModeChange(isSelected, 0)
|
handleFileSelectionModeChange(isSelected)
|
||||||
}).apply {
|
}).apply {
|
||||||
setFileOperationCallback(object : FileAdapter.FileOperationCallback {
|
setFileOperationCallback(object : FileAdapter.FileOperationCallback {
|
||||||
override fun onFileDeleted(file: File) {
|
override fun onFileDeleted(file: File) {
|
||||||
@@ -228,7 +244,7 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onSelectionModeChanged(isSelectionMode: Boolean, selectedCount: Int) {
|
override fun onSelectionModeChanged(isSelectionMode: Boolean, selectedCount: Int) {
|
||||||
handleFileSelectionModeChange(isSelectionMode, selectedCount)
|
handleFileSelectionModeChange(isSelectionMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSelectionCountChanged(selectedCount: Int) {
|
override fun onSelectionCountChanged(selectedCount: Int) {
|
||||||
@@ -243,18 +259,16 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
binding.recyclerView.visibility = View.VISIBLE
|
binding.recyclerView.visibility = View.VISIBLE
|
||||||
binding.noItems.visibility = View.GONE
|
binding.noItems.visibility = View.GONE
|
||||||
|
|
||||||
// Setup menu button click listener
|
|
||||||
binding.menuButton.setOnClickListener {
|
binding.menuButton.setOnClickListener {
|
||||||
fileAdapter?.let { adapter ->
|
fileAdapter?.let { adapter ->
|
||||||
showFileOptionsMenu(adapter.getSelectedItems())
|
showFileOptionsMenu(adapter.getSelectedItems())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set initial UI state
|
|
||||||
showFileViewIcons()
|
showFileViewIcons()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Deprecated("This method has been deprecated in favor of using the\n {@link OnBackPressedDispatcher} via {@link #getOnBackPressedDispatcher()}.\n The OnBackPressedDispatcher controls how back button events are dispatched\n to one or more {@link OnBackPressedCallback} objects.")
|
||||||
@SuppressLint("MissingSuperCall")
|
@SuppressLint("MissingSuperCall")
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
handleBackPress()
|
handleBackPress()
|
||||||
@@ -268,7 +282,7 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
super.onBackPressed()
|
super.onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleFileSelectionModeChange(isSelectionMode: Boolean, selectedCount: Int) {
|
private fun handleFileSelectionModeChange(isSelectionMode: Boolean) {
|
||||||
if (isSelectionMode) {
|
if (isSelectionMode) {
|
||||||
showFileSelectionIcons()
|
showFileSelectionIcons()
|
||||||
} else {
|
} else {
|
||||||
@@ -277,7 +291,6 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateSelectionCountDisplay(selectedCount: Int) {
|
private fun updateSelectionCountDisplay(selectedCount: Int) {
|
||||||
// Update any UI elements that show selection count
|
|
||||||
if (selectedCount > 0) {
|
if (selectedCount > 0) {
|
||||||
showFileSelectionIcons()
|
showFileSelectionIcons()
|
||||||
} else {
|
} else {
|
||||||
@@ -366,13 +379,10 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
private fun refreshCurrentFolder() {
|
private fun refreshCurrentFolder() {
|
||||||
currentFolder?.let { folder ->
|
currentFolder?.let { folder ->
|
||||||
val files = folderManager.getFilesInFolder(folder)
|
val files = folderManager.getFilesInFolder(folder)
|
||||||
fileAdapter?.submitList(files)
|
if (files.isNotEmpty()) {
|
||||||
|
|
||||||
if (files.isEmpty()) {
|
|
||||||
showEmptyState()
|
|
||||||
} else {
|
|
||||||
binding.recyclerView.visibility = View.VISIBLE
|
binding.recyclerView.visibility = View.VISIBLE
|
||||||
binding.noItems.visibility = View.GONE
|
binding.noItems.visibility = View.GONE
|
||||||
|
fileAdapter?.submitList(files.toMutableList())
|
||||||
fileAdapter?.let { adapter ->
|
fileAdapter?.let { adapter ->
|
||||||
if (adapter.isInSelectionMode()) {
|
if (adapter.isInSelectionMode()) {
|
||||||
showFileSelectionIcons()
|
showFileSelectionIcons()
|
||||||
@@ -380,6 +390,8 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
showFileViewIcons()
|
showFileViewIcons()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
showEmptyState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -414,6 +426,7 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
||||||
addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
|
addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
|
||||||
}
|
}
|
||||||
|
closeFabs()
|
||||||
pickImageLauncher.launch(intent)
|
pickImageLauncher.launch(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,14 +494,17 @@ class ViewFolderActivity : AppCompatActivity() {
|
|||||||
var allUnhidden = true
|
var allUnhidden = true
|
||||||
selectedFiles.forEach { file ->
|
selectedFiles.forEach { file ->
|
||||||
try {
|
try {
|
||||||
val fileUri = Uri.fromFile(file)
|
val fileUri = FileManager.FileManager().getContentUriImage(this@ViewFolderActivity, file)
|
||||||
val result = fileManager.copyFileToNormalDir(fileUri)
|
|
||||||
if (result == null) {
|
if (fileUri != null) {
|
||||||
allUnhidden = false
|
val result = fileManager.copyFileToNormalDir(fileUri)
|
||||||
|
if (result == null) {
|
||||||
|
allUnhidden = false
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Delete the hidden file after successful copy
|
allUnhidden = false
|
||||||
file.delete()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
allUnhidden = false
|
allUnhidden = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ class FileAdapter(
|
|||||||
|
|
||||||
override fun onBindViewHolder(holder: FileViewHolder, position: Int, payloads: MutableList<Any>) {
|
override fun onBindViewHolder(holder: FileViewHolder, position: Int, payloads: MutableList<Any>) {
|
||||||
if (payloads.isEmpty()) {
|
if (payloads.isEmpty()) {
|
||||||
super.onBindViewHolder(holder, position, payloads)
|
onBindViewHolder(holder, position)
|
||||||
} else {
|
} else {
|
||||||
if (position < itemCount) {
|
if (position < itemCount) {
|
||||||
val file = getItem(position)
|
val file = getItem(position)
|
||||||
@@ -481,9 +481,18 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
override fun submitList(list: List<File>?) {
|
||||||
* Enter selection mode and notify callback immediately
|
val currentList = currentList.toMutableList()
|
||||||
*/
|
if (list == null) {
|
||||||
|
currentList.clear()
|
||||||
|
super.submitList(null)
|
||||||
|
} else {
|
||||||
|
// Create a new list to force update
|
||||||
|
val newList = list.toMutableList()
|
||||||
|
super.submitList(newList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun enterSelectionMode() {
|
fun enterSelectionMode() {
|
||||||
if (!isSelectionMode) {
|
if (!isSelectionMode) {
|
||||||
isSelectionMode = true
|
isSelectionMode = true
|
||||||
@@ -491,9 +500,6 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Exit selection mode and clear all selections
|
|
||||||
*/
|
|
||||||
fun exitSelectionMode() {
|
fun exitSelectionMode() {
|
||||||
if (isSelectionMode) {
|
if (isSelectionMode) {
|
||||||
isSelectionMode = false
|
isSelectionMode = false
|
||||||
@@ -503,9 +509,6 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear selection without exiting selection mode
|
|
||||||
*/
|
|
||||||
fun clearSelection() {
|
fun clearSelection() {
|
||||||
if (selectedItems.isNotEmpty()) {
|
if (selectedItems.isNotEmpty()) {
|
||||||
val previouslySelected = selectedItems.toSet()
|
val previouslySelected = selectedItems.toSet()
|
||||||
@@ -519,9 +522,6 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Select all items
|
|
||||||
*/
|
|
||||||
fun selectAll() {
|
fun selectAll() {
|
||||||
if (!isSelectionMode) {
|
if (!isSelectionMode) {
|
||||||
enterSelectionMode()
|
enterSelectionMode()
|
||||||
@@ -542,9 +542,6 @@ class FileAdapter(
|
|||||||
updateSelectionItems(selectedItems.toSet(), previouslySelected)
|
updateSelectionItems(selectedItems.toSet(), previouslySelected)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Efficiently update selection UI for changed items only
|
|
||||||
*/
|
|
||||||
private fun updateSelectionItems(newSelections: Set<Int>, oldSelections: Set<Int>) {
|
private fun updateSelectionItems(newSelections: Set<Int>, oldSelections: Set<Int>) {
|
||||||
val changedItems = (oldSelections - newSelections) + (newSelections - oldSelections)
|
val changedItems = (oldSelections - newSelections) + (newSelections - oldSelections)
|
||||||
changedItems.forEach { position ->
|
changedItems.forEach { position ->
|
||||||
@@ -554,36 +551,24 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Centralized method to notify selection mode changes
|
|
||||||
*/
|
|
||||||
private fun notifySelectionModeChange() {
|
private fun notifySelectionModeChange() {
|
||||||
fileOperationCallback?.get()?.onSelectionModeChanged(isSelectionMode, selectedItems.size)
|
fileOperationCallback?.get()?.onSelectionModeChanged(isSelectionMode, selectedItems.size)
|
||||||
onFolderLongClick(isSelectionMode)
|
onFolderLongClick(isSelectionMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get selected files
|
|
||||||
*/
|
|
||||||
fun getSelectedItems(): List<File> {
|
fun getSelectedItems(): List<File> {
|
||||||
return selectedItems.mapNotNull { position ->
|
return selectedItems.mapNotNull { position ->
|
||||||
if (position < itemCount) getItem(position) else null
|
if (position < itemCount) getItem(position) else null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get selected file count
|
|
||||||
*/
|
|
||||||
fun getSelectedCount(): Int = selectedItems.size
|
fun getSelectedCount(): Int = selectedItems.size
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if in selection mode
|
|
||||||
*/
|
|
||||||
fun isInSelectionMode(): Boolean = isSelectionMode
|
fun isInSelectionMode(): Boolean = isSelectionMode
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete selected files with proper error handling and background processing
|
|
||||||
*/
|
|
||||||
fun deleteSelectedFiles() {
|
fun deleteSelectedFiles() {
|
||||||
val selectedFiles = getSelectedItems()
|
val selectedFiles = getSelectedItems()
|
||||||
if (selectedFiles.isEmpty()) return
|
if (selectedFiles.isEmpty()) return
|
||||||
@@ -647,9 +632,7 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Share selected files
|
|
||||||
*/
|
|
||||||
fun shareSelectedFiles() {
|
fun shareSelectedFiles() {
|
||||||
val selectedFiles = getSelectedItems()
|
val selectedFiles = getSelectedItems()
|
||||||
if (selectedFiles.isEmpty()) return
|
if (selectedFiles.isEmpty()) return
|
||||||
@@ -707,10 +690,7 @@ class FileAdapter(
|
|||||||
exitSelectionMode()
|
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 {
|
fun onBackPressed(): Boolean {
|
||||||
return if (isSelectionMode) {
|
return if (isSelectionMode) {
|
||||||
exitSelectionMode()
|
exitSelectionMode()
|
||||||
@@ -720,10 +700,6 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Force refresh of all selection states
|
|
||||||
* Call this if you notice selection UI issues
|
|
||||||
*/
|
|
||||||
fun refreshSelectionStates() {
|
fun refreshSelectionStates() {
|
||||||
if (isSelectionMode) {
|
if (isSelectionMode) {
|
||||||
selectedItems.forEach { position ->
|
selectedItems.forEach { position ->
|
||||||
@@ -736,9 +712,6 @@ class FileAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Clean up resources to prevent memory leaks
|
|
||||||
*/
|
|
||||||
fun cleanup() {
|
fun cleanup() {
|
||||||
try {
|
try {
|
||||||
if (!fileExecutor.isShutdown) {
|
if (!fileExecutor.isShutdown) {
|
||||||
@@ -751,10 +724,6 @@ class FileAdapter(
|
|||||||
fileOperationCallback?.clear()
|
fileOperationCallback?.clear()
|
||||||
fileOperationCallback = null
|
fileOperationCallback = null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Call this from the activity's onDestroy()
|
|
||||||
*/
|
|
||||||
override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) {
|
override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) {
|
||||||
super.onDetachedFromRecyclerView(recyclerView)
|
super.onDetachedFromRecyclerView(recyclerView)
|
||||||
cleanup()
|
cleanup()
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ class FileDiffCallback : DiffUtil.ItemCallback<File>() {
|
|||||||
oldItem.length() == newItem.length() &&
|
oldItem.length() == newItem.length() &&
|
||||||
oldItem.lastModified() == newItem.lastModified() &&
|
oldItem.lastModified() == newItem.lastModified() &&
|
||||||
oldItem.canRead() == newItem.canRead() &&
|
oldItem.canRead() == newItem.canRead() &&
|
||||||
oldItem.canWrite() == newItem.canWrite()
|
oldItem.canWrite() == newItem.canWrite() &&
|
||||||
|
oldItem.exists() == newItem.exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getChangePayload(oldItem: File, newItem: File): Any? {
|
override fun getChangePayload(oldItem: File, newItem: File): Any? {
|
||||||
@@ -37,6 +38,10 @@ class FileDiffCallback : DiffUtil.ItemCallback<File>() {
|
|||||||
changes.add("MODIFIED_DATE_CHANGED")
|
changes.add("MODIFIED_DATE_CHANGED")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldItem.exists() != newItem.exists()) {
|
||||||
|
changes.add("EXISTENCE_CHANGED")
|
||||||
|
}
|
||||||
|
|
||||||
return if (changes.isNotEmpty()) changes else null
|
return if (changes.isNotEmpty()) changes else null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ import androidx.lifecycle.LifecycleOwner
|
|||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import devs.org.calculator.callbacks.FileProcessCallback
|
import devs.org.calculator.callbacks.FileProcessCallback
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -79,6 +80,12 @@ class FileManager(private val context: Context, private val lifecycleOwner: Life
|
|||||||
|
|
||||||
// Get the target directory (i am using the current opened folder as target folder)
|
// Get the target directory (i am using the current opened folder as target folder)
|
||||||
val targetDir = folderName
|
val targetDir = folderName
|
||||||
|
|
||||||
|
// Ensure target directory exists and has .nomedia file
|
||||||
|
if (!targetDir.exists()) {
|
||||||
|
targetDir.mkdirs()
|
||||||
|
File(targetDir, ".nomedia").createNewFile()
|
||||||
|
}
|
||||||
|
|
||||||
// Create target file
|
// Create target file
|
||||||
val mimeType = contentResolver.getType(uri)
|
val mimeType = contentResolver.getType(uri)
|
||||||
@@ -219,11 +226,7 @@ class FileManager(private val context: Context, private val lifecycleOwner: Life
|
|||||||
if (documentFile?.exists() == true && documentFile.canWrite()) {
|
if (documentFile?.exists() == true && documentFile.canWrite()) {
|
||||||
val deleted = documentFile.delete()
|
val deleted = documentFile.delete()
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
if (deleted) {
|
|
||||||
// Toast.makeText(context, "File deleted successfully", Toast.LENGTH_SHORT).show()
|
// Toast.makeText(context, "File deleted successfully", Toast.LENGTH_SHORT).show()
|
||||||
} else {
|
|
||||||
Toast.makeText(context, "Failed to hide/unhide file", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return@withContext
|
return@withContext
|
||||||
}
|
}
|
||||||
@@ -232,7 +235,7 @@ class FileManager(private val context: Context, private val lifecycleOwner: Life
|
|||||||
try {
|
try {
|
||||||
context.contentResolver.delete(photoUri, null, null)
|
context.contentResolver.delete(photoUri, null, null)
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
// Toast.makeText(context, "File deleted successfully", Toast.LENGTH_SHORT).show()
|
// Toast.makeText(context, "File deleted successfully", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
} catch (e: SecurityException) {
|
} catch (e: SecurityException) {
|
||||||
// Handle security exception for Android 10 and above
|
// Handle security exception for Android 10 and above
|
||||||
@@ -290,8 +293,8 @@ class FileManager(private val context: Context, private val lifecycleOwner: Life
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
class FileManager(){
|
class FileManager{
|
||||||
fun getContentUriImage(context: Context, file: File, fileType: FileType): Uri? {
|
fun getContentUriImage(context: Context, file: File): Uri? {
|
||||||
|
|
||||||
// Query MediaStore for the file
|
// Query MediaStore for the file
|
||||||
val projection = arrayOf(MediaStore.MediaColumns._ID)
|
val projection = arrayOf(MediaStore.MediaColumns._ID)
|
||||||
@@ -341,7 +344,7 @@ class FileManager(private val context: Context, private val lifecycleOwner: Life
|
|||||||
|
|
||||||
suspend fun processMultipleFiles(
|
suspend fun processMultipleFiles(
|
||||||
uriList: List<Uri>,
|
uriList: List<Uri>,
|
||||||
fileType: File,
|
targetFolder: File,
|
||||||
callback: FileProcessCallback,
|
callback: FileProcessCallback,
|
||||||
currentDir: File? = null
|
currentDir: File? = null
|
||||||
) {
|
) {
|
||||||
@@ -349,12 +352,14 @@ class FileManager(private val context: Context, private val lifecycleOwner: Life
|
|||||||
val copiedFiles = mutableListOf<File>()
|
val copiedFiles = mutableListOf<File>()
|
||||||
for (uri in uriList) {
|
for (uri in uriList) {
|
||||||
try {
|
try {
|
||||||
val file = copyFileToHiddenDir(uri, fileType, currentDir)
|
val file = copyFileToHiddenDir(uri, targetFolder, currentDir)
|
||||||
file?.let { copiedFiles.add(it) }
|
file?.let { copiedFiles.add(it) }
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delay(500)
|
||||||
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
if (copiedFiles.isNotEmpty()) {
|
if (copiedFiles.isNotEmpty()) {
|
||||||
callback.onFilesProcessedSuccessfully(copiedFiles)
|
callback.onFilesProcessedSuccessfully(copiedFiles)
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
android:fillColor="?attr/colorPrimary"
|
android:fillColor="#fff"
|
||||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
|
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
|
||||||
</vector>
|
</vector>
|
||||||
@@ -5,5 +5,5 @@
|
|||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
|
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
|
||||||
android:fillColor="?attr/colorPrimary"/>
|
android:fillColor="#fff"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
android:viewportHeight="16">
|
android:viewportHeight="16">
|
||||||
<path
|
<path
|
||||||
android:pathData="M4,13L2,13L2,11L4,11ZM14,11L6,11v2h8ZM4,7L2,7L2,9L4,9ZM14,7L6,7L6,9h8ZM4,3L2,3L2,5L4,5ZM14,3L6,3L6,5h8Z"
|
android:pathData="M4,13L2,13L2,11L4,11ZM14,11L6,11v2h8ZM4,7L2,7L2,9L4,9ZM14,7L6,7L6,9h8ZM4,3L2,3L2,5L4,5ZM14,3L6,3L6,5h8Z"
|
||||||
android:fillColor="?attr/colorPrimary"/>
|
android:fillColor="#ffffff"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
android:height="24dp" android:viewportHeight="24"
|
android:height="24dp" android:viewportHeight="24"
|
||||||
android:viewportWidth="24" android:width="24dp">
|
android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
<path android:fillColor="?attr/colorPrimary"
|
<path android:fillColor="#fff"
|
||||||
android:pathData="M12,12H12.01M12,6H12.01M12,18H12.01M13,12C13,12.552 12.552,13 12,13C11.448,13 11,12.552 11,12C11,11.448 11.448,11 12,11C12.552,11 13,11.448 13,12ZM13,18C13,18.552 12.552,19 12,19C11.448,19 11,18.552 11,18C11,17.448 11.448,17 12,17C12.552,17 13,17.448 13,18ZM13,6C13,6.552 12.552,7 12,7C11.448,7 11,6.552 11,6C11,5.448 11.448,5 12,5C12.552,5 13,5.448 13,6Z" android:strokeColor="?attr/colorPrimary" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="2"/>
|
android:pathData="M12,12H12.01M12,6H12.01M12,18H12.01M13,12C13,12.552 12.552,13 12,13C11.448,13 11,12.552 11,12C11,11.448 11.448,11 12,11C12.552,11 13,11.448 13,12ZM13,18C13,18.552 12.552,19 12,19C11.448,19 11,18.552 11,18C11,17.448 11.448,17 12,17C12.552,17 13,17.448 13,18ZM13,6C13,6.552 12.552,7 12,7C11.448,7 11,6.552 11,6C11,5.448 11.448,5 12,5C12.552,5 13,5.448 13,6Z" android:strokeColor="#fff" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="2"/>
|
||||||
|
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
android:pathData="M4,13.743l-1,0.579a1,1 0,0 0,-0.366 1.366l1.488,2.578a1,1 0,0 0,1.366 0.366L6.5,18.05a1.987,1.987 0,0 1,1.986 0l0.02,0.011a1.989,1.989 0,0 1,1 1.724V21a1,1 0,0 0,1 1h3a1,1 0,0 0,1 -1V19.782a1.985,1.985 0,0 1,0.995 -1.721l0.021,-0.012a1.987,1.987 0,0 1,1.986 0l1.008,0.582a1,1 0,0 0,1.366 -0.366l1.488,-2.578A1,1 0,0 0,21 14.322l-1,-0.579a1.994,1.994 0,0 1,-1 -1.733v-0.021a1.991,1.991 0,0 1,1 -1.732l1,-0.579a1,1 0,0 0,0.366 -1.366L19.876,5.734a1,1 0,0 0,-1.366 -0.366L17.5,5.95a1.987,1.987 0,0 1,-1.986 0L15.5,5.94a1.989,1.989 0,0 1,-1 -1.724V3a1,1 0,0 0,-1 -1h-3a1,1 0,0 0,-1 1V4.294A1.856,1.856 0,0 1,8.57 5.9l-0.153,0.088a1.855,1.855 0,0 1,-1.853 0L5.49,5.368a1,1 0,0 0,-1.366 0.366L2.636,8.312A1,1 0,0 0,3 9.678l1,0.579A1.994,1.994 0,0 1,5 11.99v0.021A1.991,1.991 0,0 1,4 13.743ZM12,9a3,3 0,1 1,-3 3A3,3 0,0 1,12 9Z"
|
android:pathData="M4,13.743l-1,0.579a1,1 0,0 0,-0.366 1.366l1.488,2.578a1,1 0,0 0,1.366 0.366L6.5,18.05a1.987,1.987 0,0 1,1.986 0l0.02,0.011a1.989,1.989 0,0 1,1 1.724V21a1,1 0,0 0,1 1h3a1,1 0,0 0,1 -1V19.782a1.985,1.985 0,0 1,0.995 -1.721l0.021,-0.012a1.987,1.987 0,0 1,1.986 0l1.008,0.582a1,1 0,0 0,1.366 -0.366l1.488,-2.578A1,1 0,0 0,21 14.322l-1,-0.579a1.994,1.994 0,0 1,-1 -1.733v-0.021a1.991,1.991 0,0 1,1 -1.732l1,-0.579a1,1 0,0 0,0.366 -1.366L19.876,5.734a1,1 0,0 0,-1.366 -0.366L17.5,5.95a1.987,1.987 0,0 1,-1.986 0L15.5,5.94a1.989,1.989 0,0 1,-1 -1.724V3a1,1 0,0 0,-1 -1h-3a1,1 0,0 0,-1 1V4.294A1.856,1.856 0,0 1,8.57 5.9l-0.153,0.088a1.855,1.855 0,0 1,-1.853 0L5.49,5.368a1,1 0,0 0,-1.366 0.366L2.636,8.312A1,1 0,0 0,3 9.678l1,0.579A1.994,1.994 0,0 1,5 11.99v0.021A1.991,1.991 0,0 1,4 13.743ZM12,9a3,3 0,1 1,-3 3A3,3 0,0 1,12 9Z"
|
||||||
android:fillColor="?attr/colorPrimary"/>
|
android:fillColor="#fff"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/ic_back"
|
android:src="@drawable/ic_back"
|
||||||
|
app:tint="@color/svgTintColor"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:background="#00000000"
|
android:background="#00000000"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
@@ -38,17 +39,18 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:id="@+id/folderName"/>
|
android:id="@+id/folderName"/>
|
||||||
|
|
||||||
<ImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/ic_edit"
|
android:src="@drawable/ic_edit"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:padding="9dp"
|
android:padding="9dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:background="#00000000"
|
android:background="#00000000"
|
||||||
android:id="@+id/edit"/>
|
android:id="@+id/edit"/>
|
||||||
|
|
||||||
<ImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/delete"
|
android:id="@+id/delete"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
@@ -56,31 +58,36 @@
|
|||||||
android:padding="9dp"
|
android:padding="9dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/ic_delete"
|
android:src="@drawable/ic_delete"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/menuButton"
|
android:id="@+id/menuButton"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/ic_more"
|
android:src="@drawable/ic_more"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:padding="9dp"
|
android:padding="9dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:background="#00000000"/>
|
android:background="#00000000"/>
|
||||||
|
|
||||||
<ImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/ic_list"
|
android:src="@drawable/ic_list"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
android:background="#00000000"
|
android:background="#00000000"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:id="@+id/folderOrientation"/>
|
android:id="@+id/folderOrientation"/>
|
||||||
<ImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/ic_settings"
|
android:src="@drawable/ic_settings"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
|
|
||||||
android:background="#00000000"
|
android:background="#00000000"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:id="@+id/settings"/>
|
android:id="@+id/settings"/>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/ic_back"
|
android:src="@drawable/ic_back"
|
||||||
|
app:tint="@color/svgTintColor"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:background="#00000000"
|
android:background="#00000000"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
@@ -39,11 +40,12 @@
|
|||||||
android:id="@+id/folderName"/>
|
android:id="@+id/folderName"/>
|
||||||
|
|
||||||
|
|
||||||
<ImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/menuButton"
|
android:id="@+id/menuButton"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/ic_more"
|
android:src="@drawable/ic_more"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:padding="7dp"
|
android:padding="7dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
@@ -100,7 +102,6 @@
|
|||||||
android:text="@string/add_image"
|
android:text="@string/add_image"
|
||||||
app:tint="@color/white"
|
app:tint="@color/white"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:fabCustomSize="48dp"
|
|
||||||
android:backgroundTint="?attr/colorPrimary"
|
android:backgroundTint="?attr/colorPrimary"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/addVideo"
|
app:layout_constraintBottom_toTopOf="@+id/addVideo"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/addVideo"
|
app:layout_constraintEnd_toEndOf="@+id/addVideo"
|
||||||
@@ -113,7 +114,6 @@
|
|||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:src="@drawable/video_add"
|
android:src="@drawable/video_add"
|
||||||
android:text="@string/add_image"
|
android:text="@string/add_image"
|
||||||
app:fabCustomSize="49dp"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:tint="@color/white"
|
app:tint="@color/white"
|
||||||
android:backgroundTint="?attr/colorPrimary"
|
android:backgroundTint="?attr/colorPrimary"
|
||||||
@@ -129,7 +129,6 @@
|
|||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:src="@drawable/music_add"
|
android:src="@drawable/music_add"
|
||||||
android:text="@string/add_image"
|
android:text="@string/add_image"
|
||||||
app:fabCustomSize="51dp"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:tint="@color/white"
|
app:tint="@color/white"
|
||||||
android:backgroundTint="?attr/colorPrimary"
|
android:backgroundTint="?attr/colorPrimary"
|
||||||
@@ -144,7 +143,6 @@
|
|||||||
android:src="@drawable/document_add"
|
android:src="@drawable/document_add"
|
||||||
android:text="@string/add_image"
|
android:text="@string/add_image"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
app:fabCustomSize="54dp"
|
|
||||||
app:tint="@color/white"
|
app:tint="@color/white"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:backgroundTint="?attr/colorPrimary"
|
android:backgroundTint="?attr/colorPrimary"
|
||||||
@@ -161,7 +159,6 @@
|
|||||||
android:src="@drawable/ic_add"
|
android:src="@drawable/ic_add"
|
||||||
android:backgroundTint="?attr/colorPrimary"
|
android:backgroundTint="?attr/colorPrimary"
|
||||||
android:text="@string/add_image"
|
android:text="@string/add_image"
|
||||||
app:fabCustomSize="60dp"
|
|
||||||
app:tint="@color/white"
|
app:tint="@color/white"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginHorizontal="2dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
@@ -45,6 +46,7 @@
|
|||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
android:src="@drawable/ic_folder" />
|
android:src="@drawable/ic_folder" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginHorizontal="8dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
android:src="@drawable/ic_folder" />
|
android:src="@drawable/ic_folder" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user