Skip to content

Commit 825531b

Browse files
wcshicketcham
authored andcommitted
Update DemoActivity to support edge to edge.
Affected subclasses: CardSelectionModeActivity, DrawerSideDemoActivity, ElevationOverlayActivity, BaseTopAppBarActionBarDemoActivity, TopAppBarActionBarDemoActivity, TopAppBarDarkActionBarDemoActivity, TopAppBarScrollingTransparentStatusDemoActivity PiperOrigin-RevId: 262562330
1 parent d9cc67d commit 825531b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import dagger.android.AndroidInjector;
3333
import dagger.android.DispatchingAndroidInjector;
3434
import dagger.android.HasAndroidInjector;
35+
import io.material.catalog.windowpreferences.WindowPreferencesManager;
3536
import javax.inject.Inject;
3637

3738
/** Base Activity class that provides a demo screen structure for a single demo. */
@@ -56,6 +57,9 @@ protected void onCreate(@Nullable Bundle bundle) {
5657

5758
initDemoActionBar();
5859
demoContainer.addView(onCreateDemoView(LayoutInflater.from(this), demoContainer, bundle));
60+
61+
WindowPreferencesManager windowPreferencesManager = new WindowPreferencesManager(this);
62+
windowPreferencesManager.applyEdgeToEdgePreference(getWindow());
5963
}
6064

6165
@Override

catalog/java/io/material/catalog/feature/res/layout/cat_demo_activity.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
<com.google.android.material.appbar.AppBarLayout
2424
android:layout_width="match_parent"
25-
android:layout_height="wrap_content">
25+
android:layout_height="wrap_content"
26+
android:fitsSystemWindows="true">
2627

2728
<androidx.appcompat.widget.Toolbar
2829
android:id="@+id/toolbar"

0 commit comments

Comments
 (0)