summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aconfig/FeatureFlags.aconfig6
-rw-r--r--java/src/com/android/intentresolver/ChooserActivity.java28
2 files changed, 17 insertions, 17 deletions
diff --git a/aconfig/FeatureFlags.aconfig b/aconfig/FeatureFlags.aconfig
index 4d787ea2..b7d9ea0d 100644
--- a/aconfig/FeatureFlags.aconfig
+++ b/aconfig/FeatureFlags.aconfig
@@ -52,3 +52,9 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+flag {
+ name: "fix_empty_state_padding"
+ namespace: "intentresolver"
+ description: "Always apply systemBar window insets regardless of profiles present"
+ bug: "338447666"
+}
diff --git a/java/src/com/android/intentresolver/ChooserActivity.java b/java/src/com/android/intentresolver/ChooserActivity.java
index ccf2a3dc..1922c05c 100644
--- a/java/src/com/android/intentresolver/ChooserActivity.java
+++ b/java/src/com/android/intentresolver/ChooserActivity.java
@@ -1170,19 +1170,6 @@ public class ChooserActivity extends Hilt_ChooserActivity implements
safelyStartActivityAsUser(cti, user, null);
}
- protected WindowInsets super_onApplyWindowInsets(View v, WindowInsets insets) {
- mSystemWindowInsets = insets.getSystemWindowInsets();
-
- mResolverDrawerLayout.setPadding(mSystemWindowInsets.left, mSystemWindowInsets.top,
- mSystemWindowInsets.right, 0);
-
- // Need extra padding so the list can fully scroll up
- // To accommodate for window insets
- applyFooterView(mSystemWindowInsets.bottom);
-
- return insets.consumeSystemWindowInsets();
- }
-
@Override // ResolverListCommunicator
public final void onHandlePackagesChanged(ResolverListAdapter listAdapter) {
if (!mChooserMultiProfilePagerAdapter.onHandlePackagesChanged(
@@ -2649,16 +2636,23 @@ public class ChooserActivity extends Hilt_ChooserActivity implements
}
protected WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
- if (mProfiles.getWorkProfilePresent()) {
+ mSystemWindowInsets = insets.getInsets(WindowInsets.Type.systemBars());
+ if (mFeatureFlags.fixEmptyStatePadding() || mProfiles.getWorkProfilePresent()) {
mChooserMultiProfilePagerAdapter
- .setEmptyStateBottomOffset(insets.getSystemWindowInsetBottom());
+ .setEmptyStateBottomOffset(mSystemWindowInsets.bottom);
}
- WindowInsets result = super_onApplyWindowInsets(v, insets);
+ mResolverDrawerLayout.setPadding(mSystemWindowInsets.left, mSystemWindowInsets.top,
+ mSystemWindowInsets.right, 0);
+
+ // Need extra padding so the list can fully scroll up
+ // To accommodate for window insets
+ applyFooterView(mSystemWindowInsets.bottom);
+
if (mResolverDrawerLayout != null) {
mResolverDrawerLayout.requestLayout();
}
- return result;
+ return WindowInsets.CONSUMED;
}
private void setHorizontalScrollingEnabled(boolean enabled) {