Pad bottom of settings list view with bottom system insets

This change allows for a transparent navigation bar in the settings Material next redesign.

Test: Bottom of settings not cut off by bottom navigation bar
Bug: 187732263
Change-Id: I237011003ca0c3760c0fbdbb2865ef90c19d7b81
This commit is contained in:
Brian Isganitis
2021-05-25 21:06:49 -04:00
parent 3ed65ede16
commit ed49a7187d
3 changed files with 31 additions and 1 deletions

View File

@@ -152,6 +152,17 @@ public class DeveloperOptionsFragment extends PreferenceFragmentCompat {
filterPreferences(query, mPreferenceScreen);
}
});
View listView = getListView();
final int bottomPadding = listView.getPaddingBottom();
listView.setOnApplyWindowInsetsListener((v, insets) -> {
v.setPadding(
v.getPaddingLeft(),
v.getPaddingTop(),
v.getPaddingRight(),
bottomPadding + insets.getSystemWindowInsetBottom());
return insets.consumeSystemWindowInsets();
});
}
@Override