Fix a bug where storage settings flickers.

The bug resulted from the fact that turning off loading while loading is
turned off causes the loading finishing animation to flicker. By only
turning it off when it is on, we ensure it works.

Change-Id: Ia31bf3e9aa90726e39b6bc7189d175c38fb51e5a
Fixes: 38045492
Test: Manual
This commit is contained in:
Daniel Nishi
2017-05-08 09:58:16 -07:00
parent 154824f124
commit 7bb541b6ff

View File

@@ -133,7 +133,11 @@ public class StorageDashboardFragment extends DashboardFragment
mPreferenceController.onLoadFinished(mAppsResult.get(UserHandle.myUserId()));
updateSecondaryUserControllers(mSecondaryUsers, mAppsResult);
setLoading(false, true);
// setLoading always causes a flicker, so let's avoid doing it.
if (getView().findViewById(R.id.loading_container).getVisibility() == View.VISIBLE) {
setLoading(false, true);
}
}
@Override