xref: /aosp_15_r20/frameworks/base/packages/SystemUI/res/layout/keyboard_shortcuts_search_view.xml (revision d57664e9bc4670b3ecf6748a746a57c557b6bc9e)
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2022 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
17<LinearLayout
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
20    android:background="@drawable/shortcut_dialog_bg"
21    android:layout_width="@dimen/ksh_layout_width"
22    android:layout_height="wrap_content"
23    android:orientation="vertical">
24
25    <com.google.android.material.bottomsheet.BottomSheetDragHandleView
26        android:id="@+id/drag_handle"
27        android:layout_width="match_parent"
28        android:layout_height="wrap_content"/>
29
30    <TextView
31        android:id="@+id/shortcut_title"
32        android:layout_width="wrap_content"
33        android:layout_height="wrap_content"
34        android:layout_gravity="center_horizontal"
35        android:textAppearance="?android:attr/textAppearanceLarge"
36        android:textColor="?android:attr/textColorPrimary"
37        android:text="@string/keyboard_shortcut_search_list_title"/>
38
39    <FrameLayout android:layout_width="match_parent"
40                 android:layout_height="wrap_content">
41        <EditText
42            android:id="@+id/keyboard_shortcuts_search"
43            android:layout_gravity="center_vertical|start"
44            android:layout_width="match_parent"
45            android:layout_height="wrap_content"
46            android:layout_marginTop="24dp"
47            android:layout_marginBottom="24dp"
48            android:layout_marginStart="@dimen/ksh_container_horizontal_margin"
49            android:layout_marginEnd="@dimen/ksh_container_horizontal_margin"
50            android:padding="16dp"
51            android:background="@drawable/shortcut_search_background"
52            android:drawableStart="@drawable/ic_shortcutlist_search"
53            android:drawablePadding="15dp"
54            android:singleLine="true"
55            android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"
56            android:inputType="text"
57            android:textDirection="locale"
58            android:textAlignment="viewStart"
59            android:hint="@string/keyboard_shortcut_search_list_hint"
60            android:textAppearance="@android:style/TextAppearance.Material"
61            android:textSize="16sp"
62            android:textColorHint="?androidprv:attr/materialColorOutline" />
63
64        <ImageButton
65            android:id="@+id/keyboard_shortcuts_search_cancel"
66            android:layout_gravity="center_vertical|end"
67            android:layout_width="wrap_content"
68            android:layout_height="wrap_content"
69            android:layout_marginEnd="@dimen/ksh_container_horizontal_margin"
70            android:padding="16dp"
71            android:contentDescription="@string/keyboard_shortcut_clear_text"
72            android:src="@drawable/ic_shortcutlist_search_button_cancel"
73            android:background="@drawable/shortcut_search_cancel_button"
74            style="@android:style/Widget.Material.Button.Borderless.Small"
75            android:pointerIcon="arrow"
76            android:visibility="gone" />
77    </FrameLayout>
78
79    <HorizontalScrollView
80        android:layout_width="match_parent"
81        android:layout_height="wrap_content"
82        android:layout_marginStart="@dimen/ksh_container_horizontal_margin"
83        android:layout_marginEnd="0dp"
84        android:scrollbars="none">
85        <LinearLayout
86            android:layout_width="wrap_content"
87            android:layout_height="wrap_content"
88            android:layout_gravity="center_vertical|start"
89            android:orientation="horizontal">
90            <Button
91                android:id="@+id/shortcut_system"
92                android:layout_width="wrap_content"
93                android:layout_height="wrap_content"
94                style="@style/ShortCutButton"
95                android:text="@string/keyboard_shortcut_search_category_system" />
96
97            <Button
98                android:id="@+id/shortcut_input"
99                android:layout_width="wrap_content"
100                android:layout_height="wrap_content"
101                style="@style/ShortCutButton"
102                android:text="@string/keyboard_shortcut_search_category_input"/>
103
104            <Button
105                android:id="@+id/shortcut_open_apps"
106                android:layout_width="wrap_content"
107                android:layout_height="wrap_content"
108                style="@style/ShortCutButton"
109                android:text="@string/keyboard_shortcut_search_category_open_apps"/>
110
111            <Button
112                android:id="@+id/shortcut_specific_app"
113                android:layout_width="wrap_content"
114                android:layout_height="wrap_content"
115                style="@style/ShortCutButton"
116                android:text="@string/keyboard_shortcut_search_category_current_app"/>
117        </LinearLayout>
118    </HorizontalScrollView>
119
120    <TextView
121        android:id="@+id/shortcut_search_no_result"
122        android:layout_width="wrap_content"
123        android:layout_height="wrap_content"
124        android:layout_marginTop="50dp"
125        android:layout_marginStart="@dimen/ksh_container_horizontal_margin"
126        android:layout_marginEnd="@dimen/ksh_container_horizontal_margin"
127        android:layout_gravity="center_horizontal"
128        android:textAppearance="?android:attr/textAppearanceMedium"
129        android:textColor="?android:attr/textColorPrimary"
130        android:text="@string/keyboard_shortcut_search_list_no_result"/>
131
132    <androidx.core.widget.NestedScrollView
133        android:id="@+id/keyboard_shortcuts_scroll_view"
134        android:layout_width="match_parent"
135        android:layout_height="wrap_content"
136        android:layout_marginTop="16dp"
137        android:layout_marginStart="@dimen/ksh_container_horizontal_margin"
138        android:layout_marginEnd="@dimen/ksh_container_horizontal_margin"
139        android:overScrollMode="never"
140        android:clipToPadding="false"
141        android:scrollbars="none">
142        <LinearLayout
143            android:id="@+id/keyboard_shortcuts_container"
144            android:layout_width="match_parent"
145            android:layout_height="wrap_content"
146            android:orientation="vertical"/>
147    </androidx.core.widget.NestedScrollView>
148    <!-- Required for stretching to full available height when the items in the scroll view
149         occupy less space then the full height -->
150    <View
151        android:layout_width="match_parent"
152        android:layout_height="0dp"
153        android:layout_weight="1"/>
154</LinearLayout>
155