Fix collapsing toolbar does not stretch to top
Use getSystemWindowInsetTop() to keep status bar height for
CategorySelector and IndividualPicker fragments.
Bug: 186382184
Test: manual
Change-Id: I6cfa42cd7aab130b6602d9e668394c07a6130e2a
diff --git a/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java b/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java
index 2277a99..655187f 100755
--- a/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java
+++ b/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java
@@ -520,11 +520,19 @@
maybeSetUpImageGrid();
setUpBottomSheet();
// For nav bar edge-to-edge effect.
- view.findViewById(R.id.wallpaper_grid).setOnApplyWindowInsetsListener((v, windowInsets) -> {
+ view.setOnApplyWindowInsetsListener((v, windowInsets) -> {
+ // For status bar height.
v.setPadding(
v.getPaddingLeft(),
- v.getPaddingTop(),
+ windowInsets.getSystemWindowInsetTop(),
v.getPaddingRight(),
+ v.getPaddingBottom());
+
+ View gridView = v.findViewById(R.id.wallpaper_grid);
+ gridView.setPadding(
+ gridView.getPaddingLeft(),
+ gridView.getPaddingTop(),
+ gridView.getPaddingRight(),
windowInsets.getSystemWindowInsetBottom());
return windowInsets.consumeSystemWindowInsets();
});