Skip to content

Commit ebfb3db

Browse files
dsn5ftveganafro
authored andcommitted
[Catalog][TopAppBar] Fix status bar and action mode glitches in ActionBar demo
Resolves #2563 PiperOrigin-RevId: 433305811
1 parent 4e97f78 commit ebfb3db

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

catalog/java/io/material/catalog/feature/DemoActivity.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ protected void onCreate(@Nullable Bundle bundle) {
6565

6666
safeInject();
6767
super.onCreate(bundle);
68-
WindowPreferencesManager windowPreferencesManager = new WindowPreferencesManager(this);
69-
windowPreferencesManager.applyEdgeToEdgePreference(getWindow());
68+
69+
if (shouldApplyEdgeToEdgePreference()) {
70+
WindowPreferencesManager windowPreferencesManager = new WindowPreferencesManager(this);
71+
windowPreferencesManager.applyEdgeToEdgePreference(getWindow());
72+
}
7073

7174
setContentView(R.layout.cat_demo_activity);
7275

@@ -104,6 +107,10 @@ protected boolean shouldSetUpContainerTransform() {
104107
&& getIntent().getStringExtra(EXTRA_TRANSITION_NAME) != null;
105108
}
106109

110+
protected boolean shouldApplyEdgeToEdgePreference() {
111+
return true;
112+
}
113+
107114
@Override
108115
public AndroidInjector<Object> androidInjector() {
109116
return androidInjector;

catalog/java/io/material/catalog/topappbar/BaseTopAppBarActionBarDemoActivity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,14 @@ public boolean shouldShowDefaultDemoActionBar() {
114114
public int getActionBarDemoDescription() {
115115
return R.string.cat_topappbar_action_bar_description;
116116
}
117+
118+
@Override
119+
protected boolean shouldSetUpContainerTransform() {
120+
return false;
121+
}
122+
123+
@Override
124+
protected boolean shouldApplyEdgeToEdgePreference() {
125+
return false;
126+
}
117127
}

0 commit comments

Comments
 (0)