Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6c8280a authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

[DO NOT MERGE] Resolver/Chooser - Window inset fixes am: 95ede7fb

Change-Id: I77a948f5599ee8c3453b758136ea13c62ad95e69
parents 1222d756 95ede7fb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2566,6 +2566,12 @@ public class ChooserActivity extends ResolverActivity {
        }
    }

    @Override
    protected boolean shouldAddFooterView() {
        // To accommodate for window insets
        return true;
    }

    public class ChooserListAdapter extends ResolveListAdapter {
        public static final int TARGET_BAD = -1;
        public static final int TARGET_CALLER = 0;
+17 −3
Original line number Diff line number Diff line
@@ -386,14 +386,30 @@ public class ResolverActivity extends Activity {
        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) {
        mSystemWindowInsets = insets.getSystemWindowInsets();

        mResolverDrawerLayout.setPadding(mSystemWindowInsets.left, mSystemWindowInsets.top,
                mSystemWindowInsets.right, 0);

        resetButtonBar();

        // Need extra padding so the list can fully scroll up
        if (useLayoutWithDefault()) {
        if (shouldAddFooterView()) {
            if (mFooterSpacer == null) {
                mFooterSpacer = new Space(getApplicationContext());
            } else {
@@ -411,8 +427,6 @@ public class ResolverActivity extends Activity {
            }
        }

        resetButtonBar();

        return insets.consumeSystemWindowInsets();
    }