From 7fb266f30bf04359dc70d4c1e2a88e1e85841340 Mon Sep 17 00:00:00 2001 From: tmfang Date: Mon, 18 Feb 2019 11:08:24 +0800 Subject: [PATCH] Fix janky in App info screen If a Recycle view inside in a NestedScrollView, The times of calling recyclerView#onCreateViewHolder() is requal to its data set. When there are large set of apps need to be shown, RecyclerView will need to take many time to call onCreateViewHolder for each item. So, it causes the screen is janky or freeze UI when page is loading large data set. For now, we get rid of NestedScrollView, just use RecycleView and AppBarLayout to have same bahavior for spinner. Fixes: 124384314 Fixes: 123036231 Fixes: 122964660 Fixes: 123088178 Test: 1. Select show system in App info screen. Observe whether there is any janky. 2. Select show system in App info screen, and then change device orientation. Observer whether there is any janky. 3. Go to Settings > Apps & notifications> Advanced > Special app access > Select "battery optimization", and then Tap drop down and select "all apps". Observe whether ther is any janky. Change-Id: Icd65e91eec3b32476d80cc12e9c4baa71151306a --- res/layout/apps_filter_spinner.xml | 3 +- res/layout/manage_applications_apps.xml | 67 +++++++++---------- .../ManageApplications.java | 8 +-- .../ManageApplicationsTest.java | 8 +-- 4 files changed, 39 insertions(+), 47 deletions(-) diff --git a/res/layout/apps_filter_spinner.xml b/res/layout/apps_filter_spinner.xml index c9b1e074078..50f0fde26c7 100644 --- a/res/layout/apps_filter_spinner.xml +++ b/res/layout/apps_filter_spinner.xml @@ -18,7 +18,8 @@ + android:layout_height="wrap_content" + android:background="@android:color/transparent"> - - + android:layout_height="match_parent" + android:orientation="vertical" + android:visibility="gone"> - + android:layout_height="match_parent"> - + android:layout_height="match_parent" + android:clipToPadding="false" + settings:fastScrollEnabled="true" + settings:fastScrollHorizontalThumbDrawable="@drawable/thumb_drawable" + settings:fastScrollHorizontalTrackDrawable="@drawable/line_drawable" + settings:fastScrollVerticalThumbDrawable="@drawable/thumb_drawable" + settings:fastScrollVerticalTrackDrawable="@drawable/line_drawable"/> - + - + - + - + - - - - - +