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:layout_marginHorizontal="@dimen/widget_list_horizontal_margin" 23 android:paddingVertical="@dimen/widget_list_header_view_vertical_padding" 24 android:orientation="horizontal" 25 launcher:appIconSize="48dp"> 26 27 <ImageView 28 android:id="@+id/app_icon" 29 android:layout_width="wrap_content" 30 android:layout_height="wrap_content" 31 android:layout_marginHorizontal="16dp" 32 android:importantForAccessibility="no" 33 tools:src="@drawable/ic_corp"/> 34 35 <LinearLayout 36 android:id="@+id/app_container" 37 android:layout_width="0dp" 38 android:layout_height="wrap_content" 39 android:layout_gravity="center_vertical" 40 android:layout_weight="1" 41 android:orientation="vertical" 42 android:focusable="true" 43 android:descendantFocusability="afterDescendants"> 44 45 <TextView 46 android:id="@+id/app_title" 47 android:layout_width="wrap_content" 48 android:layout_height="wrap_content" 49 android:layout_gravity="start|center_vertical" 50 android:ellipsize="end" 51 android:maxLines="1" 52 android:textColor="?android:attr/textColorPrimary" 53 android:textSize="16sp" 54 tools:text="App name" /> 55 56 <TextView 57 android:id="@+id/app_subtitle" 58 android:layout_width="wrap_content" 59 android:layout_height="wrap_content" 60 android:ellipsize="end" 61 android:maxLines="1" 62 android:textColor="?android:attr/textColorSecondary" 63 android:alpha="0.7" 64 tools:text="m widgets, n shortcuts" /> 65 66 </LinearLayout> 67 68 <!-- This checkbox is not clickable. The outermost LinearLayout is responsible to handle all 69 click event and update the checkbox state. --> 70 <CheckBox 71 android:id="@+id/toggle" 72 android:layout_marginHorizontal="16dp" 73 android:layout_width="wrap_content" 74 android:layout_height="wrap_content" 75 android:layout_gravity="center_vertical" 76 android:layout_alignParentEnd="true" 77 android:enabled="false" 78 android:clickable="false" 79 android:importantForAccessibility="no" 80 android:button="@drawable/widgets_tray_expand_button"/> 81 82</com.android.launcher3.widget.picker.WidgetsListHeader>