Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d057c7ad authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[DocsUI M3] Uplift focus state for grid items" into main

parents 5e1b2def 2ce2b0d7
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -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
+140 −149
Original line number Diff line number Diff line
@@ -14,26 +14,18 @@
     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">
    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
@@ -109,6 +101,7 @@
        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. -->
@@ -180,5 +173,3 @@
    </LinearLayout>

</RelativeLayout>
 No newline at end of file

</com.google.android.material.card.MaterialCardView>
+4 −3
Original line number Diff line number Diff line
@@ -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>