Fix double divider in Privacy page

The second divider is shown after we set a background to the pinned
header.

- Simply hide the pinned header instead of its inner views.
- Move setActionBarShadowAnimation to controller and just call it when
  the bar chart is available.

Fixes: 134652710
Test: robotest, visual
Change-Id: I4381e5ca1a042583d3e5874f5600719267b19786
This commit is contained in:
Jason Chiu
2019-06-14 17:24:26 +08:00
parent 5eb2c963c0
commit f3e3d7a46b
4 changed files with 15 additions and 53 deletions

View File

@@ -123,10 +123,13 @@ public class PermissionBarChartPreferenceController extends BasePreferenceContro
return;
}
// Add a shadow animation to action bar scroll only when the chart is available.
com.android.settings.Utils.setActionBarShadowAnimation(mParent.getActivity(),
mParent.getSettingsLifecycle(), mParent.getListView());
// We don't hide chart when we have existing data.
mBarChartPreference.updateLoadingState(mOldUsageInfos.isEmpty() /* isLoading */);
// But we still need to hint user with progress bar that we are updating new usage data.
mParent.setLoadingEnabled(true /* enabled */);
mParent.showPinnedHeader(true);
retrievePermissionUsageData();
}
@@ -162,7 +165,7 @@ public class PermissionBarChartPreferenceController extends BasePreferenceContro
}
mBarChartPreference.updateLoadingState(false /* isLoading */);
mParent.setLoadingEnabled(false /* enabled */);
mParent.showPinnedHeader(false);
}
private void retrievePermissionUsageData() {