am ba2ce6fa: Merge "Update alert dialog styling to match Material spec" into lmp-dev
* commit 'ba2ce6fa080df627646501f58bab5fde76b0f2c2': Update alert dialog styling to match Material spec
This commit is contained in:
@@ -33,8 +33,8 @@
|
||||
android:gravity="center_vertical|start"
|
||||
android:paddingStart="@dimen/alert_dialog_padding_material"
|
||||
android:paddingEnd="@dimen/alert_dialog_padding_material"
|
||||
android:paddingTop="@dimen/alert_dialog_padding_material"
|
||||
android:paddingBottom="8dip">
|
||||
android:paddingTop="@dimen/alert_dialog_padding_top_material"
|
||||
android:paddingBottom="12dip">
|
||||
<ImageView android:id="@+id/icon"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="32dip"
|
||||
@@ -67,9 +67,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/alert_dialog_padding_material"
|
||||
android:paddingEnd="@dimen/alert_dialog_padding_material"
|
||||
android:paddingTop="@dimen/alert_dialog_padding_material"
|
||||
android:paddingBottom="@dimen/alert_dialog_padding_material" />
|
||||
android:paddingEnd="@dimen/alert_dialog_padding_material" />
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -77,7 +75,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:minHeight="64dp">
|
||||
android:minHeight="48dp">
|
||||
<FrameLayout android:id="@+id/custom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
@@ -89,15 +87,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layoutDirection="locale"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="6dp">
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
<Button android:id="@+id/button3"
|
||||
style="?attr/buttonBarNeutralButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height" />
|
||||
android:layout_height="wrap_content" />
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
@@ -106,14 +103,10 @@
|
||||
<Button android:id="@+id/button2"
|
||||
style="?attr/buttonBarNegativeButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height" />
|
||||
android:layout_height="wrap_content" />
|
||||
<Button android:id="@+id/button1"
|
||||
style="?attr/buttonBarPositiveButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height" />
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -17,32 +17,25 @@
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
<ProgressBar android:id="@+id/progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="@dimen/alert_dialog_padding_material"
|
||||
android:paddingEnd="@dimen/alert_dialog_padding_material">
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
style="?attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dip"
|
||||
android:layout_marginBottom="1dip"
|
||||
android:layout_marginStart="16dip"
|
||||
android:layout_marginEnd="16dip"
|
||||
android:layout_centerHorizontal="true" />
|
||||
<TextView
|
||||
android:id="@+id/progress_percent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="16dip"
|
||||
android:layout_marginStart="16dip"
|
||||
android:layout_marginEnd="16dip"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@id/progress" />
|
||||
<TextView
|
||||
android:id="@+id/progress_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="16dip"
|
||||
android:layout_marginStart="16dip"
|
||||
android:layout_marginEnd="16dip"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_below="@id/progress" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -23,17 +23,17 @@ This is a custom layout for a dialog.
|
||||
android:fitsSystemWindows="true">
|
||||
<FrameLayout android:id="@android:id/title_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/windowTitleSize"
|
||||
android:layout_height="?attr/windowTitleSize"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_vertical|start"
|
||||
style="?android:attr/windowTitleBackgroundStyle" />
|
||||
style="?attr/windowTitleBackgroundStyle" />
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:foreground="?android:attr/windowContentOverlay">
|
||||
<FrameLayout android:id="@android:id/content"
|
||||
android:foreground="?attr/windowContentOverlay">
|
||||
<FrameLayout android:id="@id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</FrameLayout>
|
||||
|
||||
@@ -28,16 +28,16 @@ enabled.
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dip"
|
||||
android:paddingEnd="16dip"
|
||||
android:paddingTop="16dip">
|
||||
android:paddingStart="@dimen/alert_dialog_padding_material"
|
||||
android:paddingEnd="@dimen/alert_dialog_padding_material"
|
||||
android:paddingTop="@dimen/alert_dialog_padding_material">
|
||||
<ImageView android:id="@+id/left_icon"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="32dip"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_marginEnd="8dip" />
|
||||
<TextView android:id="@android:id/title"
|
||||
style="?android:attr/windowTitleStyle"
|
||||
<TextView android:id="@id/title"
|
||||
style="?attr/windowTitleStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0" />
|
||||
@@ -52,8 +52,8 @@ enabled.
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:foreground="?android:attr/windowContentOverlay">
|
||||
<FrameLayout android:id="@android:id/content"
|
||||
android:foreground="?attr/windowContentOverlay">
|
||||
<FrameLayout android:id="@id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</FrameLayout>
|
||||
|
||||
@@ -29,15 +29,15 @@ enabled.
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="viewStart"
|
||||
android:paddingStart="16dip"
|
||||
android:paddingEnd="16dip"
|
||||
android:paddingTop="16dip" />
|
||||
android:paddingStart="@dimen/alert_dialog_padding_material"
|
||||
android:paddingEnd="@dimen/alert_dialog_padding_material"
|
||||
android:paddingTop="@dimen/alert_dialog_padding_top_material" />
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:foreground="?android:attr/windowContentOverlay">
|
||||
<FrameLayout android:id="@android:id/content"
|
||||
android:foreground="?attr/windowContentOverlay">
|
||||
<FrameLayout android:id="@id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</FrameLayout>
|
||||
|
||||
@@ -19,21 +19,25 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout android:id="@+id/body"
|
||||
<LinearLayout
|
||||
android:id="@+id/body"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
android:padding="16dip">
|
||||
android:paddingStart="@dimen/alert_dialog_padding_material"
|
||||
android:paddingEnd="@dimen/alert_dialog_padding_material">
|
||||
|
||||
<ProgressBar android:id="@android:id/progress"
|
||||
<ProgressBar
|
||||
android:id="@id/progress"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="10000"
|
||||
android:layout_marginEnd="16dip" />
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
<TextView android:id="@+id/message"
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
@@ -77,5 +77,6 @@
|
||||
<!-- Default rounded corner for controls -->
|
||||
<dimen name="control_corner_material">2dp</dimen>
|
||||
|
||||
<dimen name="alert_dialog_padding_material">18dp</dimen>
|
||||
<dimen name="alert_dialog_padding_material">24dp</dimen>
|
||||
<dimen name="alert_dialog_padding_top_material">18dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -474,6 +474,13 @@ please see styles_device_defaults.xml.
|
||||
<item name="stateListAnimator">@anim/disabled_anim_material</item>
|
||||
</style>
|
||||
|
||||
<!-- Alert dialog button bar button -->
|
||||
<style name="Widget.Material.Button.ButtonBar.AlertDialog" parent="Widget.Material.Button.Borderless.Colored">
|
||||
<item name="minWidth">64dp</item>
|
||||
<item name="maxLines">2</item>
|
||||
<item name="minHeight">@dimen/alert_dialog_button_bar_height</item>
|
||||
</style>
|
||||
|
||||
<!-- Small borderless ink button -->
|
||||
<style name="Widget.Material.Button.Borderless.Small">
|
||||
<item name="minHeight">48dip</item>
|
||||
@@ -496,7 +503,6 @@ please see styles_device_defaults.xml.
|
||||
|
||||
<style name="Widget.Material.ButtonBar.AlertDialog">
|
||||
<item name="background">@null</item>
|
||||
<item name="minHeight">@dimen/alert_dialog_button_bar_height</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Material.SearchView">
|
||||
@@ -936,6 +942,7 @@ please see styles_device_defaults.xml.
|
||||
<style name="Widget.Material.Light.Button.Small" parent="Widget.Material.Button.Small"/>
|
||||
<style name="Widget.Material.Light.Button.Borderless" parent="Widget.Material.Button.Borderless"/>
|
||||
<style name="Widget.Material.Light.Button.Borderless.Colored" parent="Widget.Material.Button.Borderless.Colored"/>
|
||||
<style name="Widget.Material.Light.Button.ButtonBar.AlertDialog" parent="Widget.Material.Button.ButtonBar.AlertDialog" />
|
||||
<style name="Widget.Material.Light.Button.Borderless.Small" parent="Widget.Material.Button.Borderless.Small"/>
|
||||
<style name="Widget.Material.Light.Button.Inset" parent="Widget.Material.Button.Inset"/>
|
||||
<style name="Widget.Material.Light.Button.Toggle" parent="Widget.Material.Button.Toggle" />
|
||||
|
||||
@@ -333,7 +333,7 @@ please see themes_device_defaults.xml.
|
||||
<item name="dividerVertical">?attr/listDivider</item>
|
||||
<item name="dividerHorizontal">?attr/listDivider</item>
|
||||
<item name="buttonBarStyle">@style/Widget.Material.ButtonBar</item>
|
||||
<item name="buttonBarButtonStyle">@style/Widget.Material.Button.Borderless.Colored</item>
|
||||
<item name="buttonBarButtonStyle">@style/Widget.Material.Button.ButtonBar.AlertDialog</item>
|
||||
<item name="segmentedButtonStyle">@style/Widget.Material.SegmentedButton</item>
|
||||
|
||||
<!-- SearchView attributes -->
|
||||
@@ -679,7 +679,7 @@ please see themes_device_defaults.xml.
|
||||
<item name="dividerVertical">?attr/listDivider</item>
|
||||
<item name="dividerHorizontal">?attr/listDivider</item>
|
||||
<item name="buttonBarStyle">@style/Widget.Material.Light.ButtonBar</item>
|
||||
<item name="buttonBarButtonStyle">@style/Widget.Material.Light.Button.Borderless.Colored</item>
|
||||
<item name="buttonBarButtonStyle">@style/Widget.Material.Light.Button.ButtonBar.AlertDialog</item>
|
||||
<item name="segmentedButtonStyle">@style/Widget.Material.Light.SegmentedButton</item>
|
||||
|
||||
<!-- SearchView attributes -->
|
||||
|
||||
Reference in New Issue
Block a user