replace Delete with Remove at Manage excluded/included folders

This commit is contained in:
tibbi 2018-01-06 19:43:45 +01:00
parent 923ba8b99c
commit b351de406b
7 changed files with 9 additions and 17 deletions

View File

@ -42,7 +42,7 @@ ext {
} }
dependencies { 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.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.android.support:multidex:1.0.2' implementation 'com.android.support:multidex:1.0.2'

View File

@ -511,12 +511,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
.load(File(path)) .load(File(path))
.apply(options) .apply(options)
.into(object : SimpleTarget<Bitmap>() { .into(object : SimpleTarget<Bitmap>() {
override fun onResourceReady(resource: Bitmap?, transition: Transition<in Bitmap>?) { override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
try { try {
WallpaperManager.getInstance(applicationContext).setBitmap(resource) WallpaperManager.getInstance(applicationContext).setBitmap(resource)
setResult(Activity.RESULT_OK) setResult(Activity.RESULT_OK)
} catch (ignored: IOException) { } catch (ignored: IOException) {
} }
finish() finish()

View File

@ -94,7 +94,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList<Direc
override fun onViewRecycled(holder: ViewHolder?) { override fun onViewRecycled(holder: ViewHolder?) {
super.onViewRecycled(holder) super.onViewRecycled(holder)
if (!activity.isActivityDestroyed()) { if (!activity.isActivityDestroyed()) {
Glide.with(activity).clear(holder?.itemView?.dir_thumbnail) Glide.with(activity).clear(holder?.itemView?.dir_thumbnail!!)
} }
} }

View File

@ -5,7 +5,6 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
import com.simplemobiletools.commons.views.MyRecyclerView import com.simplemobiletools.commons.views.MyRecyclerView
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
@ -18,7 +17,7 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<
private val config = activity.config private val config = activity.config
override fun getActionMenuId() = R.menu.cab_delete_only override fun getActionMenuId() = R.menu.cab_remove_only
override fun prepareActionMode(menu: Menu) {} override fun prepareActionMode(menu: Menu) {}
@ -30,7 +29,7 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<
override fun actionItemPressed(id: Int) { override fun actionItemPressed(id: Int) {
when (id) { when (id) {
R.id.cab_delete -> askConfirmDelete() R.id.cab_remove -> removeSelection()
} }
} }
@ -57,13 +56,7 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<
} }
} }
private fun askConfirmDelete() { private fun removeSelection() {
ConfirmationDialog(activity) {
deleteSelection()
}
}
private fun deleteSelection() {
val removeFolders = ArrayList<String>(selectedPositions.size) val removeFolders = ArrayList<String>(selectedPositions.size)
selectedPositions.sortedDescending().forEach { selectedPositions.sortedDescending().forEach {

View File

@ -106,7 +106,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
if (!activity.isActivityDestroyed()) { if (!activity.isActivityDestroyed()) {
val itemView = holder?.itemView val itemView = holder?.itemView
visibleItemPaths.remove(itemView?.photo_name?.tag) visibleItemPaths.remove(itemView?.photo_name?.tag)
Glide.with(activity).clear(itemView?.medium_thumbnail) Glide.with(activity).clear(itemView?.medium_thumbnail!!)
} }
} }

View File

@ -325,7 +325,7 @@ class PhotoFragment : ViewPagerFragment() {
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
if (activity?.isActivityDestroyed() == false) { if (activity?.isActivityDestroyed() == false) {
Glide.with(context).clear(view.gif_view) Glide.with(context!!).clear(view.gif_view)
view.subsampling_view.recycle() view.subsampling_view.recycle()
} }
} }

View File

@ -17,6 +17,6 @@ class GlideRotateTransformation(context: Context, val rotateRotationAngle: Float
return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true)
} }
override fun updateDiskCacheKey(messageDigest: MessageDigest?) { override fun updateDiskCacheKey(messageDigest: MessageDigest) {
} }
} }