Disable RecyclerView animation to fix the broken UI
RecyclerView has item animation by default. In this bug, RV animation seems to be interrupted by the page transitions(Shared Axis), and so items could not finish sliding to its position. Hence, disable RV animation to fix it. Fixes: 189720797 Test: Navigate to Mobile & Wifi usage page and see the normal UI. Change-Id: I52920715ae4b63ef78a73fcb9c76c6d20f80e012
This commit is contained in:
@@ -39,8 +39,10 @@ import androidx.loader.content.Loader;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.applications.AppInfoBase;
|
||||
import com.android.settings.widget.EntityHeaderController;
|
||||
import com.android.settingslib.AppItem;
|
||||
@@ -221,6 +223,14 @@ public class AppDataUsage extends DataUsageBaseFragment implements OnPreferenceC
|
||||
}
|
||||
LoaderManager.getInstance(this).restartLoader(LOADER_APP_USAGE_DATA, null /* args */,
|
||||
mUidDataCallbacks);
|
||||
|
||||
if (Utils.isPageTransitionEnabled(mContext)) {
|
||||
final RecyclerView recyclerView = getListView();
|
||||
if (recyclerView != null) {
|
||||
recyclerView.setItemAnimator(null);
|
||||
}
|
||||
}
|
||||
|
||||
updatePrefs();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user