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

Commit 81450816 authored by Michael Kwan's avatar Michael Kwan
Browse files

Fix padding on round devices for AlertDialogs.

Bug: 27482353
Change-Id: Ic9ee4abe84f9172db64dba398af2c0058921fa3f
parent 74eb4a52
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -618,7 +618,7 @@ public class AlertController {
        }
    }

    private void setupTitle(ViewGroup topPanel) {
    protected void setupTitle(ViewGroup topPanel) {
        if (mCustomTitleView != null && mShowTitle) {
            // Add the custom title view directly to the topPanel layout
            final LayoutParams lp = new LayoutParams(
@@ -701,7 +701,7 @@ public class AlertController {
        }
    }

    private void setupButtons(ViewGroup buttonPanel) {
    protected void setupButtons(ViewGroup buttonPanel) {
        int BIT_BUTTON_POSITIVE = 1;
        int BIT_BUTTON_NEGATIVE = 2;
        int BIT_BUTTON_NEUTRAL = 4;
+16 −0
Original line number Diff line number Diff line
@@ -82,4 +82,20 @@ public class MicroAlertController extends AlertController {
            }
        }
    }

    @Override
    protected void setupTitle(ViewGroup topPanel) {
        super.setupTitle(topPanel);
        if (topPanel.getVisibility() == View.GONE) {
            topPanel.setVisibility(View.INVISIBLE);
        }
    }

    @Override
    protected void setupButtons(ViewGroup buttonPanel) {
        super.setupButtons(buttonPanel);
        if (buttonPanel.getVisibility() == View.GONE) {
            buttonPanel.setVisibility(View.INVISIBLE);
        }
    }
}
+5 −11
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
        android:layout_height="match_parent">
    <ScrollView
            android:id="@+id/scrollView"
            android:fillViewport="true"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        <LinearLayout
@@ -33,7 +34,8 @@
                    android:paddingRight="?dialogPreferredPadding"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/topPanel">
                    android:id="@+id/topPanel"
                    android:minHeight="@dimen/dialog_list_padding_top_no_title">
                <include android:id="@+id/title_template"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
@@ -68,41 +70,33 @@
            <!-- Button Panel -->
            <FrameLayout
                    android:id="@+id/buttonPanel"
                    android:minHeight="@dimen/dialog_list_padding_bottom_no_buttons"
                    android:layout_weight="1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:divider="?android:attr/dividerHorizontal"
                        android:showDividers="beginning"
                        android:dividerPadding="0dip"
                        android:orientation="vertical"
                        android:minHeight="@dimen/alert_dialog_button_bar_height"
                        android:paddingBottom="?dialogPreferredPadding"
                        style="?android:attr/buttonBarStyle"
                        android:layoutDirection="locale"
                        android:measureWithLargestChild="true">
                    <Button android:id="@+id/button1"
                            android:layout_gravity="start"
                            android:layout_weight="1"
                            android:layout_marginLeft="?dialogPreferredPadding"
                            android:layout_marginRight="?dialogPreferredPadding"
                            style="?android:attr/buttonBarButtonStyle"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />
                    <Button android:id="@+id/button3"
                            android:layout_gravity="start"
                            android:layout_weight="1"
                            android:layout_marginLeft="?dialogPreferredPadding"
                            android:layout_marginRight="?dialogPreferredPadding"
                            style="?android:attr/buttonBarButtonStyle"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />
                    <Button android:id="@+id/button2"
                            android:layout_gravity="start"
                            android:layout_weight="1"
                            android:layout_marginLeft="?dialogPreferredPadding"
                            android:layout_marginRight="?dialogPreferredPadding"
                            style="?android:attr/buttonBarButtonStyle"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />
+3 −0
Original line number Diff line number Diff line
@@ -20,4 +20,7 @@
    <dimen name="list_item_padding_horizontal_material">16dp</dimen>
    <dimen name="list_item_padding_start_material">16dp</dimen>
    <dimen name="list_item_padding_end_material">16dp</dimen>

    <dimen name="dialog_list_padding_top_no_title">8dp</dimen>
    <dimen name="dialog_list_padding_bottom_no_buttons">8dp</dimen>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -20,4 +20,7 @@
    <dimen name="list_item_padding_horizontal_material">@dimen/screen_percentage_15</dimen>
    <dimen name="list_item_padding_start_material">@dimen/screen_percentage_15</dimen>
    <dimen name="list_item_padding_end_material">@dimen/screen_percentage_10</dimen>

    <dimen name="dialog_list_padding_top_no_title">@dimen/screen_percentage_15</dimen>
    <dimen name="dialog_list_padding_bottom_no_buttons">@dimen/screen_percentage_15</dimen>
</resources>
Loading