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

Commit 3a5c306e authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

If the permission dialog would stick out, move it.

Also scroll the whole dialog if the screen is too small to for the
dialog.

Test: Executed steps in the bug. Dialog looks fine. Also toyed around
with display scaling and font scaling to make sure dialog always looks
ok (but might scroll) on very small displays.
Fixes: 31442798
Change-Id: I74328afde38ec2170a14aaa8e77675ad2164460e
parent aa662118
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@
    android:paddingBottom="32dp"
    android:clipToPadding="false">

    <ScrollView android:layout_width="wrap_content"
            android:layout_height="wrap_content">

    <LinearLayout
        android:id="@+id/dialog_container"
        android:layout_width="wrap_content"
@@ -135,4 +138,6 @@

    </LinearLayout>

    </ScrollView>

</com.android.packageinstaller.permission.ui.ManualLayoutFrame>
+6 −1
Original line number Diff line number Diff line
@@ -61,8 +61,13 @@ public class ManualLayoutFrame extends ViewGroup {

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        // We want to keep the content bottom at the same place to avoid movement of the "Allow"
        // button.
        // Try to keep the content bottom at the same height. If this would move the dialog out of
        // the top of the screen move it down as much as possible, then keep it at that position for
        // the rest of the sequence of permission dialogs.
        View content = getChildAt(0);
        if (mContentBottom == 0) {
        if (mContentBottom == 0 || content.getMeasuredHeight() > mContentBottom) {
            mContentBottom = (getMeasuredHeight() + content.getMeasuredHeight()) / 2;
        }
        final int contentLeft = (getMeasuredWidth() - content.getMeasuredWidth()) / 2;