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.dialer.main.impl.toolbar.MainToolbar
17    xmlns:android="http://schemas.android.com/apk/res/android"
18    xmlns:app="http://schemas.android.com/apk/res-auto"
19    android:layout_width="match_parent"
20    android:layout_height="@dimen/expanded_search_bar_height"
21    android:background="?android:attr/colorPrimary"
22    app:contentInsetEnd="0dp"
23    app:contentInsetStart="0dp">
24  <FrameLayout
25      android:layout_width="match_parent"
26      android:layout_height="match_parent">
27    <com.android.dialer.main.impl.toolbar.SearchBarView
28        android:id="@+id/search_view_container"
29        android:layout_width="match_parent"
30        android:layout_height="wrap_content"
31        android:layout_margin="@dimen/search_bar_margin"
32        android:background="@drawable/search_bar_background_rounded_corners"
33        android:elevation="4dp"
34        android:minHeight="@dimen/collapsed_search_bar_height">
35
36      <RelativeLayout
37          android:id="@+id/search_box_collapsed"
38          android:layout_width="match_parent"
39          android:layout_height="wrap_content"
40          android:layout_gravity="center_vertical"
41          android:background="?android:attr/selectableItemBackground"
42          android:gravity="center_vertical">
43
44        <ImageView
45            android:id="@+id/search_magnifying_glass"
46            android:layout_width="48dp"
47            android:layout_height="48dp"
48            android:layout_marginStart="8dp"
49            android:layout_centerVertical="true"
50            android:importantForAccessibility="no"
51            android:scaleType="center"
52            android:src="@drawable/quantum_ic_search_vd_theme_24"
53            android:tint="?colorIcon"/>
54
55        <TextView
56            android:id="@+id/search_box_start_search"
57            android:layout_width="wrap_content"
58            android:layout_height="wrap_content"
59            android:layout_marginStart="8dp"
60            android:layout_centerVertical="true"
61            android:layout_toEndOf="@+id/search_magnifying_glass"
62            android:layout_toStartOf="@+id/voice_search_button"
63            android:text="@string/dialer_hint_find_contact"
64            android:textSize="16dp"
65            style="@style/Dialer.TextAppearance.Secondary"/>
66
67        <ImageView
68            android:id="@+id/voice_search_button"
69            android:layout_width="48dp"
70            android:layout_height="48dp"
71            android:layout_toStartOf="@+id/main_options_menu_button"
72            android:background="?android:attr/selectableItemBackgroundBorderless"
73            android:contentDescription="@string/description_start_voice_search"
74            android:scaleType="center"
75            android:src="@drawable/quantum_ic_mic_vd_theme_24"
76            android:tint="?colorIcon"/>
77
78        <ImageButton
79            android:id="@+id/main_options_menu_button"
80            android:layout_width="48dp"
81            android:layout_height="48dp"
82            android:layout_alignParentEnd="true"
83            android:background="?android:attr/selectableItemBackgroundBorderless"
84            android:contentDescription="@string/action_menu_overflow_description"
85            android:scaleType="center"
86            android:src="@drawable/quantum_ic_more_vert_vd_theme_24"
87            android:tint="?colorIcon"/>
88      </RelativeLayout>
89
90      <include layout="@layout/expanded_search_bar"/>
91    </com.android.dialer.main.impl.toolbar.SearchBarView>
92
93    <!-- Sets android:importantForAccessibility="no" to avoid being announced when navigating with
94         talkback enabled. It will still be announced when user drag or drop contact onto it.
95         This is required since drag and drop event is only sent to views are visible when drag
96         starts. -->
97    <com.android.dialer.app.list.RemoveView
98        android:id="@+id/remove_view"
99        android:layout_width="match_parent"
100        android:layout_height="match_parent"
101        android:layout_margin="@dimen/search_bar_margin"
102        android:layout_gravity="center_vertical"
103        android:contentDescription="@string/main_remove_contact"
104        android:importantForAccessibility="no">
105
106      <!-- We set this view's visibility to gone instead of the parent because if we hide remove
107      view, it won't receive drag and accessibility events. -->
108      <LinearLayout
109          android:id="@+id/remove_view_content"
110          android:layout_width="match_parent"
111          android:layout_height="match_parent"
112          android:background="?android:attr/colorPrimary"
113          android:gravity="center"
114          android:orientation="horizontal"
115          android:visibility="gone">
116
117        <ImageView
118            android:id="@+id/remove_view_icon"
119            android:layout_width="wrap_content"
120            android:layout_height="wrap_content"
121            android:layout_marginTop="8dp"
122            android:layout_marginBottom="8dp"
123            android:src="@drawable/quantum_ic_close_vd_theme_24"
124            android:tint="?colorIconOnUnthemedDarkBackground"/>
125
126        <TextView
127            android:id="@+id/remove_view_text"
128            android:layout_width="wrap_content"
129            android:layout_height="wrap_content"
130            android:text="@string/main_remove_contact"
131            android:textColor="?colorTextOnUnthemedDarkBackground"
132            android:textSize="16sp"/>
133      </LinearLayout>
134    </com.android.dialer.app.list.RemoveView>
135  </FrameLayout>
136</com.android.dialer.main.impl.toolbar.MainToolbar>
137