From f1e9ecc59d5c6cd18899617512efe1d8be50ca55 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Jun 2023 18:34:47 +0200 Subject: [PATCH] use the more modern long click UI --- app/build.gradle | 2 +- .../filemanager/pro/adapters/ItemsAdapter.kt | 1 + .../filemanager/pro/adapters/ManageFavoritesAdapter.kt | 2 ++ app/src/main/res/layout/item_file_dir_list.xml | 5 +---- app/src/main/res/layout/item_manage_favorite.xml | 5 +---- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 20ab12a8..5e61776b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,7 +64,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:94b616f462' + implementation 'com.github.SimpleMobileTools:Simple-Commons:b9309035a9' implementation 'com.github.tibbi:PdfViewPager:d2af24208d' implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootShell:1.6' diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt index c0fe9e06..8c1ae430 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt @@ -819,6 +819,7 @@ class ItemsAdapter( item_section.setTextColor(textColor) item_section.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize) } else if (!listItem.isGridTypeDivider) { + setupViewBackground(activity) item_frame.isSelected = isSelected val fileName = listItem.name item_name.text = if (textToHighlight.isEmpty()) fileName else fileName.highlightTextPart(textToHighlight, properPrimaryColor) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ManageFavoritesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ManageFavoritesAdapter.kt index a81bd6ef..dac8f0e8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ManageFavoritesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ManageFavoritesAdapter.kt @@ -6,6 +6,7 @@ import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.extensions.getPopupMenuTheme import com.simplemobiletools.commons.extensions.getProperTextColor +import com.simplemobiletools.commons.extensions.setupViewBackground import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener import com.simplemobiletools.commons.views.MyRecyclerView import com.simplemobiletools.filemanager.pro.R @@ -59,6 +60,7 @@ class ManageFavoritesAdapter( private fun setupView(view: View, favorite: String, isSelected: Boolean) { view.apply { + setupViewBackground(activity) manage_favorite_title.apply { text = favorite setTextColor(activity.getProperTextColor()) diff --git a/app/src/main/res/layout/item_file_dir_list.xml b/app/src/main/res/layout/item_file_dir_list.xml index f4e37c29..fd7165e7 100644 --- a/app/src/main/res/layout/item_file_dir_list.xml +++ b/app/src/main/res/layout/item_file_dir_list.xml @@ -4,10 +4,7 @@ android:id="@+id/item_frame" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?attr/selectableItemBackground" - android:clickable="true" - android:focusable="true" - android:foreground="@drawable/selector" + android:layout_marginBottom="@dimen/tiny_margin" android:paddingTop="@dimen/tiny_margin" android:paddingBottom="@dimen/tiny_margin"> diff --git a/app/src/main/res/layout/item_manage_favorite.xml b/app/src/main/res/layout/item_manage_favorite.xml index 3911399b..ceeee50d 100644 --- a/app/src/main/res/layout/item_manage_favorite.xml +++ b/app/src/main/res/layout/item_manage_favorite.xml @@ -4,10 +4,7 @@ android:id="@+id/manage_favorite_holder" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?attr/selectableItemBackground" - android:clickable="true" - android:focusable="true" - android:foreground="@drawable/selector" + android:layout_marginBottom="@dimen/tiny_margin" android:paddingStart="@dimen/activity_margin" android:paddingEnd="0dp">