[app] Don't let CollapsingToolbarLayout consume insets
This commit is contained in:
parent
dfe1b5545e
commit
6a14dc184a
|
|
@ -75,8 +75,19 @@ public class SettingsFragment extends BaseFragment {
|
|||
setupToolbar(binding.toolbar, R.string.Settings);
|
||||
if (savedInstanceState == null) {
|
||||
getChildFragmentManager().beginTransaction()
|
||||
.add(R.id.container, new PreferenceFragment()).commit();
|
||||
.add(R.id.container, new PreferenceFragment()).commitNow();
|
||||
}
|
||||
|
||||
/*
|
||||
CollapsingToolbarLayout consumes window insets, causing child views not
|
||||
receiving window insets.
|
||||
See https://github.com/material-components/material-components-android/issues/1310
|
||||
|
||||
Insets can be handled by RikkaX Insets, so we can manually set
|
||||
OnApplyWindowInsetsListener to null.
|
||||
*/
|
||||
|
||||
binding.collapsingToolbarLayout.setOnApplyWindowInsetsListener(null);
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,11 @@
|
|||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
android:fitsSystemWindows="false"
|
||||
app:fitsSystemWindowsInsets="top">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing_toolbar_layout"
|
||||
style="?attr/collapsingToolbarLayoutMediumStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
|
||||
|
|
|
|||
Loading…
Reference in New Issue