Tweak AlertDialog and Preference layout for nonround watches.
Update the title layouts of AlertDialog and Preference for nonround watches with proper padding. Bug: 31271003 Change-Id: I9305c1f52297ee6658de2e84295509d5f06f8aaf
This commit is contained in:
@@ -18,14 +18,14 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="?attr/dialogPreferredPadding"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="top|center_horizontal"
|
android:gravity="center_horizontal|top">
|
||||||
android:minHeight="@dimen/alert_dialog_title_height">
|
|
||||||
<ImageView android:id="@+id/icon"
|
<ImageView android:id="@+id/icon"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:maxHeight="24dp"
|
android:maxHeight="24dp"
|
||||||
android:maxWidth="24dp"
|
android:maxWidth="24dp"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -33,7 +33,6 @@
|
|||||||
android:src="@null" />
|
android:src="@null" />
|
||||||
<TextView android:id="@+id/alertTitle"
|
<TextView android:id="@+id/alertTitle"
|
||||||
style="?android:attr/windowTitleStyle"
|
style="?android:attr/windowTitleStyle"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="top|center_horizontal">
|
android:gravity="top|center_horizontal">
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
@@ -30,7 +31,6 @@
|
|||||||
android:maxHeight="24dp"
|
android:maxHeight="24dp"
|
||||||
android:maxWidth="24dp"
|
android:maxWidth="24dp"
|
||||||
android:layout_marginTop="@dimen/screen_percentage_10"
|
android:layout_marginTop="@dimen/screen_percentage_10"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<TextView android:id="@+id/alertTitle"
|
<TextView android:id="@+id/alertTitle"
|
||||||
style="?android:attr/windowTitleStyle"
|
style="?android:attr/windowTitleStyle"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
<TextView android:id="@+id/message"
|
<TextView android:id="@+id/message"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="@integer/config_dialogTextGravity"
|
android:gravity="center_horizontal|top"
|
||||||
android:textAppearance="@style/TextAppearance.Material.Subhead"
|
android:textAppearance="@style/TextAppearance.Material.Subhead"
|
||||||
android:paddingStart="?dialogPreferredPadding"
|
android:paddingStart="?dialogPreferredPadding"
|
||||||
android:paddingEnd="?dialogPreferredPadding"
|
android:paddingEnd="?dialogPreferredPadding"
|
||||||
@@ -80,7 +80,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:minHeight="@dimen/alert_dialog_button_bar_height"
|
|
||||||
android:paddingBottom="?dialogPreferredPadding"
|
android:paddingBottom="?dialogPreferredPadding"
|
||||||
style="?android:attr/buttonBarStyle"
|
style="?android:attr/buttonBarStyle"
|
||||||
android:measureWithLargestChild="true">
|
android:measureWithLargestChild="true">
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
android:paddingEnd="@dimen/dialog_padding_material"
|
android:paddingEnd="@dimen/dialog_padding_material"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:textAppearance="@style/TextAppearance.Material.Title"
|
android:textAppearance="@style/TextAppearance.Material.Title"
|
||||||
android:gravity="center" />
|
android:gravity="center_horizontal|top" />
|
||||||
</com.android.internal.widget.WatchHeaderListView>
|
</com.android.internal.widget.WatchHeaderListView>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -26,5 +26,5 @@
|
|||||||
android:paddingStart="@dimen/select_dialog_padding_start_material"
|
android:paddingStart="@dimen/select_dialog_padding_start_material"
|
||||||
android:paddingEnd="?attr/dialogPreferredPadding"
|
android:paddingEnd="?attr/dialogPreferredPadding"
|
||||||
android:drawableStart="?attr/listChoiceIndicatorMultiple"
|
android:drawableStart="?attr/listChoiceIndicatorMultiple"
|
||||||
android:drawablePadding="20dp"
|
android:drawablePadding="@dimen/select_dialog_drawable_padding_start_material"
|
||||||
android:ellipsize="marquee" />
|
android:ellipsize="marquee" />
|
||||||
|
|||||||
@@ -26,5 +26,5 @@
|
|||||||
android:paddingStart="@dimen/select_dialog_padding_start_material"
|
android:paddingStart="@dimen/select_dialog_padding_start_material"
|
||||||
android:paddingEnd="?attr/dialogPreferredPadding"
|
android:paddingEnd="?attr/dialogPreferredPadding"
|
||||||
android:drawableStart="?attr/listChoiceIndicatorSingle"
|
android:drawableStart="?attr/listChoiceIndicatorSingle"
|
||||||
android:drawablePadding="20dp"
|
android:drawablePadding="@dimen/select_dialog_drawable_padding_start_material"
|
||||||
android:ellipsize="marquee" />
|
android:ellipsize="marquee" />
|
||||||
|
|||||||
@@ -15,12 +15,16 @@
|
|||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="dialog_padding_material">8dp</dimen>
|
<dimen name="dialog_padding_material">8dp</dimen>
|
||||||
<dimen name="preference_fragment_padding_vertical_material">0dp</dimen>
|
<dimen name="preference_fragment_padding_vertical_material">8dp</dimen>
|
||||||
|
|
||||||
<dimen name="list_item_padding_horizontal_material">16dp</dimen>
|
<dimen name="list_item_padding_horizontal_material">8dp</dimen>
|
||||||
<dimen name="list_item_padding_start_material">16dp</dimen>
|
<dimen name="list_item_padding_start_material">8dp</dimen>
|
||||||
<dimen name="list_item_padding_end_material">16dp</dimen>
|
<dimen name="list_item_padding_end_material">8dp</dimen>
|
||||||
|
|
||||||
<dimen name="dialog_list_padding_top_no_title">8dp</dimen>
|
<dimen name="dialog_list_padding_top_no_title">0dp</dimen>
|
||||||
<dimen name="dialog_list_padding_bottom_no_buttons">8dp</dimen>
|
<dimen name="dialog_list_padding_bottom_no_buttons">0dp</dimen>
|
||||||
|
|
||||||
|
<!-- Dialog padding minus control padding, used to fix alignment. -->
|
||||||
|
<dimen name="select_dialog_padding_start_material">8dp</dimen>
|
||||||
|
<dimen name="select_dialog_drawable_padding_start_material">8dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -20,9 +20,6 @@
|
|||||||
<!-- Don't clip on round screens so the list can scroll past the rounded edges. -->
|
<!-- Don't clip on round screens so the list can scroll past the rounded edges. -->
|
||||||
<bool name="config_preferenceFragmentClipToPadding">false</bool>
|
<bool name="config_preferenceFragmentClipToPadding">false</bool>
|
||||||
|
|
||||||
<!-- Gravity that should be used for dialog text styles. Equivalent to: Gravity.CENTER_HORIZONTAL | Gravity.TOP -->
|
|
||||||
<integer name="config_dialogTextGravity">0x00000031</integer>
|
|
||||||
|
|
||||||
<!-- The amount to offset when scrolling to a selection in an AlertDialog -->
|
<!-- The amount to offset when scrolling to a selection in an AlertDialog -->
|
||||||
<dimen name="config_alertDialogSelectionScrollOffset">@dimen/screen_percentage_15</dimen>
|
<dimen name="config_alertDialogSelectionScrollOffset">@dimen/screen_percentage_15</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -23,4 +23,8 @@
|
|||||||
|
|
||||||
<dimen name="dialog_list_padding_top_no_title">@dimen/screen_percentage_15</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>
|
<dimen name="dialog_list_padding_bottom_no_buttons">@dimen/screen_percentage_15</dimen>
|
||||||
|
|
||||||
|
<!-- Dialog padding minus control padding, used to fix alignment. -->
|
||||||
|
<dimen name="select_dialog_padding_start_material">@dimen/screen_percentage_15</dimen>
|
||||||
|
<dimen name="select_dialog_drawable_padding_start_material">8dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -13,13 +13,9 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
<resources>
|
||||||
<!-- These resources are around just to allow their values to be customized
|
<!-- Dialog title height, not used in watch due to dynamically sized button bar -->
|
||||||
for different hardware and product builds, only for Material theme. Do not translate.
|
<dimen name="alert_dialog_title_height">0dp</dimen>
|
||||||
|
<!-- Dialog button bar height, not used in watch due to dynamically sized button bar -->
|
||||||
NOTE: The naming convention is "config_camelCaseValue". -->
|
<dimen name="alert_dialog_button_bar_height">0dp</dimen>
|
||||||
|
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
|
||||||
<!-- Gravity that should be used for dialog text styles. Equivalent to: Gravity.START | Gravity.TOP -->
|
|
||||||
<integer name="config_dialogTextGravity">0x00800033</integer>
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -98,7 +98,7 @@ please see styles_device_defaults.xml.
|
|||||||
<item name="maxLines">@empty</item>
|
<item name="maxLines">@empty</item>
|
||||||
<item name="scrollHorizontally">false</item>
|
<item name="scrollHorizontally">false</item>
|
||||||
<item name="textAppearance">@style/TextAppearance.Material.DialogWindowTitle</item>
|
<item name="textAppearance">@style/TextAppearance.Material.DialogWindowTitle</item>
|
||||||
<item name="gravity">@integer/config_dialogTextGravity</item>
|
<item name="gravity">center_horizontal|top</item>
|
||||||
<item name="ellipsize">end</item>
|
<item name="ellipsize">end</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -129,6 +129,7 @@
|
|||||||
|
|
||||||
<!-- Dialog padding minus control padding, used to fix alignment. -->
|
<!-- Dialog padding minus control padding, used to fix alignment. -->
|
||||||
<dimen name="select_dialog_padding_start_material">20dp</dimen>
|
<dimen name="select_dialog_padding_start_material">20dp</dimen>
|
||||||
|
<dimen name="select_dialog_drawable_padding_start_material">20dp</dimen>
|
||||||
|
|
||||||
<dimen name="seekbar_track_background_height_material">2dp</dimen>
|
<dimen name="seekbar_track_background_height_material">2dp</dimen>
|
||||||
<dimen name="seekbar_track_progress_height_material">2dp</dimen>
|
<dimen name="seekbar_track_progress_height_material">2dp</dimen>
|
||||||
|
|||||||
Reference in New Issue
Block a user