From 575ef8472654f49dd60f0e6909164dd8dbd098fb Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Fri, 10 Apr 2020 13:18:42 +0200 Subject: Modernize legacy RecyclerView adapters (#694) * Modernize legacy RecyclerView adapters Introduces new adapters based on the SearchableRepositoryViewModel and using androidx.recyclerview.selection for multiselection support. The following positive effects in behavior are observable to end-users: - Search and navigation actions are executed on IO threads. - RecyclerViews are now animated during searches (but not navigations). - Exact scroll position is restored when navigating back. - The ActionBar title is updated with the current folder name. The following negative effects may warrant attention: - Support for the "always search from root" setting has been removed. - Due to a limitation of the fast scroll dependency, using the scroller may result in unwanted multiselections. If this is not fixed in the library, native fast scroller capabilities could be used, but these are more limited in appearance and to not offer popups. * Fix lint * Fix FastScroller/SelectionTracker incompatibility * Immediately react to settings changes * List directory entries when search term is blank * Use isEmpty() instead of == "" * Replace adapter inheritance with builders and fix selection drags * Remove dividers in password lists * Run spotlessApply * Use a more logical string in action mode * Commonize and constify path bundle key * Make lambda parameter name explicit Signed-off-by: Harsh Shandilya Co-authored-by: Harsh Shandilya --- app/build.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/build.gradle') diff --git a/app/build.gradle b/app/build.gradle index 4d410c46..3bef4675 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -86,12 +86,13 @@ dependencies { implementation deps.androidx.documentfile implementation deps.androidx.fragment_ktx implementation deps.androidx.lifecycle_livedata_ktx - implementation deps.androidx.lifecycle_runtime_ktx + implementation deps.androidx.lifecycle_viewmodel_ktx implementation deps.androidx.local_broadcast_manager implementation deps.androidx.material implementation deps.androidx.preference implementation deps.androidx.swiperefreshlayout - implementation(deps.androidx.recycler_view) + implementation deps.androidx.recycler_view + implementation deps.androidx.recycler_view_selection implementation deps.kotlin.coroutines.android implementation deps.kotlin.coroutines.core -- cgit v1.2.3