Merge "[DO NOT MERGE] Resolver/Chooser - Window inset fixes" into qt-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2c5bd63efd
@@ -2562,6 +2562,12 @@ public class ChooserActivity extends ResolverActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldAddFooterView() {
|
||||||
|
// To accommodate for window insets
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public class ChooserListAdapter extends ResolveListAdapter {
|
public class ChooserListAdapter extends ResolveListAdapter {
|
||||||
public static final int TARGET_BAD = -1;
|
public static final int TARGET_BAD = -1;
|
||||||
public static final int TARGET_CALLER = 0;
|
public static final int TARGET_CALLER = 0;
|
||||||
|
|||||||
@@ -382,14 +382,30 @@ public class ResolverActivity extends Activity {
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Numerous layouts are supported, each with optional ViewGroups.
|
||||||
|
* Make sure the inset gets added to the correct View, using
|
||||||
|
* a footer for Lists so it can properly scroll under the navbar.
|
||||||
|
*/
|
||||||
|
protected boolean shouldAddFooterView() {
|
||||||
|
if (useLayoutWithDefault()) return true;
|
||||||
|
|
||||||
|
View buttonBar = findViewById(R.id.button_bar);
|
||||||
|
if (buttonBar == null || buttonBar.getVisibility() == View.GONE) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
|
protected WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
|
||||||
mSystemWindowInsets = insets.getSystemWindowInsets();
|
mSystemWindowInsets = insets.getSystemWindowInsets();
|
||||||
|
|
||||||
mResolverDrawerLayout.setPadding(mSystemWindowInsets.left, mSystemWindowInsets.top,
|
mResolverDrawerLayout.setPadding(mSystemWindowInsets.left, mSystemWindowInsets.top,
|
||||||
mSystemWindowInsets.right, 0);
|
mSystemWindowInsets.right, 0);
|
||||||
|
|
||||||
|
resetButtonBar();
|
||||||
|
|
||||||
// Need extra padding so the list can fully scroll up
|
// Need extra padding so the list can fully scroll up
|
||||||
if (useLayoutWithDefault()) {
|
if (shouldAddFooterView()) {
|
||||||
if (mFooterSpacer == null) {
|
if (mFooterSpacer == null) {
|
||||||
mFooterSpacer = new Space(getApplicationContext());
|
mFooterSpacer = new Space(getApplicationContext());
|
||||||
} else {
|
} else {
|
||||||
@@ -407,8 +423,6 @@ public class ResolverActivity extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resetButtonBar();
|
|
||||||
|
|
||||||
return insets.consumeSystemWindowInsets();
|
return insets.consumeSystemWindowInsets();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user