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

Commit f9e05736 authored by Andrew Sapperstein's avatar Andrew Sapperstein
Browse files

Add ability to customize button corner radius.

Creates a new buttonCornerRadius public attribute to control
the rounded corner radius for buttons at the theme level.

Updates default button backgrounds to use new value and updates
themes to set the corner radius to existing value of 2dp.

Also adds a configuration hook for a device to change the value
for DeviceDefault-based themes.

Bug: 64122537
Bug: 69314526
Bug: 69367197
Test: ag/3238215
Change-Id: I00be0c53b99292e1728ecdf40d4c876e283e65da
parent 25c3c34c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ package android {
    field public static final int buttonBarNeutralButtonStyle = 16843914; // 0x101048a
    field public static final int buttonBarPositiveButtonStyle = 16843913; // 0x1010489
    field public static final int buttonBarStyle = 16843566; // 0x101032e
    field public static final int buttonCornerRadius = 16844149; // 0x1010575
    field public static final int buttonGravity = 16844030; // 0x10104fe
    field public static final int buttonStyle = 16842824; // 0x1010048
    field public static final int buttonStyleInset = 16842826; // 0x101004a
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
        <item>
            <shape android:shape="rectangle"
                   android:tint="@color/btn_colored_background_material">
                <corners android:radius="@dimen/control_corner_material" />
                <corners android:radius="?attr/buttonCornerRadius" />
                <solid android:color="@color/white" />
                <padding android:left="@dimen/button_padding_horizontal_material"
                         android:top="@dimen/button_padding_vertical_material"
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
       android:insetBottom="@dimen/button_inset_vertical_material">
    <shape android:shape="rectangle"
           android:tint="?attr/colorButtonNormal">
        <corners android:radius="@dimen/control_corner_material" />
        <corners android:radius="?attr/buttonCornerRadius" />
        <solid android:color="@color/white" />
        <padding android:left="@dimen/button_padding_horizontal_material"
                 android:top="@dimen/button_padding_vertical_material"
+3 −0
Original line number Diff line number Diff line
@@ -1016,6 +1016,9 @@
        <!-- Style for the "neutral" buttons within button bars. -->
        <attr name="buttonBarNeutralButtonStyle" format="reference" />

        <!-- Corner radius of buttons. -->
        <attr name="buttonCornerRadius" format="dimension" />

        <!-- Style for the search query widget. -->
        <attr name="searchViewStyle" format="reference" />

+2 −0
Original line number Diff line number Diff line
@@ -3174,6 +3174,8 @@

    <!-- Corner radius of system dialogs -->
    <dimen name="config_dialogCornerRadius">2dp</dimen>
    <!-- Corner radius of system buttons -->
    <dimen name="config_buttonCornerRadius">@dimen/control_corner_material</dimen>
    <!-- Controls whether system buttons use all caps for text -->
    <bool name="config_buttonTextAllCaps">true</bool>
    <!-- Name of the font family used for system buttons -->
Loading