-
Notifications
You must be signed in to change notification settings - Fork 646
Expand file tree
/
Copy pathfile_item_grid.xml
More file actions
143 lines (127 loc) · 6.22 KB
/
Copy pathfile_item_grid.xml
File metadata and controls
143 lines (127 loc) · 6.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2023 Hai Zhang <dreaming.in.code.zh@gmail.com>
~ All Rights Reserved.
-->
<me.zhanghai.android.files.ui.CheckableForegroundLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/itemLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="vertical">
<me.zhanghai.android.files.ui.AspectRatioFrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/screen_edge_margin"
android:layout_marginEnd="@dimen/screen_edge_margin"
android:layout_marginTop="@dimen/screen_edge_margin"
android:duplicateParentState="true"
app:aspectRatio="1.78">
<me.zhanghai.android.files.ui.DisabledAlphaImageView
android:id="@+id/directoryThumbnailImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:duplicateParentState="true"
android:scaleType="fitCenter"
android:padding="4dp"
android:src="@drawable/file_directory_thumbnail" />
<me.zhanghai.android.files.ui.DisabledAlphaImageView
android:id="@+id/thumbnailIconImage"
android:layout_width="@dimen/large_icon_size"
android:layout_height="@dimen/large_icon_size"
android:layout_gravity="center"
android:duplicateParentState="true"
android:scaleType="centerCrop" />
<!--
~ Can't use ShapeableImageView stroke support due to
~ https://github.com/material-components/material-components-android/issues/1329
-->
<me.zhanghai.android.files.ui.DisabledAlphaImageView
android:id="@+id/thumbnailImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:duplicateParentState="true"
android:scaleType="centerCrop"
app:shapeAppearance="?shapeAppearanceSmallComponent" />
<View
android:id="@+id/thumbnailOutlineView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/file_item_grid_thumbnail_outline"
android:duplicateParentState="true" />
<FrameLayout
android:id="@+id/iconLayout"
android:layout_width="@dimen/touch_target_size"
android:layout_height="@dimen/touch_target_size"
android:layout_marginStart="@dimen/screen_edge_margin_minus_12dp"
android:duplicateParentState="true"
android:padding="@dimen/touch_target_large_icon_padding">
<me.zhanghai.android.files.ui.DisabledAlphaImageView
android:id="@+id/iconImage"
android:layout_width="24dp"
android:layout_height="24dp"
android:duplicateParentState="true"
android:scaleType="fitCenter" />
<me.zhanghai.android.files.ui.DisabledAlphaImageView
android:id="@+id/appIconBadgeImage"
android:layout_width="@dimen/badge_size_plus_1dp"
android:layout_height="@dimen/badge_size_plus_1dp"
android:layout_gravity="start|top"
android:layout_marginStart="-0.5dp"
android:layout_marginEnd="-0.5dp"
android:layout_marginTop="-0.5dp"
android:layout_marginBottom="-0.5dp"
android:duplicateParentState="true" />
<me.zhanghai.android.files.ui.DisabledAlphaImageView
android:id="@+id/badgeImage"
android:layout_width="@dimen/badge_size"
android:layout_height="@dimen/badge_size"
android:layout_gravity="start|top"
android:background="@drawable/badge_background_18dp"
android:duplicateParentState="true" />
<me.zhanghai.android.files.ui.DisabledAlphaImageView
android:layout_width="@dimen/badge_size"
android:layout_height="@dimen/badge_size"
android:layout_gravity="start|top"
android:duplicateParentState="true"
android:src="@drawable/checkable_badge_18dp" />
</FrameLayout>
<!--
~ Cannot use android:duplicateParentState="true" because a button needs to have its own
~ pressed state, etc. Necessary states will be duplicated manually in the adapter
~ implementation.
-->
<me.zhanghai.android.foregroundcompat.ForegroundImageButton
android:id="@+id/menuButton"
android:layout_width="@dimen/touch_target_size"
android:layout_height="@dimen/touch_target_size"
android:layout_marginEnd="@dimen/screen_edge_margin_minus_12dp"
android:layout_gravity="end|center_vertical"
android:padding="@dimen/touch_target_icon_padding"
android:background="@null"
android:foreground="@drawable/selectable_item_background_oval"
android:src="@drawable/more_vertical_icon_white_24dp"
app:tint="?colorControlNormal" />
</me.zhanghai.android.files.ui.AspectRatioFrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/single_line_list_item_height"
android:layout_marginBottom="@dimen/screen_edge_margin_minus_8dp"
android:duplicateParentState="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/nameText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:duplicateParentState="true"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:textAppearance="?textAppearanceListItemSecondary" />
</LinearLayout>
</me.zhanghai.android.files.ui.CheckableForegroundLinearLayout>