summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/flag(com.android.documentsui.flags.use_material3)/drawable/grid_nameplate_background.xml32
-rw-r--r--res/flag(com.android.documentsui.flags.use_material3)/layout/item_doc_grid.xml289
-rw-r--r--res/flag(com.android.documentsui.flags.use_material3)/values/dimens.xml7
3 files changed, 176 insertions, 152 deletions
diff --git a/res/flag(com.android.documentsui.flags.use_material3)/drawable/grid_nameplate_background.xml b/res/flag(com.android.documentsui.flags.use_material3)/drawable/grid_nameplate_background.xml
index 4a25b9a02..d88b70d71 100644
--- a/res/flag(com.android.documentsui.flags.use_material3)/drawable/grid_nameplate_background.xml
+++ b/res/flag(com.android.documentsui.flags.use_material3)/drawable/grid_nameplate_background.xml
@@ -16,10 +16,42 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- selected -->
+ <item android:state_selected="true" android:state_focused="true">
+ <layer-list>
+ <item
+ android:bottom="@dimen/focus_ring_gap"
+ android:left="@dimen/focus_ring_gap"
+ android:right="@dimen/focus_ring_gap"
+ android:top="@dimen/focus_ring_gap">
+ <shape>
+ <corners android:radius="@dimen/grid_item_nameplate_inner_radius" />
+ <solid android:color="?attr/colorPrimaryContainer" />
+ </shape>
+ </item>
+ <item>
+ <shape>
+ <corners android:radius="@dimen/grid_item_nameplate_radius" />
+ <stroke
+ android:width="@dimen/focus_ring_width"
+ android:color="?attr/colorSecondary" />
+ </shape>
+ </item>
+ </layer-list>
+ </item>
<item android:state_selected="true">
<shape>
<corners android:radius="@dimen/grid_item_nameplate_radius" />
<solid android:color="?attr/colorPrimaryContainer" />
</shape>
</item>
+
+ <!-- unselected -->
+ <item android:state_focused="true">
+ <shape>
+ <corners android:radius="@dimen/grid_item_nameplate_radius" />
+ <stroke
+ android:width="@dimen/focus_ring_width"
+ android:color="?attr/colorSecondary" />
+ </shape>
+ </item>
</selector> \ No newline at end of file
diff --git a/res/flag(com.android.documentsui.flags.use_material3)/layout/item_doc_grid.xml b/res/flag(com.android.documentsui.flags.use_material3)/layout/item_doc_grid.xml
index 574978c74..f854cf5f8 100644
--- a/res/flag(com.android.documentsui.flags.use_material3)/layout/item_doc_grid.xml
+++ b/res/flag(com.android.documentsui.flags.use_material3)/layout/item_doc_grid.xml
@@ -14,171 +14,162 @@
limitations under the License.
-->
-<com.google.android.material.card.MaterialCardView
- xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_root"
android:layout_width="@dimen/grid_item_width"
android:layout_height="@dimen/grid_item_height"
android:layout_margin="@dimen/grid_item_layout_margin"
android:clickable="true"
+ android:defaultFocusHighlightEnabled="false"
android:focusable="true"
- app:cardBackgroundColor="@android:color/transparent"
- app:cardElevation="0dp"
- app:strokeWidth="0dp">
-
- <RelativeLayout
- android:id="@+id/grid_item_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/grid_item_layout_marginStart"
- android:layout_marginEnd="@dimen/grid_item_layout_marginEnd"
- android:layout_marginTop="@dimen/grid_item_layout_marginTop">
-
- <!-- Main item thumbnail. Comprised of two overlapping images, the
- visibility of which is controlled by code in
- DirectoryFragment.java. -->
-
- <FrameLayout
- android:id="@+id/thumbnail"
- android:layout_width="@dimen/grid_item_thumbnail_width"
- android:layout_height="@dimen/grid_item_thumbnail_height"
- android:layout_centerHorizontal="true"
- android:background="@drawable/grid_thumbnail_background">
-
- <!-- stroke width will be controlled dynamically in the code. -->
- <com.google.android.material.card.MaterialCardView
- android:id="@+id/icon_wrapper"
- android:layout_width="@dimen/grid_item_icon_width"
- android:layout_height="@dimen/grid_item_icon_height"
+ android:paddingEnd="@dimen/grid_item_padding_end"
+ android:paddingStart="@dimen/grid_item_padding_start"
+ android:paddingTop="@dimen/grid_item_padding_top">
+
+<!-- Main item thumbnail. Comprised of two overlapping images, the
+ visibility of which is controlled by code in
+ DirectoryFragment.java. -->
+
+ <FrameLayout
+ android:id="@+id/thumbnail"
+ android:layout_width="@dimen/grid_item_thumbnail_width"
+ android:layout_height="@dimen/grid_item_thumbnail_height"
+ android:layout_centerHorizontal="true"
+ android:background="@drawable/grid_thumbnail_background">
+
+ <!-- stroke width will be controlled dynamically in the code. -->
+ <com.google.android.material.card.MaterialCardView
+ android:id="@+id/icon_wrapper"
+ android:layout_width="@dimen/grid_item_icon_width"
+ android:layout_height="@dimen/grid_item_icon_height"
+ android:layout_gravity="center"
+ app:cardBackgroundColor="?attr/colorSurfaceContainerLowest"
+ app:cardElevation="0dp"
+ app:strokeColor="?attr/colorSecondaryContainer"
+ app:strokeWidth="0dp">
+
+ <com.android.documentsui.GridItemThumbnail
+ android:id="@+id/icon_thumb"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:contentDescription="@null"
+ android:scaleType="centerCrop"
+ android:tint="?attr/gridItemTint"
+ android:tintMode="src_over" />
+
+ <com.android.documentsui.GridItemThumbnail
+ android:id="@+id/icon_mime_lg"
+ android:layout_width="@dimen/icon_size"
+ android:layout_height="@dimen/icon_size"
android:layout_gravity="center"
- app:cardBackgroundColor="?attr/colorSurfaceContainerLowest"
- app:cardElevation="0dp"
- app:strokeColor="?attr/colorSecondaryContainer"
- app:strokeWidth="0dp">
-
- <com.android.documentsui.GridItemThumbnail
- android:id="@+id/icon_thumb"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:contentDescription="@null"
- android:scaleType="centerCrop"
- android:tint="?attr/gridItemTint"
- android:tintMode="src_over" />
-
- <com.android.documentsui.GridItemThumbnail
- android:id="@+id/icon_mime_lg"
- android:layout_width="@dimen/icon_size"
- android:layout_height="@dimen/icon_size"
- android:layout_gravity="center"
- android:contentDescription="@null"
- android:scaleType="fitCenter" />
-
- </com.google.android.material.card.MaterialCardView>
-
- </FrameLayout>
-
- <FrameLayout
- android:id="@+id/preview_icon"
- android:layout_width="@dimen/button_touch_size"
- android:layout_height="@dimen/button_touch_size"
- android:layout_alignParentEnd="true"
- android:layout_alignParentTop="true"
- android:clickable="true"
- android:focusable="true"
- android:pointerIcon="hand">
+ android:contentDescription="@null"
+ android:scaleType="fitCenter" />
+
+ </com.google.android.material.card.MaterialCardView>
+
+ </FrameLayout>
+
+ <FrameLayout
+ android:id="@+id/preview_icon"
+ android:layout_width="@dimen/button_touch_size"
+ android:layout_height="@dimen/button_touch_size"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentTop="true"
+ android:clickable="true"
+ android:focusable="true"
+ android:pointerIcon="hand">
+
+ <ImageView
+ android:layout_width="@dimen/zoom_icon_size"
+ android:layout_height="@dimen/zoom_icon_size"
+ android:layout_gravity="center"
+ android:background="@drawable/circle_button_background"
+ android:padding="2dp"
+ android:scaleType="fitCenter"
+ android:src="@drawable/ic_zoom_out" />
+
+ </FrameLayout>
+
+ <!-- Item nameplate. Has some text fields (title, size, mod-time, etc). -->
+
+ <LinearLayout
+ android:id="@+id/nameplate"
+ android:layout_width="@dimen/grid_item_nameplate_width"
+ android:layout_height="@dimen/grid_item_nameplate_height"
+ android:layout_below="@id/thumbnail"
+ android:layout_marginTop="@dimen/grid_item_nameplate_marginTop"
+ android:background="@drawable/grid_nameplate_background"
+ android:orientation="vertical"
+ android:duplicateParentState="true"
+ android:padding="@dimen/grid_item_nameplate_padding">
+
+ <!-- Top row. -->
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="horizontal">
<ImageView
- android:layout_width="@dimen/zoom_icon_size"
- android:layout_height="@dimen/zoom_icon_size"
- android:layout_gravity="center"
- android:background="@drawable/circle_button_background"
- android:padding="2dp"
- android:scaleType="fitCenter"
- android:src="@drawable/ic_zoom_out" />
-
- </FrameLayout>
+ android:id="@+id/icon_profile_badge"
+ android:layout_width="@dimen/briefcase_icon_size"
+ android:layout_height="@dimen/briefcase_icon_size"
+ android:layout_marginEnd="@dimen/briefcase_icon_margin"
+ android:contentDescription="@string/a11y_work"
+ android:gravity="center_vertical"
+ android:src="@drawable/ic_briefcase"
+ android:tint="?android:attr/colorAccent" />
+
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAlignment="center"
+ android:textAppearance="@style/FileItemLabelText" />
- <!-- Item nameplate. Has some text fields (title, size, mod-time, etc). -->
+ </LinearLayout>
+ <!-- Bottom row. -->
<LinearLayout
- android:id="@+id/nameplate"
- android:layout_width="@dimen/grid_item_nameplate_width"
- android:layout_height="@dimen/grid_item_nameplate_height"
- android:layout_below="@id/thumbnail"
- android:layout_marginTop="@dimen/grid_item_nameplate_marginTop"
- android:background="@drawable/grid_nameplate_background"
- android:orientation="vertical"
- android:padding="@dimen/grid_item_nameplate_padding">
-
- <!-- Top row. -->
- <LinearLayout
- android:layout_width="match_parent"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/details"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/icon_profile_badge"
- android:layout_width="@dimen/briefcase_icon_size"
- android:layout_height="@dimen/briefcase_icon_size"
- android:layout_marginEnd="@dimen/briefcase_icon_margin"
- android:contentDescription="@string/a11y_work"
- android:gravity="center_vertical"
- android:src="@drawable/ic_briefcase"
- android:tint="?android:attr/colorAccent" />
-
- <TextView
- android:id="@android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:singleLine="true"
- android:textAlignment="center"
- android:textAppearance="@style/FileItemLabelText" />
-
- </LinearLayout>
-
- <!-- Bottom row. -->
- <LinearLayout
- android:layout_width="match_parent"
+ android:layout_marginEnd="4dp"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAlignment="viewStart"
+ android:textAppearance="@style/ItemCaptionText" />
+
+ <TextView
+ android:id="@+id/bullet"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="4dp"
+ android:singleLine="true"
+ android:text="@string/bullet"
+ android:textAlignment="viewStart"
+ android:textAppearance="@style/ItemCaptionText" />
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="horizontal">
-
- <TextView
- android:id="@+id/details"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="4dp"
- android:ellipsize="end"
- android:singleLine="true"
- android:textAlignment="viewStart"
- android:textAppearance="@style/ItemCaptionText" />
-
- <TextView
- android:id="@+id/bullet"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="4dp"
- android:singleLine="true"
- android:text="@string/bullet"
- android:textAlignment="viewStart"
- android:textAppearance="@style/ItemCaptionText" />
-
- <TextView
- android:id="@+id/date"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:singleLine="true"
- android:textAlignment="viewStart"
- android:textAppearance="@style/ItemCaptionText" />
-
- </LinearLayout>
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAlignment="viewStart"
+ android:textAppearance="@style/ItemCaptionText" />
</LinearLayout>
- </RelativeLayout>
+ </LinearLayout>
-</com.google.android.material.card.MaterialCardView>
+</RelativeLayout> \ No newline at end of file
diff --git a/res/flag(com.android.documentsui.flags.use_material3)/values/dimens.xml b/res/flag(com.android.documentsui.flags.use_material3)/values/dimens.xml
index 65740f15c..bd7e97028 100644
--- a/res/flag(com.android.documentsui.flags.use_material3)/values/dimens.xml
+++ b/res/flag(com.android.documentsui.flags.use_material3)/values/dimens.xml
@@ -68,9 +68,9 @@
<dimen name="drag_shadow_size">120dp</dimen>
<dimen name="grid_item_width">150dp</dimen>
<dimen name="grid_item_height">132dp</dimen>
- <dimen name="grid_item_layout_marginStart">@dimen/space_extra_small_2</dimen>
- <dimen name="grid_item_layout_marginEnd">@dimen/space_extra_small_2</dimen>
- <dimen name="grid_item_layout_marginTop">@dimen/space_extra_small_2</dimen>
+ <dimen name="grid_item_padding_start">@dimen/space_extra_small_2</dimen>
+ <dimen name="grid_item_padding_end">@dimen/space_extra_small_2</dimen>
+ <dimen name="grid_item_padding_top">@dimen/space_extra_small_2</dimen>
<dimen name="grid_item_thumbnail_width">80dp</dimen>
<dimen name="grid_item_thumbnail_height">80dp</dimen>
<dimen name="grid_item_thumbnail_radius">12dp</dimen>
@@ -82,6 +82,7 @@
<dimen name="grid_item_nameplate_padding">4dp</dimen>
<dimen name="grid_item_nameplate_marginTop">@dimen/space_extra_small_2</dimen>
<dimen name="grid_item_nameplate_radius">8dp</dimen>
+ <dimen name="grid_item_nameplate_inner_radius">4dp</dimen>
<dimen name="grid_item_elevation">2dp</dimen>
<dimen name="grid_item_radius">12dp</dimen>
<dimen name="max_drawer_width">280dp</dimen>