Fix extra padding
This commit is contained in:
parent
cb079df540
commit
351feb4fa9
|
|
@ -108,10 +108,10 @@ public class BaseActivity extends AppCompatActivity {
|
|||
protected void setupWindowInsets(View rootView, View secondView) {
|
||||
rootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
|
||||
if (secondView != null && insets.getTappableElementInsets().bottom != insets.getSystemWindowInsetBottom()) {
|
||||
if (secondView != null) {
|
||||
secondView.setPadding(0, 0, 0, insets.getSystemWindowInsetBottom());
|
||||
}
|
||||
rootView.setPadding(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), insets.getTappableElementInsets().bottom);
|
||||
rootView.setPadding(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), secondView == null ? insets.getSystemWindowInsetBottom() : 0);
|
||||
return insets;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue