Skip to content

Commit

Permalink
Improve performance during scrolling of items lists (#385)
Browse files Browse the repository at this point in the history
* Use method to improve loading of list items

* Remove useless scrollview
  • Loading branch information
Jean-BaptisteC authored Jan 23, 2024
1 parent bd7b3ea commit 17a79e0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ADTrackersFragment : Fragment(R.layout.fragment_a_d_trackers) {
return false
}
}
setItemViewCacheSize(10)
}
val trackersList = arrayListOf<String>()
it.forEach { item -> trackersList.add(item.name) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class AppsFragment : Fragment(R.layout.fragment_apps) {
}
},
)
setItemViewCacheSize(10)
}

// Setup Shimmer Layout
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/layout/fragment_apps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,13 @@
app:layout_constraintTop_toBottomOf="@+id/toolbarApps"
app:shimmer_direction="left_to_right">

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">

<LinearLayout
android:id="@+id/shimmerPlaceHolderLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

</LinearLayout>
</ScrollView>

</com.facebook.shimmer.ShimmerFrameLayout>

Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/layout/fragment_trackers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
app:layout_constraintTop_toBottomOf="@+id/toolbarTrackers"
app:shimmer_direction="left_to_right">

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">

<LinearLayout
android:id="@+id/shimmerPlaceHolderLayout"
android:layout_width="match_parent"
Expand All @@ -41,7 +36,6 @@
android:paddingTop="20dp">

</LinearLayout>
</ScrollView>

</com.facebook.shimmer.ShimmerFrameLayout>

Expand Down

0 comments on commit 17a79e0

Please sign in to comment.