1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2018 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16<com.android.phone.EmergencyShortcutButton
17    xmlns:android="http://schemas.android.com/apk/res/android"
18    android:layout_height="@dimen/emergency_shortcut_button_height"
19    android:layout_width="match_parent"
20    android:layout_marginBottom="@dimen/emergency_shortcut_button_margin_bottom">
21    <!-- Normal emergency call button view -->
22    <FrameLayout
23        android:id="@+id/emergency_call_number_info_view"
24        android:layout_height="match_parent"
25        android:layout_width="match_parent"
26        android:background="@drawable/btn_emergency_shortcuts"
27        android:focusable="true"
28        android:clickable="true">
29        <LinearLayout
30            android:layout_height="match_parent"
31            android:layout_width="match_parent"
32            android:layout_marginEnd="@dimen/emergency_shortcuts_margin_end"
33            android:layout_gravity="center_vertical|start"
34            android:orientation="horizontal">
35            <FrameLayout
36                android:layout_height="@dimen/phone_number_type_circle_image_height"
37                android:layout_width="@dimen/phone_number_type_circle_image_width"
38                android:layout_gravity="center_vertical"
39                android:layout_marginStart="@dimen/emergency_dialer_image_margin_start"
40                android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
41                android:background="@drawable/phone_type_icon_background">
42                <ImageView
43                    android:id="@+id/phone_type_icon"
44                    android:layout_width="@dimen/phone_number_type_image_height"
45                    android:layout_height="@dimen/phone_number_type_image_width"
46                    android:layout_gravity="center"
47                    android:scaleType="centerInside"/>
48            </FrameLayout>
49            <LinearLayout
50                android:layout_height="wrap_content"
51                android:layout_width="match_parent"
52                android:layout_gravity="center_vertical"
53                android:orientation="vertical">
54                <TextView
55                    android:id="@+id/phone_number"
56                    android:layout_height="wrap_content"
57                    android:layout_width="wrap_content"
58                    android:includeFontPadding="false"
59                    android:maxLines="1"
60                    android:ellipsize="end"
61                    android:lineHeight="@dimen/phone_number_line_height"
62                    android:textAppearance="@style/PhoneNumberTextAppearance"/>
63                <TextView
64                    android:id="@+id/phone_number_description"
65                    android:layout_height="wrap_content"
66                    android:layout_width="wrap_content"
67                    android:alpha="0.7"
68                    android:maxLines="1"
69                    android:ellipsize="end"
70                    android:textAppearance="@style/PhoneNumberTypeAppearance"/>
71            </LinearLayout>
72        </LinearLayout>
73        <FrameLayout
74            android:layout_height="wrap_content"
75            android:layout_width="wrap_content"
76            android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
77            android:layout_gravity="center_vertical|end">
78            <ImageView
79                android:id="@+id/microphone_icon"
80                android:layout_height="@dimen/phone_icon_height"
81                android:layout_width="@dimen/phone_icon_width"
82                android:src="@drawable/ic_emergency_callback_mode"
83                android:tint="@color/emergency_call_icon_color"
84                android:scaleType="centerInside"/>
85        </FrameLayout>
86    </FrameLayout>
87
88    <!-- "Tap again to call" view -->
89    <FrameLayout
90        android:id="@+id/emergency_call_confirm_view"
91        android:layout_height="match_parent"
92        android:layout_width="match_parent"
93        android:background="@drawable/btn_emergency_confirm_shortcuts"
94        android:focusable="true"
95        android:clickable="true"
96        android:visibility="invisible">
97        <LinearLayout
98            android:layout_height="match_parent"
99            android:layout_width="match_parent"
100            android:layout_marginEnd="@dimen/emergency_shortcuts_margin_end"
101            android:layout_gravity="center_vertical|start"
102            android:gravity="center_vertical"
103            android:orientation="horizontal">
104            <FrameLayout
105                android:layout_height="@dimen/phone_number_type_circle_image_height"
106                android:layout_width="@dimen/phone_number_type_circle_image_width"
107                android:layout_marginStart="@dimen/emergency_dialer_image_margin_start"
108                android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
109                android:background="@drawable/phone_type_icon_background"
110                android:backgroundTint="@android:color/white">
111                <ImageView
112                    android:id="@+id/confirmed_phone_type_icon"
113                    android:layout_width="@dimen/phone_number_type_image_height"
114                    android:layout_height="@dimen/phone_number_type_image_width"
115                    android:layout_gravity="center"
116                    android:scaleType="centerInside"
117                    android:tint="@color/emergency_shortcut_confirm_button_background_color"/>
118            </FrameLayout>
119            <FrameLayout
120                android:layout_height="wrap_content"
121                android:layout_width="match_parent"
122                android:gravity="center_vertical">
123                <TextView
124                    android:id="@+id/phone_call_hint"
125                    android:layout_height="wrap_content"
126                    android:layout_width="wrap_content"
127                    android:maxLines="2"
128                    android:ellipsize="end"
129                    android:lineHeight="@dimen/phone_call_hint_line_height"
130                    android:textAppearance="@style/PhoneNumberTapHintAppearance"/>
131            </FrameLayout>
132        </LinearLayout>
133        <FrameLayout
134            android:layout_height="wrap_content"
135            android:layout_width="wrap_content"
136            android:layout_marginStart="@dimen/emergency_dialer_image_margin_start"
137            android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
138            android:layout_gravity="center_vertical|end">
139            <ImageView
140                android:layout_height="@dimen/phone_icon_height"
141                android:layout_width="@dimen/phone_icon_width"
142                android:src="@drawable/ic_emergency_callback_mode"
143                android:tint="@color/emergency_call_icon_color"
144                android:scaleType="centerInside"/>
145        </FrameLayout>
146    </FrameLayout>
147</com.android.phone.EmergencyShortcutButton>
148