Merge "Fix double divider in Privacy page"
This commit is contained in:
committed by
Android (Google) Code Review
commit
5cb9f7801c
@@ -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() {
|
||||
|
@@ -45,11 +45,6 @@ public class PrivacyDashboardFragment extends DashboardFragment {
|
||||
private static final String KEY_NOTIFICATION_WORK_PROFILE_NOTIFICATIONS =
|
||||
"privacy_lock_screen_work_profile_notifications";
|
||||
|
||||
@VisibleForTesting
|
||||
View mProgressHeader;
|
||||
@VisibleForTesting
|
||||
View mProgressAnimation;
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return SettingsEnums.TOP_LEVEL_PRIVACY;
|
||||
@@ -84,23 +79,13 @@ public class PrivacyDashboardFragment extends DashboardFragment {
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
Utils.setActionBarShadowAnimation(getActivity(), getSettingsLifecycle(), getListView());
|
||||
initLoadingBar();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void initLoadingBar() {
|
||||
mProgressHeader = setPinnedHeaderView(R.layout.progress_header);
|
||||
mProgressAnimation = mProgressHeader.findViewById(R.id.progress_bar_animation);
|
||||
setLoadingEnabled(false);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void setLoadingEnabled(boolean enabled) {
|
||||
if (mProgressHeader != null && mProgressAnimation != null) {
|
||||
mProgressHeader.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
|
||||
mProgressAnimation.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
|
||||
}
|
||||
setPinnedHeaderView(R.layout.progress_header);
|
||||
showPinnedHeader(false);
|
||||
}
|
||||
|
||||
private static List<AbstractPreferenceController> buildPreferenceControllers(
|
||||
|
Reference in New Issue
Block a user