1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2021 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.launcher3.widget.picker.WidgetsListHeader xmlns:android="http://schemas.android.com/apk/res/android"
17    xmlns:tools="http://schemas.android.com/tools"
18    xmlns:launcher="http://schemas.android.com/apk/res-auto"
19    android:id="@+id/widgets_list_header"
20    android:layout_width="match_parent"
21    android:layout_height="wrap_content"
22    android:orientation="horizontal"
23    android:importantForAccessibility="yes"
24    android:focusable="true"
25    launcher:appIconSize="48dp"
26    android:descendantFocusability="afterDescendants"
27    android:background="@drawable/bg_widgets_header" >
28
29    <ImageView
30        android:id="@+id/app_icon"
31        android:layout_width="wrap_content"
32        android:layout_height="wrap_content"
33        android:layout_marginHorizontal="16dp"
34        android:importantForAccessibility="no"
35        tools:src="@drawable/ic_corp"/>
36
37    <LinearLayout
38        android:layout_width="0dp"
39        android:layout_height="wrap_content"
40        android:layout_gravity="center_vertical"
41        android:layout_weight="1"
42        android:orientation="vertical">
43
44        <TextView
45            android:id="@+id/app_title"
46            android:layout_width="wrap_content"
47            android:layout_height="wrap_content"
48            android:layout_gravity="start|center_vertical"
49            android:ellipsize="end"
50            android:maxLines="1"
51            android:textColor="?attr/widgetPickerHeaderAppTitleColor"
52            android:textSize="@dimen/widget_picker_header_app_title_font_size"
53            android:textFontWeight="@integer/widget_picker_header_app_title_font_weight"
54            android:lineHeight="@dimen/widget_picker_header_app_title_line_height"
55            tools:text="App name" />
56
57        <TextView
58            android:id="@+id/app_subtitle"
59            android:layout_width="wrap_content"
60            android:layout_height="wrap_content"
61            android:ellipsize="end"
62            android:maxLines="1"
63            android:textColor="?attr/widgetPickerHeaderAppSubtitleColor"
64            android:textSize="@dimen/widget_picker_header_app_subtitle_font_size"
65            android:textFontWeight="@integer/widget_picker_header_app_subtitle_font_weight"
66            android:lineHeight="@dimen/widget_picker_header_app_subtitle_line_height"
67            tools:text="m widgets, n shortcuts" />
68
69    </LinearLayout>
70
71    <!-- This checkbox is not clickable. The outermost LinearLayout is responsible to handle all
72         click event and update the checkbox state. -->
73    <ImageView
74        android:duplicateParentState="true"
75        android:id="@+id/toggle"
76        android:alpha=".6"
77        android:src="@drawable/widgets_tray_expand_button"
78        android:layout_marginHorizontal="16dp"
79        android:layout_width="wrap_content"
80        android:layout_height="wrap_content"
81        android:layout_gravity="center_vertical"
82        android:layout_alignParentEnd="true"
83        android:enabled="false"
84        android:clickable="false"
85        android:importantForAccessibility="no" />
86
87</com.android.launcher3.widget.picker.WidgetsListHeader>