From 738cbf7d1ae40fff8985465406d2dc7262c32897 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 2 Jul 2019 17:22:21 +0200 Subject: [PATCH] adding some initial folder un/locking related code --- app/build.gradle | 2 +- .../gallery/pro/adapters/DirectoryAdapter.kt | 28 ++++++++++++++++--- .../gallery/pro/helpers/Config.kt | 2 +- app/src/main/res/menu/cab_directories.xml | 8 ++++++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8e2379826..bfbaa875e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.14.3' + implementation 'com.simplemobiletools:commons:5.14.6' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index 2d3256258..461f6f545 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -12,10 +12,7 @@ import com.bumptech.glide.Glide import com.google.gson.Gson import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.dialogs.PropertiesDialog -import com.simplemobiletools.commons.dialogs.RenameItemDialog -import com.simplemobiletools.commons.dialogs.RenameItemsDialog +import com.simplemobiletools.commons.dialogs.* import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.commons.helpers.isOreoPlus @@ -81,6 +78,9 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList toggleFoldersVisibility(true) R.id.cab_unhide -> toggleFoldersVisibility(false) R.id.cab_exclude -> tryExcludeFolder() + R.id.cab_lock -> tryLockFolder() + R.id.cab_unlock -> unlockFolder() R.id.cab_copy_to -> copyMoveTo(true) R.id.cab_move_to -> moveFilesTo() R.id.cab_select_all -> selectAll() @@ -310,6 +312,24 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList + +