Skip to content

Commit 4e52469

Browse files
committed
[TopAppBar] Add status bar foreground to compress catalog demo.
PiperOrigin-RevId: 459313548
1 parent 74b7706 commit 4e52469

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

catalog/java/io/material/catalog/topappbar/TopAppBarCompressEffectFragment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import android.widget.ToggleButton;
3131
import androidx.annotation.NonNull;
3232
import androidx.annotation.Nullable;
33+
import com.google.android.material.appbar.AppBarLayout;
34+
import com.google.android.material.shape.MaterialShapeDrawable;
3335
import com.google.android.material.tabs.TabLayout;
3436
import io.material.catalog.feature.DemoFragment;
3537
import io.material.catalog.feature.DemoUtils;
@@ -56,6 +58,10 @@ public View onCreateDemoView(
5658
AppCompatActivity activity = (AppCompatActivity) getActivity();
5759
activity.setSupportActionBar(toolbar);
5860

61+
AppBarLayout appBarLayout = view.findViewById(R.id.appbarlayout);
62+
appBarLayout.setStatusBarForeground(
63+
MaterialShapeDrawable.createWithElevationOverlay(requireContext()));
64+
5965
TabLayout tabs = view.findViewById(R.id.tabs);
6066
ToggleButton showHideTabsButton = view.findViewById(R.id.show_hide_tabs_button);
6167
updateTabVisibility(tabs, showHideTabsButton.isChecked());

0 commit comments

Comments
 (0)