• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2016 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<!-- There seems to be a bug in layout inflation where it can't use a resource to inflate a view
17     group that sets layout_marginTop with a dimension. Work around by putting in a shell layout.
18-->
19<FrameLayout
20    xmlns:android="http://schemas.android.com/apk/res/android"
21    xmlns:card_view="http://schemas.android.com/apk/res-auto"
22    android:layout_width="match_parent"
23    android:layout_height="match_parent">
24
25    <!-- This CardView is clickable so that clicks do not fall through to the fragment that
26         is underneath the dialer_fragment. -->
27    <android.support.v7.widget.CardView
28        android:layout_width="match_parent"
29        android:layout_height="match_parent"
30        android:layout_marginTop="@dimen/lens_header_height"
31        android:clickable="true"
32        card_view:cardBackgroundColor="@color/car_card"
33        card_view:cardElevation="@dimen/dialer_card_elevation">
34
35        <RelativeLayout
36            android:layout_width="match_parent"
37            android:layout_height="match_parent">
38
39            <TextView
40                android:id="@+id/number"
41                android:layout_width="match_parent"
42                android:layout_height="@dimen/dialer_number_view_height"
43                android:paddingTop="@dimen/dialer_number_view_padding"
44                android:paddingBottom="@dimen/dialer_number_view_padding"
45                android:gravity="center"
46                android:focusable="true"
47                android:text="@string/dial_a_number"
48                android:layout_alignParentTop="true"
49                style="@style/CarBody1" />
50
51            <View
52                android:id="@+id/line_divider"
53                android:background="@color/car_list_divider"
54                android:layout_width="match_parent"
55                android:layout_height="@dimen/line_divider_height"
56                android:layout_marginLeft="@dimen/stream_content_keyline_1"
57                android:layout_marginRight="@dimen/stream_content_keyline_1"
58                android:layout_below="@id/number" />
59
60            <LinearLayout
61                android:orientation="horizontal"
62                android:layout_marginTop="@dimen/dial_container_vertical_margin"
63                android:layout_width="match_parent"
64                android:layout_height="wrap_content"
65                android:layout_below="@id/line_divider" >
66
67                <FrameLayout
68                    android:layout_width="0dp"
69                    android:layout_height="match_parent"
70                    android:layout_weight="1" >
71
72                    <ImageButton
73                        android:id="@+id/call"
74                        android:scaleType="center"
75                        android:src="@drawable/ic_phone"
76                        style="@style/DialpadCall"
77                        android:elevation="@dimen/call_fab_elevation"
78                        android:layout_gravity="center" />
79                </FrameLayout>
80
81                <include
82                    android:layout_gravity="center"
83                    android:layout_height="wrap_content"
84                    android:layout_width="wrap_content"
85                    layout="@layout/dialpad" />
86
87                <FrameLayout
88                    android:layout_width="0dp"
89                    android:layout_height="match_parent"
90                    android:layout_weight="1" >
91
92                    <ImageButton
93                        android:id="@+id/delete"
94                        android:layout_width="@dimen/bksp_button_width"
95                        android:layout_height="@dimen/bksp_button_width"
96                        android:scaleType="centerInside"
97                        android:src="@drawable/ic_backspace"
98                        android:tint="@color/car_tint"
99                        android:background="@drawable/dialpad_delete_button_background"
100                        android:layout_gravity="center" />
101                </FrameLayout>
102            </LinearLayout>
103        </RelativeLayout>
104
105        <!-- This FrameLayout ensures that the back button is centered within the
106             exit_dialer_button despite the button's touch target
107             being smaller. -->
108        <FrameLayout
109            android:layout_gravity="start|top"
110            android:layout_width="@dimen/stream_content_keyline_1"
111            android:layout_height="@dimen/stream_content_keyline_1">
112
113            <ImageView
114                android:id="@+id/exit_dialer_button"
115                android:background="@drawable/dialpad_button_background"
116                android:layout_gravity="center"
117                android:layout_width="@dimen/stream_button_size"
118                android:layout_height="@dimen/stream_button_size"
119                android:scaleType="center"
120                android:tint="@color/car_tint"
121                android:src="@drawable/ic_down_outlined" />
122        </FrameLayout>
123    </android.support.v7.widget.CardView>
124</FrameLayout>
125