From 17a79e03f0973f330727932f9dfab63f47bd111c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste <87148630+Jean-BaptisteC@users.noreply.github.com> Date: Tue, 23 Jan 2024 06:03:13 +0100 Subject: [PATCH] Improve performance during scrolling of items lists (#385) * Use method to improve loading of list items * Remove useless scrollview --- .../fragments/appdetail/subfrags/ADPermissionsFragment.kt | 1 + .../fragments/appdetail/subfrags/ADTrackersFragment.kt | 1 + .../exodusprivacy/fragments/apps/AppsFragment.kt | 1 + app/src/main/res/layout/fragment_apps.xml | 6 ------ app/src/main/res/layout/fragment_trackers.xml | 6 ------ 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADPermissionsFragment.kt b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADPermissionsFragment.kt index ad082399..6591b8ef 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADPermissionsFragment.kt +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADPermissionsFragment.kt @@ -50,6 +50,7 @@ class ADPermissionsFragment : Fragment(R.layout.fragment_a_d_permissions) { return false } } + setItemViewCacheSize(10) } adPermissionsRVAdapter.submitList(app.permissions) permissionsStatusTV.text = getString(R.string.code_permission_found) diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADTrackersFragment.kt b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADTrackersFragment.kt index ee488b44..70de13f3 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADTrackersFragment.kt +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/appdetail/subfrags/ADTrackersFragment.kt @@ -77,6 +77,7 @@ class ADTrackersFragment : Fragment(R.layout.fragment_a_d_trackers) { return false } } + setItemViewCacheSize(10) } val trackersList = arrayListOf() it.forEach { item -> trackersList.add(item.name) } diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt index 9fd45e41..7b0299ae 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt @@ -88,6 +88,7 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { } }, ) + setItemViewCacheSize(10) } // Setup Shimmer Layout diff --git a/app/src/main/res/layout/fragment_apps.xml b/app/src/main/res/layout/fragment_apps.xml index 4eb4b732..5ca75cf0 100644 --- a/app/src/main/res/layout/fragment_apps.xml +++ b/app/src/main/res/layout/fragment_apps.xml @@ -36,11 +36,6 @@ app:layout_constraintTop_toBottomOf="@+id/toolbarApps" app:shimmer_direction="left_to_right"> - - - diff --git a/app/src/main/res/layout/fragment_trackers.xml b/app/src/main/res/layout/fragment_trackers.xml index 446671f1..17d97ade 100644 --- a/app/src/main/res/layout/fragment_trackers.xml +++ b/app/src/main/res/layout/fragment_trackers.xml @@ -28,11 +28,6 @@ app:layout_constraintTop_toBottomOf="@+id/toolbarTrackers" app:shimmer_direction="left_to_right"> - - -