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

Commit 15c84c2f authored by Wenbo Jie's avatar Wenbo Jie
Browse files

[DocsUI M3] Fix breadcrumb display issue with large display size

* Use wrap_content instead of hard-coded height for breadcrumb
  item to make it show full text even in large display size.
* Make breadcrumb row itself not focusable to prevent the
  unnecessary grey background.

Check the attached bug for the demo.

Bug: 414262009
Test: m DocumentsUIGoogle && manual inspection
Flag: com.android.documentsui.flags.use_material3
Change-Id: I6b4161f817bf1eb5644304611583292ca80b4bf3
parent 67b1a972
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/breadcrumb_text"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/breadcrumb_item_height"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:clickable="true"
        android:maxWidth="275dp"
+7 −0
Original line number Diff line number Diff line
@@ -87,6 +87,13 @@ public final class HorizontalBreadcrumb extends RecyclerView implements Breadcru

        setLayoutManager(mLayoutManager);
        addOnItemTouchListener(new ClickListener(getContext(), this::onSingleTapUp));

        // When use_material3 flag is ON, the item is focusable but the whole row is not focusable.
        if (isUseMaterial3FlagEnabled()) {
            // Noe: setting this in the XML file via "android:focusable=false") somehow doesn't
            // work, i.e. the breadcrumb bar is still focusable, hence forcing it here in the code.
            setFocusable(false);
        }
    }

    @Override