From 6d3991320e34dead9243609f1f812894dee91715 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 7 Jan 2018 21:19:32 +0100 Subject: [PATCH] replace Delete with Remove at favorites list --- .../filemanager/adapters/ManageFavoritesAdapter.kt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt index 66d8c52f..2e1d814f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt @@ -5,7 +5,6 @@ import android.view.View import android.view.ViewGroup import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter -import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener import com.simplemobiletools.commons.views.MyRecyclerView import com.simplemobiletools.filemanager.R @@ -17,7 +16,7 @@ class ManageFavoritesAdapter(activity: BaseSimpleActivity, var favorites: ArrayL 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) {} @@ -29,7 +28,7 @@ class ManageFavoritesAdapter(activity: BaseSimpleActivity, var favorites: ArrayL override fun actionItemPressed(id: Int) { when (id) { - R.id.cab_delete -> askConfirmDelete() + R.id.cab_remove -> removeSelection() } } @@ -56,13 +55,7 @@ class ManageFavoritesAdapter(activity: BaseSimpleActivity, var favorites: ArrayL } } - private fun askConfirmDelete() { - ConfirmationDialog(activity) { - deleteSelection() - } - } - - private fun deleteSelection() { + private fun removeSelection() { val removeFavorites = ArrayList(selectedPositions.size) selectedPositions.sortedDescending().forEach {