From b351de406bcd50a9a29c7a6213289bca3edf8cb1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 6 Jan 2018 19:43:45 +0100 Subject: [PATCH] replace Delete with Remove at Manage excluded/included folders --- app/build.gradle | 2 +- .../gallery/activities/MediaActivity.kt | 3 +-- .../gallery/adapters/DirectoryAdapter.kt | 2 +- .../gallery/adapters/ManageFoldersAdapter.kt | 13 +++---------- .../gallery/adapters/MediaAdapter.kt | 2 +- .../gallery/fragments/PhotoFragment.kt | 2 +- .../gallery/helpers/GlideRotateTransformation.kt | 2 +- 7 files changed, 9 insertions(+), 17 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b18fe5c96..ee5ef2f0c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,7 +42,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.5.9' + implementation 'com.simplemobiletools:commons:3.5.11' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index db51d1c59..6fa726db1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -511,12 +511,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { .load(File(path)) .apply(options) .into(object : SimpleTarget() { - override fun onResourceReady(resource: Bitmap?, transition: Transition?) { + override fun onResourceReady(resource: Bitmap, transition: Transition?) { try { WallpaperManager.getInstance(applicationContext).setBitmap(resource) setResult(Activity.RESULT_OK) } catch (ignored: IOException) { - } finish() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 9ed24a0c8..e1e0def89 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -94,7 +94,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList askConfirmDelete() + R.id.cab_remove -> removeSelection() } } @@ -57,13 +56,7 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList< } } - private fun askConfirmDelete() { - ConfirmationDialog(activity) { - deleteSelection() - } - } - - private fun deleteSelection() { + private fun removeSelection() { val removeFolders = ArrayList(selectedPositions.size) selectedPositions.sortedDescending().forEach { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 58a8465c0..0e4477cbf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -106,7 +106,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, if (!activity.isActivityDestroyed()) { val itemView = holder?.itemView visibleItemPaths.remove(itemView?.photo_name?.tag) - Glide.with(activity).clear(itemView?.medium_thumbnail) + Glide.with(activity).clear(itemView?.medium_thumbnail!!) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index b99ac8867..7e664e8dd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -325,7 +325,7 @@ class PhotoFragment : ViewPagerFragment() { override fun onDestroyView() { super.onDestroyView() if (activity?.isActivityDestroyed() == false) { - Glide.with(context).clear(view.gif_view) + Glide.with(context!!).clear(view.gif_view) view.subsampling_view.recycle() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt index 8a48b23f4..aae7d66ca 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt @@ -17,6 +17,6 @@ class GlideRotateTransformation(context: Context, val rotateRotationAngle: Float return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) } - override fun updateDiskCacheKey(messageDigest: MessageDigest?) { + override fun updateDiskCacheKey(messageDigest: MessageDigest) { } }