1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2017 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<merge xmlns:android="http://schemas.android.com/apk/res/android"
17    android:layout_width="wrap_content"
18    android:layout_height="wrap_content">
19
20    <com.android.launcher3.widget.WidgetCellPreview
21        android:id="@+id/widget_preview_container"
22        android:layout_width="0dp"
23        android:layout_height="0dp"
24        android:layout_weight="1"
25        android:importantForAccessibility="noHideDescendants"
26        android:hapticFeedbackEnabled="false"
27        android:clipChildren="false"
28        android:layout_marginVertical="8dp">
29        <!-- The image of the widget. This view does not support padding. Any placement adjustment
30             should be done using margins. Width & height are set at runtime after scaling the
31             preview image. -->
32        <com.android.launcher3.widget.WidgetImageView
33            android:id="@+id/widget_preview"
34            android:layout_width="match_parent"
35            android:layout_height="match_parent"
36            android:importantForAccessibility="no"
37            android:layout_gravity="fill"/>
38    </com.android.launcher3.widget.WidgetCellPreview>
39
40    <FrameLayout
41        android:layout_width="match_parent"
42        android:layout_height="wrap_content">
43        <LinearLayout
44            android:layout_width="match_parent"
45            android:layout_height="wrap_content"
46            android:layout_gravity="center_vertical"
47            android:id="@+id/widget_text_container"
48            android:orientation="vertical">
49                <!-- The name of the widget. -->
50                <TextView
51                    android:id="@+id/widget_name"
52                    android:layout_width="wrap_content"
53                    android:layout_height="wrap_content"
54                    android:ellipsize="end"
55                    android:fadingEdge="horizontal"
56                    android:layout_gravity="center_horizontal"
57                    android:gravity="center_horizontal|center_vertical"
58                    android:singleLine="true"
59                    android:maxLines="1"
60                    android:textColor="?attr/widgetCellTitleColor"
61                    android:textSize="@dimen/widget_cell_title_font_size"
62                    android:textFontWeight="@integer/widget_cell_title_font_weight"
63                    android:lineHeight="@dimen/widget_cell_title_line_height"
64                    android:drawablePadding="@dimen/widget_cell_app_icon_padding" />
65
66                <!-- The original dimensions of the widget -->
67                <TextView
68                    android:id="@+id/widget_dims"
69                    android:layout_width="match_parent"
70                    android:layout_height="wrap_content"
71                    android:gravity="center_horizontal"
72                    android:textColor="?attr/widgetCellSubtitleColor"
73                    android:textSize="@dimen/widget_cell_dims_font_size"
74                    android:textFontWeight="@integer/widget_cell_dims_font_weight"
75                    android:lineHeight="@dimen/widget_cell_dims_line_height" />
76
77                <TextView
78                    android:id="@+id/widget_description"
79                    android:layout_width="match_parent"
80                    android:layout_height="wrap_content"
81                    android:gravity="center_horizontal"
82                    android:textColor="?attr/widgetCellSubtitleColor"
83                    android:textSize="@dimen/widget_cell_description_font_size"
84                    android:textFontWeight="@integer/widget_cell_description_font_weight"
85                    android:lineHeight="@dimen/widget_cell_description_line_height"
86                    android:maxLines="3"
87                    android:ellipsize="end"
88                    android:fadingEdge="horizontal" />
89        </LinearLayout>
90
91        <Button
92            android:id="@+id/widget_add_button"
93            android:layout_width="wrap_content"
94            android:layout_height="@dimen/widget_cell_add_button_height"
95            android:layout_gravity="center"
96            android:minWidth="0dp"
97            android:paddingStart="@dimen/widget_cell_add_button_start_padding"
98            android:paddingEnd="@dimen/widget_cell_add_button_end_padding"
99            android:text="@string/widget_add_button_label"
100            android:textColor="?attr/widgetPickerAddButtonTextColor"
101            android:textSize="@dimen/widget_cell_add_button_font_size"
102            android:fontWeight="@integer/widget_cell_add_button_font_weight"
103            android:lineHeight="@dimen/widget_cell_add_button_line_height"
104            android:gravity="center"
105            android:visibility="gone"
106            android:drawableStart="@drawable/ic_plus"
107            android:drawablePadding="@dimen/widget_cell_add_button_drawable_padding"
108            android:drawableTint="?attr/widgetPickerAddButtonTextColor"
109            android:maxLines="1"
110            style="@style/Button.Rounded.Colored"
111            android:background="@drawable/widget_cell_add_button_background" />
112    </FrameLayout>
113</merge>
114