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

Commit 8877cc3e authored by Adam Powell's avatar Adam Powell
Browse files

Fix AlertDialog positioning for dialogs spawned from DialogWhenLarge

activities

Bug 6413342

Clear extra attributes in the base theme so that they properly overlay
a ContextThemeWrapper over a fixed-size dialog theme.

Change-Id: Ia0d49f0746ca01516afa1eaea7091e5da60d14ae
parent fbbdbc2d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -174,6 +174,13 @@ please see themes_device_defaults.xml.
        <item name="windowActionModeOverlay">false</item>
        <item name="windowCloseOnTouchOutside">false</item>

        <!-- Define these here; ContextThemeWrappers around themes that define them should
             always clear these values. -->
        <item name="windowFixedWidthMajor">0dp</item>
        <item name="windowFixedWidthMinor">0dp</item>
        <item name="windowFixedHeightMajor">0dp</item>
        <item name="windowFixedHeightMinor">0dp</item>

        <!-- Dialog attributes -->
        <item name="alertDialogStyle">@android:style/AlertDialog</item>
        <item name="dialogTheme">@android:style/Theme.Dialog</item>
+10 −5
Original line number Diff line number Diff line
@@ -2108,8 +2108,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                        w = 0;
                    }

                    if (w > 0) {
                        final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
                    widthMeasureSpec = MeasureSpec.makeMeasureSpec(Math.min(w, widthSize), EXACTLY);
                        widthMeasureSpec = MeasureSpec.makeMeasureSpec(
                                Math.min(w, widthSize), EXACTLY);
                    }
                }
            }

@@ -2125,9 +2128,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                        h = 0;
                    }

                    if (h > 0) {
                        final int heightSize = MeasureSpec.getSize(heightMeasureSpec);
                    heightMeasureSpec =
                            MeasureSpec.makeMeasureSpec(Math.min(h, heightSize), EXACTLY);
                        heightMeasureSpec = MeasureSpec.makeMeasureSpec(
                                Math.min(h, heightSize), EXACTLY);
                    }
                }
            }