1<?xml version="1.0" encoding="utf-8"?>
2<!--
3/*
4** Copyright 2006, The Android Open Source Project
5**
6** Licensed under the Apache License, Version 2.0 (the "License");
7** you may not use this file except in compliance with the License.
8** You may obtain a copy of the License at
9**
10**     http://www.apache.org/licenses/LICENSE-2.0
11**
12** Unless required by applicable law or agreed to in writing, software
13** distributed under the License is distributed on an "AS IS" BASIS,
14** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15** See the License for the specific language governing permissions and
16** limitations under the License.
17*/
18-->
19<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
20              xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
21              android:id="@androidprv:id/item"
22              android:orientation="vertical"
23              android:layout_width="match_parent"
24              android:layout_height="wrap_content"
25              android:minHeight="100dp"
26              android:gravity="top|center_horizontal"
27              android:paddingVertical="@dimen/grid_padding"
28              android:paddingHorizontal="4dp"
29              android:focusable="true"
30              android:background="?android:attr/selectableItemBackgroundBorderless">
31
32    <ImageView android:id="@android:id/icon"
33               android:layout_width="@dimen/chooser_icon_size"
34               android:layout_height="@dimen/chooser_icon_size"
35               android:layout_marginHorizontal="8dp"
36               android:scaleType="fitCenter" />
37
38    <!-- Size manually tuned to match specs -->
39    <Space android:layout_width="1dp"
40           android:layout_height="7dp"/>
41
42    <!-- NOTE: for id/text1 and id/text2 below set the width to match parent as a workaround for
43         b/269395540 i.e. prevent views bounds change during a transition animation. It does not
44         affect pinned views as we change their layout parameters programmatically (but that's even
45         more narrow possibility and it's not clear if the root cause or the bug would affect it).
46    -->
47    <!-- App name or Direct Share target name, DS set to 2 lines -->
48    <TextView android:id="@android:id/text1"
49              android:layout_width="match_parent"
50              android:layout_height="wrap_content"
51              android:textAppearance="?android:attr/textAppearanceSmall"
52              android:textColor="?androidprv:attr/materialColorOnSurface"
53              android:textSize="@dimen/chooser_grid_target_name_text_size"
54              android:gravity="top|center_horizontal"
55              android:maxLines="1"
56              android:ellipsize="end" />
57
58    <!-- Activity name if set, gone for Direct Share targets -->
59    <TextView android:id="@android:id/text2"
60              android:textAppearance="?android:attr/textAppearanceSmall"
61              android:textSize="@dimen/chooser_grid_activity_name_text_size"
62              android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"
63              android:layout_width="match_parent"
64              android:layout_height="wrap_content"
65              android:lines="1"
66              android:gravity="top|center_horizontal"
67              android:ellipsize="end"/>
68
69</LinearLayout>
70
71