Add message view in wear alert dialog.

Test: manual test/build check
Bug: 228210140
Change-Id: I65fac4d0a5d38db08703cd59044376c7156cd062
This commit is contained in:
Mohamed Gharibe
2022-05-11 14:45:43 +00:00
committed by Todd Lee
parent 240cdf2c2f
commit 963128bad5
4 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="?attr/dialogPreferredPadding"
android:paddingTop="@dimen/dialog_padding_top_material"
android:paddingEnd="?attr/dialogPreferredPadding"
android:paddingBottom="@dimen/dialog_padding_top_material">
<TextView
android:id="@+id/progress_dialog_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
style="@style/ProgressDialogMessage" />
<ProgressBar
android:id="@+id/progress"
style="?attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/progress_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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:layout_alignParentEnd="true"
android:layout_below="@id/progress" />
</RelativeLayout>

View File

@@ -45,6 +45,13 @@
<dimen name="progress_bar_size_medium">32dip</dimen>
<dimen name="progress_bar_size_large">64dip</dimen>
<!-- Progress bar message dimens -->
<dimen name="message_progress_dialog_text_size">18sp</dimen>
<dimen name="message_progress_dialog_bottom_padding">80px</dimen>
<dimen name="message_progress_dialog_top_padding">0dp</dimen>
<dimen name="message_progress_dialog_start_padding">0dp</dimen>
<dimen name="message_progress_dialog_end_padding">0dp</dimen>
<!-- fallback for screen percentage widths -->
<dimen name="screen_percentage_05">0dp</dimen>
<dimen name="screen_percentage_10">0dp</dimen>

View File

@@ -97,4 +97,14 @@ please see styles_device_defaults.xml.
<item name="gravity">center_horizontal|top</item>
<item name="ellipsize">end</item>
</style>
<style name="ProgressDialogMessage">
<item name="android:textAlignment">center</item>
<item name="textAppearance">@android:style/TextAppearance.DeviceDefault.Medium</item>
<item name="textSize">@dimen/message_progress_dialog_text_size</item>
<item name="paddingBottom">@dimen/message_progress_dialog_bottom_padding</item>
<item name="paddingEnd">@dimen/message_progress_dialog_end_padding</item>
<item name="paddingStart">@dimen/message_progress_dialog_start_padding</item>
<item name="paddingTop">@dimen/message_progress_dialog_top_padding</item>
</style>
</resources>

View File

@@ -153,6 +153,7 @@
<java-symbol type="id" name="progress_horizontal" />
<java-symbol type="id" name="progress_number" />
<java-symbol type="id" name="progress_percent" />
<java-symbol type="id" name="progress_dialog_message" />
<java-symbol type="id" name="progressContainer" />
<java-symbol type="id" name="rew" />
<java-symbol type="id" name="rightSpacer" />