Update shortcut view layout.
- Change UI layout and fonts.
- Determine layout by display height rather than width to support
display sizes better.
- Remove layout controlled by code.
Bug: 132044897
Test: Manually
Change-Id: I15ac4db56766fa6ed6ba8d122548e260dc6f95c8
Merged-In: I15ac4db56766fa6ed6ba8d122548e260dc6f95c8
(cherry picked from commit ac620cfb594259c4455c90d9665cc5fbc0eee8c1)
diff --git a/res/layout/emergency_dialer.xml b/res/layout/emergency_dialer.xml
index 6247379..37cf725 100644
--- a/res/layout/emergency_dialer.xml
+++ b/res/layout/emergency_dialer.xml
@@ -46,7 +46,8 @@
android:layout_height="@dimen/dialpad_button_height"
android:background="@drawable/floating_action_button_red"
android:contentDescription="@string/description_dialpad_button"
- android:src="@drawable/ic_dialpad_white_24"/>
+ android:src="@drawable/ic_dialpad_white_24"
+ android:scaleType="centerInside"/>
</FrameLayout>
</FrameLayout>
diff --git a/res/layout/emergency_information.xml b/res/layout/emergency_information.xml
index 524387f..676254f 100644
--- a/res/layout/emergency_information.xml
+++ b/res/layout/emergency_information.xml
@@ -19,7 +19,8 @@
android:layout_height="@dimen/emergency_info_button_height"
android:layout_width="match_parent"
android:layout_marginHorizontal="@dimen/emergency_shortcut_buttons_margin_horizontal"
- android:layout_marginVertical="@dimen/emergency_info_button_margin_vertical">
+ android:layout_marginTop="@dimen/emergency_info_button_margin_top"
+ android:layout_marginBottom="@dimen/emergency_info_button_margin_bottom">
<FrameLayout
android:id="@+id/emergency_info_view"
android:layout_height="match_parent"
@@ -38,7 +39,7 @@
android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
android:layout_height="@dimen/emergency_info_image_height"
android:layout_width="@dimen/emergency_info_image_width"
- android:scaleType="centerCrop"/>
+ android:scaleType="centerInside"/>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
@@ -53,8 +54,7 @@
android:maxLines="1"
android:ellipsize="end"
android:lineHeight="@dimen/emergency_info_name_line_height"
- android:fontFamily="@*android:string/config_headlineFontFamily"
- android:textAppearance="@style/HeadlineTextAppearance"/>
+ android:textAppearance="@style/EmergencyInfoNameTextAppearance"/>
<TextView
android:id="@+id/emergency_info_hint"
android:layout_height="wrap_content"
@@ -63,7 +63,7 @@
android:ellipsize="end"
android:lineHeight="@dimen/emergency_info_hint_line_height"
android:alpha="0.7"
- android:textAppearance="@style/SubtitleTextAppearance"
+ android:textAppearance="@style/EmergencyInfoHintTextAppearance"
android:text="@string/emergency_information_hint"/>
</LinearLayout>
</LinearLayout>
@@ -88,7 +88,7 @@
android:layout_width="@dimen/emergency_info_image_width"
android:layout_marginStart="@dimen/emergency_dialer_image_margin_start"
android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
- android:scaleType="centerCrop"/>
+ android:scaleType="centerInside"/>
<TextView
android:id="@+id/confirmed_emergency_info"
android:layout_height="wrap_content"
@@ -99,8 +99,7 @@
android:maxLines="2"
android:ellipsize="end"
android:lineHeight="@dimen/confirmed_emergency_info_line_height"
- android:fontFamily="@*android:string/config_headlineFontFamily"
- android:textAppearance="@style/PhoneCallHintTextAppearance"
+ android:textAppearance="@style/EmergencyInfoTapHintTextAppearance"
android:text="@string/emergency_information_confirm_hint"/>
</LinearLayout>
</FrameLayout>
diff --git a/res/layout/emergency_shortcut_button.xml b/res/layout/emergency_shortcut_button.xml
index 3c5eaa2..25e91b8 100644
--- a/res/layout/emergency_shortcut_button.xml
+++ b/res/layout/emergency_shortcut_button.xml
@@ -16,7 +16,8 @@
<com.android.phone.EmergencyShortcutButton
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="@dimen/emergency_shortcut_button_height"
- android:layout_width="match_parent">
+ android:layout_width="match_parent"
+ android:layout_marginBottom="@dimen/emergency_shortcut_button_margin_bottom">
<!-- Normal emergency call button view -->
<FrameLayout
android:id="@+id/emergency_call_number_info_view"
@@ -42,7 +43,8 @@
android:id="@+id/phone_type_icon"
android:layout_width="@dimen/phone_number_type_image_height"
android:layout_height="@dimen/phone_number_type_image_width"
- android:layout_gravity="center"/>
+ android:layout_gravity="center"
+ android:scaleType="centerInside"/>
</FrameLayout>
<LinearLayout
android:layout_height="wrap_content"
@@ -57,7 +59,6 @@
android:maxLines="1"
android:ellipsize="end"
android:lineHeight="@dimen/phone_number_line_height"
- android:fontFamily="@*android:string/config_headlineFontFamily"
android:textAppearance="@style/PhoneNumberTextAppearance"/>
<TextView
android:id="@+id/phone_number_description"
@@ -66,8 +67,7 @@
android:alpha="0.7"
android:maxLines="1"
android:ellipsize="end"
- android:fontFamily="sans-serif-medium"
- android:textAppearance="@style/SubtitleTextAppearance"/>
+ android:textAppearance="@style/PhoneNumberTypeAppearance"/>
</LinearLayout>
</LinearLayout>
<FrameLayout
@@ -79,7 +79,9 @@
android:id="@+id/microphone_icon"
android:layout_height="@dimen/phone_icon_height"
android:layout_width="@dimen/phone_icon_width"
- android:src="@drawable/ic_emergency_callback_mode"/>
+ android:src="@drawable/ic_emergency_callback_mode"
+ android:tint="@color/emergency_call_icon"
+ android:scaleType="centerInside"/>
</FrameLayout>
</FrameLayout>
@@ -111,6 +113,7 @@
android:layout_width="@dimen/phone_number_type_image_height"
android:layout_height="@dimen/phone_number_type_image_width"
android:layout_gravity="center"
+ android:scaleType="centerInside"
android:tint="@color/emergency_shortcut_confirm_button_background_color"/>
</FrameLayout>
<FrameLayout
@@ -124,8 +127,7 @@
android:maxLines="2"
android:ellipsize="end"
android:lineHeight="@dimen/phone_call_hint_line_height"
- android:fontFamily="@*android:string/config_headlineFontFamily"
- android:textAppearance="@style/PhoneCallHintTextAppearance"/>
+ android:textAppearance="@style/PhoneNumberTapHintAppearance"/>
</FrameLayout>
</LinearLayout>
<FrameLayout
@@ -137,7 +139,9 @@
<ImageView
android:layout_height="@dimen/phone_icon_height"
android:layout_width="@dimen/phone_icon_width"
- android:src="@drawable/ic_emergency_callback_mode"/>
+ android:src="@drawable/ic_emergency_callback_mode"
+ android:tint="@color/emergency_call_icon"
+ android:scaleType="centerInside"/>
</FrameLayout>
</FrameLayout>
</com.android.phone.EmergencyShortcutButton>
diff --git a/res/layout/emergency_shortcut_buttons_group.xml b/res/layout/emergency_shortcut_buttons_group.xml
index 54563c9..0f8218a 100644
--- a/res/layout/emergency_shortcut_buttons_group.xml
+++ b/res/layout/emergency_shortcut_buttons_group.xml
@@ -37,8 +37,7 @@
android:maxLines="2"
android:ellipsize="end"
android:lineHeight="@dimen/emergency_number_title_line_height"
- android:fontFamily="sans-serif-medium"
- android:textColor="@android:color/white"
+ android:textAppearance="@style/ShortcutViewHintTextAppearance"
android:textSize="@dimen/emergency_number_title_text_size"
android:text="@string/single_emergency_number_title"/>
</FrameLayout>
@@ -55,7 +54,8 @@
android:id="@+id/location_icon"
android:layout_width="@dimen/location_image_width"
android:layout_height="@dimen/location_image_height"
- android:src="@drawable/place_gm2_24px"/>
+ android:src="@drawable/place_gm2_24px"
+ android:scaleType="centerInside"/>
<TextView
android:id="@+id/location_text"
android:layout_height="wrap_content"
@@ -64,7 +64,7 @@
android:maxLines="2"
android:ellipsize="end"
android:lineHeight="@dimen/location_text_line_height"
- android:textColor="@android:color/white"
+ android:textAppearance="@style/ShortcutViewHintTextAppearance"
android:textSize="@dimen/emergency_location_text_size"/>
</LinearLayout>
</FrameLayout>
@@ -73,8 +73,6 @@
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginHorizontal="@dimen/emergency_shortcut_buttons_margin_horizontal"
- android:orientation="vertical"
- android:divider="@drawable/emergency_shortcuts_divider"
- android:showDividers="middle">
+ android:orientation="vertical">
</LinearLayout>
</LinearLayout>
diff --git a/res/values-h535dp/dimens.xml b/res/values-h535dp/dimens.xml
new file mode 100644
index 0000000..c3b2341
--- /dev/null
+++ b/res/values-h535dp/dimens.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<resources>
+ <!-- Height and vertical margin for the emergency information button. -->
+ <dimen name="emergency_info_button_height">80dp</dimen>
+ <dimen name="emergency_info_button_margin_top">35dp</dimen>
+ <dimen name="emergency_info_button_margin_bottom">40dp</dimen>
+
+ <!-- The text size of emergency info name and hint -->
+ <dimen name="emergency_info_name_text_size">18.3sp</dimen>
+ <dimen name="emergency_info_hint_text_size">13.3sp</dimen>
+ <dimen name="emergency_info_tap_hint_text_size">15sp</dimen>
+
+ <!-- The height for title of emergency number and location info. -->
+ <dimen name="emergency_number_title_height">40dp</dimen>
+ <!-- The text size for emergency number title.-->
+ <dimen name="emergency_number_title_text_size">11.6sp</dimen>
+
+ <!-- The height and width for the image of location info.-->
+ <dimen name="location_image_height">13.3dp</dimen>
+ <dimen name="location_image_width">13.3dp</dimen>
+
+ <!-- The text size for emergency location.-->
+ <dimen name="emergency_location_text_size">11.6sp</dimen>
+
+ <!-- The height and margin for button of emergency shortcut. -->
+ <dimen name="emergency_shortcut_button_height">80dp</dimen>
+ <dimen name="emergency_shortcut_button_margin_bottom">6.7dp</dimen>
+
+ <!-- The text size of emergency number, type and hint -->
+ <dimen name="emergency_shortcut_number_text_size">27sp</dimen>
+ <dimen name="emergency_shortcut_type_text_size">11.6sp</dimen>
+ <dimen name="emergency_shortcut_tap_hint_text_size">15sp</dimen>
+
+ <!-- The height and width for the image of phone number type.-->
+ <dimen name="phone_number_type_image_height">33dp</dimen>
+ <dimen name="phone_number_type_image_width">33dp</dimen>
+
+ <!-- The height and width of phone icon.-->
+ <dimen name="phone_icon_height">20dp</dimen>
+ <dimen name="phone_icon_width">20dp</dimen>
+
+ <!-- Margin of dialpad button -->
+ <dimen name="emergency_dialer_dialpad_button_margin">27dp</dimen>
+
+ <!-- The height and width for the dialpad button -->
+ <dimen name="dialpad_button_height">47dp</dimen>
+ <dimen name="dialpad_button_width">47dp</dimen>
+</resources>
diff --git a/res/values-h590dp/dimens.xml b/res/values-h590dp/dimens.xml
new file mode 100644
index 0000000..3684f4c
--- /dev/null
+++ b/res/values-h590dp/dimens.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<resources>
+ <!-- Height and vertical margin for the emergency information button. -->
+ <dimen name="emergency_info_button_height">87dp</dimen>
+ <dimen name="emergency_info_button_margin_top">44dp</dimen>
+ <dimen name="emergency_info_button_margin_bottom">44dp</dimen>
+
+ <!-- The text size of emergency info name and hint -->
+ <dimen name="emergency_info_name_text_size">20sp</dimen>
+ <dimen name="emergency_info_hint_text_size">14.5sp</dimen>
+ <dimen name="emergency_info_tap_hint_text_size">16.4sp</dimen>
+
+ <!-- The height for title of emergency number and location info. -->
+ <dimen name="emergency_number_title_height">44dp</dimen>
+ <!-- The text size for emergency number title.-->
+ <dimen name="emergency_number_title_text_size">12.7sp</dimen>
+
+ <!-- The height and width for the image of location info.-->
+ <dimen name="location_image_height">14.5dp</dimen>
+ <dimen name="location_image_width">14.5dp</dimen>
+
+ <!-- The text size for emergency location.-->
+ <dimen name="emergency_location_text_size">12.7sp</dimen>
+
+ <!-- The height and margin for button of emergency shortcut. -->
+ <dimen name="emergency_shortcut_button_height">87dp</dimen>
+ <dimen name="emergency_shortcut_button_margin_bottom">7.3dp</dimen>
+
+ <!-- The text size of emergency number, type and hint -->
+ <dimen name="emergency_shortcut_number_text_size">29sp</dimen>
+ <dimen name="emergency_shortcut_type_text_size">12.7sp</dimen>
+ <dimen name="emergency_shortcut_tap_hint_text_size">16.4sp</dimen>
+
+ <!-- The height and width for the image of phone number type.-->
+ <dimen name="phone_number_type_image_height">36dp</dimen>
+ <dimen name="phone_number_type_image_width">36dp</dimen>
+
+ <!-- The height and width of phone icon.-->
+ <dimen name="phone_icon_height">22dp</dimen>
+ <dimen name="phone_icon_width">22dp</dimen>
+
+ <!-- Margin of dialpad button -->
+ <dimen name="emergency_dialer_dialpad_button_margin">29dp</dimen>
+
+ <!-- The height and width for the dialpad button -->
+ <dimen name="dialpad_button_height">51dp</dimen>
+ <dimen name="dialpad_button_width">51dp</dimen>
+</resources>
diff --git a/res/values-h720dp/dimens.xml b/res/values-h720dp/dimens.xml
new file mode 100644
index 0000000..7bb1f27
--- /dev/null
+++ b/res/values-h720dp/dimens.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<resources>
+ <!-- Height and vertical margin for the emergency information button. -->
+ <dimen name="emergency_info_button_height">96dp</dimen>
+ <dimen name="emergency_info_button_margin_top">72dp</dimen>
+ <dimen name="emergency_info_button_margin_bottom">60dp</dimen>
+
+ <!-- The text size of emergency info name and hint -->
+ <dimen name="emergency_info_name_text_size">22sp</dimen>
+ <dimen name="emergency_info_hint_text_size">16sp</dimen>
+ <dimen name="emergency_info_tap_hint_text_size">18sp</dimen>
+
+ <!-- The height for title of emergency number and location info. -->
+ <dimen name="emergency_number_title_height">48dp</dimen>
+ <!-- The text size for emergency number title.-->
+ <dimen name="emergency_number_title_text_size">14sp</dimen>
+
+ <!-- The height and width for the image of location info.-->
+ <dimen name="location_image_height">16dp</dimen>
+ <dimen name="location_image_width">16dp</dimen>
+
+ <!-- The text size for emergency location.-->
+ <dimen name="emergency_location_text_size">14sp</dimen>
+
+ <!-- The height and margin for button of emergency shortcut. -->
+ <dimen name="emergency_shortcut_button_height">96dp</dimen>
+ <dimen name="emergency_shortcut_button_margin_bottom">8dp</dimen>
+
+ <!-- The text size of emergency number, type and hint -->
+ <dimen name="emergency_shortcut_number_text_size">32sp</dimen>
+ <dimen name="emergency_shortcut_type_text_size">14sp</dimen>
+ <dimen name="emergency_shortcut_tap_hint_text_size">18sp</dimen>
+
+ <!-- The height and width for the image of phone number type.-->
+ <dimen name="phone_number_type_image_height">40dp</dimen>
+ <dimen name="phone_number_type_image_width">40dp</dimen>
+
+ <!-- The height and width of phone icon.-->
+ <dimen name="phone_icon_height">24dp</dimen>
+ <dimen name="phone_icon_width">24dp</dimen>
+
+ <!-- Margin of dialpad button -->
+ <dimen name="emergency_dialer_dialpad_button_margin">64dp</dimen>
+
+ <!-- The height and width for the dialpad button -->
+ <dimen name="dialpad_button_height">56dp</dimen>
+ <dimen name="dialpad_button_width">56dp</dimen>
+</resources>
diff --git a/res/values-sw345dp/dimens.xml b/res/values-sw345dp/dimens.xml
deleted file mode 100644
index 84db80b..0000000
--- a/res/values-sw345dp/dimens.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2018 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
- -->
-
-<resources>
- <dimen name="emergency_info_button_height">88dp</dimen>
- <dimen name="emergency_info_button_margin_vertical">48dp</dimen>
- <dimen name="emergency_shortcut_button_height">88dp</dimen>
- <dimen name="emergency_number_title_text_size">12sp</dimen>
- <dimen name="emergency_location_text_size">12sp</dimen>
-</resources>
\ No newline at end of file
diff --git a/res/values-sw360dp/dimens.xml b/res/values-sw360dp/dimens.xml
deleted file mode 100644
index c578065..0000000
--- a/res/values-sw360dp/dimens.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2018 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
- -->
-
-<resources>
- <dimen name="emergency_info_button_height">96dp</dimen>
- <dimen name="emergency_info_button_margin_vertical">56dp</dimen>
- <dimen name="emergency_shortcut_button_height">96dp</dimen>
- <dimen name="emergency_number_title_text_size">14sp</dimen>
- <dimen name="emergency_location_text_size">14sp</dimen>
-</resources>
\ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index be3e2b8..a6c3a3d 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -54,8 +54,9 @@
<color name="dialer_dialpad_touch_tint">#330288d1</color>
<color name="floating_action_button_touch_tint">#80ffffff</color>
- <color name="emergency_shortcut_button_background_color">#40FFFFFF</color>
+ <color name="emergency_shortcut_button_background_color">#EAE8E9</color>
<color name="emergency_shortcut_confirm_button_background_color">#E25142</color>
+ <color name="emergency_call_icon">#3C4043</color>
<!-- Color matches dialer settings light M2 theme.-->
<color name="dialer_background_color">#ffffff</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 23d20fc..e1742d8 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -118,20 +118,12 @@
<dimen name="emergency_dialer_image_margin_start">20dp</dimen>
<dimen name="emergency_dialer_image_margin_end">16dp</dimen>
- <!-- Margin of dialpad button -->
- <dimen name="emergency_dialer_dialpad_button_margin">40dp</dimen>
-
<!-- Horizontal margin for button of emergency shortcut. -->
<dimen name="emergency_shortcut_buttons_margin_horizontal">16dp</dimen>
<!-- Horizontal padding for group of emergency number title-->
<dimen name="emergency_number_title_group_padding_horizontal">16dp</dimen>
- <!-- Height and vertical margin for the emergency information button. -->
- <dimen name="emergency_info_button_height">80dp</dimen>
- <dimen name="emergency_info_button_margin_vertical">40dp</dimen>
- <dimen name="emergency_info_button_fix_margin_vertical">40dp</dimen>
-
<!-- Margin for the emergency information button text. -->
<dimen name="emergency_info_text_margin_end">20dp</dimen>
@@ -143,32 +135,10 @@
<dimen name="emergency_shortcuts_function_icon_height">24dp</dimen>
<dimen name="emergency_shortcuts_function_icon_width">24dp</dimen>
- <!-- The height and width for the dialpad button -->
- <dimen name="dialpad_button_height">56dp</dimen>
- <dimen name="dialpad_button_width">56dp</dimen>
-
- <!-- The height for title of emergency number and location info. -->
- <dimen name="emergency_number_title_height">48dp</dimen>
-
- <!-- The height and width for the image of location info.-->
- <dimen name="location_image_height">16dp</dimen>
- <dimen name="location_image_width">16dp</dimen>
-
- <!-- The height for button of emergency shortcut. -->
- <dimen name="emergency_shortcut_button_height">80dp</dimen>
-
<!-- The height and width for the circle image of phone number type.-->
<dimen name="phone_number_type_circle_image_height">40dp</dimen>
<dimen name="phone_number_type_circle_image_width">40dp</dimen>
- <!-- The height and width for the image of phone number type.-->
- <dimen name="phone_number_type_image_height">24dp</dimen>
- <dimen name="phone_number_type_image_width">24dp</dimen>
-
- <!-- The height and width of phone icon.-->
- <dimen name="phone_icon_height">24dp</dimen>
- <dimen name="phone_icon_width">24dp</dimen>
-
<!-- Margin for the emergency shortcut button.-->
<dimen name="emergency_shortcuts_margin_end">60dp</dimen>
@@ -197,12 +167,6 @@
<!-- The width for emergency number title container.-->
<dimen name="emergency_number_title_container_width">210dp</dimen>
- <!-- The text size for emergency number title.-->
- <dimen name="emergency_number_title_text_size">13sp</dimen>
-
- <!-- The text size for emergency location.-->
- <dimen name="emergency_location_text_size">13sp</dimen>
-
<!-- The text size for titles in settings page.-->
<dimen name="dialer_head1_font_size">18dp</dimen>
@@ -211,4 +175,54 @@
<!-- The text size for description in settings page.-->
<dimen name="dialer_secondary_font_size">14dp</dimen>
+
+
+ <!-- Shortcut view vertical dimens. These values are tuned according to display
+ height in values-h<height>dp/dimens.xml -->
+ <!-- Height and vertical margin for the emergency information button. -->
+ <dimen name="emergency_info_button_height">74dp</dimen>
+ <dimen name="emergency_info_button_margin_top">32dp</dimen>
+ <dimen name="emergency_info_button_margin_bottom">37dp</dimen>
+
+ <!-- The text size of emergency info name and hint -->
+ <dimen name="emergency_info_name_text_size">16.9sp</dimen>
+ <dimen name="emergency_info_hint_text_size">12.3sp</dimen>
+ <dimen name="emergency_info_tap_hint_text_size">13.8sp</dimen>
+
+ <!-- The height for title of emergency number and location info. -->
+ <dimen name="emergency_number_title_height">37dp</dimen>
+ <!-- The text size for emergency number title.-->
+ <dimen name="emergency_number_title_text_size">10.7sp</dimen>
+
+ <!-- The height and width for the image of location info.-->
+ <dimen name="location_image_height">12.3dp</dimen>
+ <dimen name="location_image_width">12.3dp</dimen>
+
+ <!-- The text size for emergency location.-->
+ <dimen name="emergency_location_text_size">10.7sp</dimen>
+
+ <!-- The height and margin for button of emergency shortcut. -->
+ <dimen name="emergency_shortcut_button_height">74dp</dimen>
+ <dimen name="emergency_shortcut_button_margin_bottom">6.2dp</dimen>
+
+ <!-- The text size of emergency number, type and hint -->
+ <dimen name="emergency_shortcut_number_text_size">25sp</dimen>
+ <dimen name="emergency_shortcut_type_text_size">10.7sp</dimen>
+ <dimen name="emergency_shortcut_tap_hint_text_size">13.8sp</dimen>
+
+ <!-- The height and width for the image of phone number type.-->
+ <dimen name="phone_number_type_image_height">31dp</dimen>
+ <dimen name="phone_number_type_image_width">31dp</dimen>
+
+ <!-- The height and width of phone icon.-->
+ <dimen name="phone_icon_height">18.4dp</dimen>
+ <dimen name="phone_icon_width">18.4dp</dimen>
+
+ <!-- Margin of dialpad button -->
+ <dimen name="emergency_dialer_dialpad_button_margin">25dp</dimen>
+
+ <!-- The height and width for the dialpad button -->
+ <dimen name="dialpad_button_height">43dp</dimen>
+ <dimen name="dialpad_button_width">43dp</dimen>
+ <!-- End of Shortcut view vertical dimens. -->
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index dec69df..c791968 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -335,25 +335,44 @@
<item name="android:listDivider">@null</item>
</style>
- <style name="HeadlineTextAppearance">
- <item name="android:textColor">@android:color/white</item>
- <item name="android:textSize">22sp</item>
+ <style name="EmergencyInfoNameTextAppearance">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:textColor">@*android:color/primary_text_default_material_dark</item>
+ <item name="android:textSize">@dimen/emergency_info_name_text_size</item>
</style>
- <style name="SubtitleTextAppearance" parent="@style/HeadlineTextAppearance">
- <item name="android:textSize">14sp</item>
+ <style name="EmergencyInfoHintTextAppearance">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:textColor">@*android:color/secondary_text_default_material_dark</item>
+ <item name="android:textSize">@dimen/emergency_info_hint_text_size</item>
+ </style>
+
+ <style name="EmergencyInfoTapHintTextAppearance">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:textColor">@android:color/white</item>
+ <item name="android:textSize">@dimen/emergency_info_tap_hint_text_size</item>
+ </style>
+
+ <style name="ShortcutViewHintTextAppearance">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:textColor">@*android:color/secondary_text_default_material_dark</item>
</style>
<style name="PhoneNumberTextAppearance">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:textColor">@*android:color/primary_text_default_material_light</item>
+ <item name="android:textSize">@dimen/emergency_shortcut_number_text_size</item>
+ </style>
+
+ <style name="PhoneNumberTypeAppearance">
+ <item name="android:fontFamily">roboto</item>
+ <item name="android:textColor">@*android:color/secondary_text_default_material_light</item>
+ <item name="android:textSize">@dimen/emergency_shortcut_type_text_size</item>
+ </style>
+
+ <style name="PhoneNumberTapHintAppearance">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
<item name="android:textColor">@android:color/white</item>
- <item name="android:textSize">32sp</item>
- </style>
-
- <style name="PhoneCallHintTextAppearance" parent="@style/PhoneNumberTextAppearance">
- <item name="android:textSize">18sp</item>
- </style>
-
- <style name="ShortcutsHintTextAppearance" parent="@style/HeadlineTextAppearance">
- <item name="android:textSize">16sp</item>
+ <item name="android:textSize">@dimen/emergency_shortcut_tap_hint_text_size</item>
</style>
</resources>
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index d6b7b41..3f00ae1 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -1185,11 +1185,6 @@
if (mEmergencyShortcutButtonList.size() > 1) {
emergencyNumberTitle.setText(getString(
R.string.numerous_emergency_numbers_title));
- // Update mEmergencyInfoGroup margin to avoid UI overlay when
- // emergency shortcut button more than 2.
- if (mEmergencyShortcutButtonList.size() > 2) {
- mEmergencyInfoGroup.updateLayoutMargin();
- }
} else {
emergencyNumberTitle.setText(getText(R.string.single_emergency_number_title));
}
diff --git a/src/com/android/phone/EmergencyInfoGroup.java b/src/com/android/phone/EmergencyInfoGroup.java
index 7f01412..7ec6e6d 100644
--- a/src/com/android/phone/EmergencyInfoGroup.java
+++ b/src/com/android/phone/EmergencyInfoGroup.java
@@ -35,7 +35,6 @@
import android.view.accessibility.AccessibilityManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
-import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.graphics.drawable.RoundedBitmapDrawable;
@@ -284,18 +283,4 @@
hideSelectedButton();
}
};
-
- /**
- * Update layout margin when emergency shortcut button more than 2.
- */
- public void updateLayoutMargin() {
- LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) getLayoutParams();
-
- params.topMargin = getResources().getDimensionPixelSize(
- R.dimen.emergency_info_button_fix_margin_vertical);
- params.bottomMargin = getResources().getDimensionPixelSize(
- R.dimen.emergency_info_button_fix_margin_vertical);
-
- setLayoutParams(params);
- }
}