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

Commit 3ed75906 authored by Wenbo Jie (介文博)'s avatar Wenbo Jie (介文博) Committed by Android (Google) Code Review
Browse files

Merge "[DocsUI M3] Fix talkback issue on the breadcrumb" into main

parents 8aae48f1 816cad3f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

<ripple
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:color="@color/breadcrumb_item_ripple_color">
    <item
        android:id="@android:id/mask"
@@ -24,6 +23,9 @@

    <item>
        <selector>
            <item android:state_enabled="false">
                <color android:color="@android:color/transparent"/>
            </item>
            <item android:state_pressed="true">
                <shape android:tint="?attr/colorOnSurfaceVariant">
                    <corners android:radius="@dimen/breadcrumb_item_height_m3" />
+11 −2
Original line number Diff line number Diff line
@@ -21,14 +21,23 @@
    android:layout_height="wrap_content"
    android:minHeight="@dimen/breadcrumb_height"
    android:gravity="center_vertical"
    android:focusable="true"
    android:clickable="true"
    android:defaultFocusHighlightEnabled="false"
    android:orientation="horizontal">

    <!-- We can't put clickable/focusable on the TextView below even though we only want the
         highlight/focus ring on the TextView instead of the whole item, this is because there is a
         specific logic in HorizontalBreadcrumb when binding click event, the event is bound
         on the whole item directly and there are special a11y handling (check the
         `setAccessibilityDelegateCompat` call). Given we don't want the focus background on
         the item, we also need defaultFocusHighlightEnabled above and duplicateParentState
         below.  -->
    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/breadcrumb_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:clickable="true"
        android:duplicateParentState="true"
        android:maxWidth="275dp"
        android:gravity="center_vertical"
        android:maxLines="1"
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ public final class HorizontalBreadcrumb extends RecyclerView implements Breadcru
                    isFirst ? mEnv.getCurrentRoot().title : mState.stack.get(position).displayName);
            if (isUseMaterial3FlagEnabled()) {
                // The last path part in the breadcrumb is not clickable.
                holder.mTitle.setEnabled(!isLast);
                holder.itemView.setEnabled(!isLast);
            } else {
                holder.mTitle.setEnabled(isLast);
            }