Fix double divider in Apps & notifications page

- The second divider is shown after we set a background to the pinned
  header.
- Fix it by simply hiding the pinned header instead of its inner views.

Fixes: 133231218
Test: robotest, visual
Change-Id: I53add6f01930299425ce96d23350f9f066e85145
This commit is contained in:
Jason Chiu
2019-06-05 17:31:31 +08:00
parent 64fec889df
commit cfa36dbaeb
3 changed files with 29 additions and 15 deletions

View File

@@ -113,7 +113,8 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
}
};
private ViewGroup mPinnedHeaderFrameLayout;
@VisibleForTesting
ViewGroup mPinnedHeaderFrameLayout;
private ViewGroup mButtonBar;
private LayoutPreference mHeader;
@@ -186,6 +187,10 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
mPinnedHeaderFrameLayout.setVisibility(View.VISIBLE);
}
public void showPinnedHeader(boolean show) {
mPinnedHeaderFrameLayout.setVisibility(show ? View.VISIBLE : View.INVISIBLE);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);