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

Commit 390e4cc4 authored by Wenbo Jie's avatar Wenbo Jie
Browse files

[DocsUI M3] Update font and support focus for app bar

* update font for toolbar title
* add "touchscreenBlocksFocus=false" to make toolbar support
  tab focus
* add TODO for all customized focus ring implementation

Bug: 384583898
Test: Manual inpsection
Flag: com.android.documentsui.flags.use_material3
Change-Id: I504a340a48079909769295984965a08f91b6ad72
parent a7fc30a1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:attr/colorBackground">
    android:touchscreenBlocksFocus="false">

    <com.google.android.material.appbar.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar"
@@ -41,7 +41,8 @@
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin">
            app:layout_collapseMode="pin"
            android:touchscreenBlocksFocus="false">

            <TextView
                android:id="@+id/searchbar_title"
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
     floating action buttons) to operate correctly. -->
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/coordinator_layout"
@@ -59,7 +58,8 @@
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:layout_marginTop="@dimen/action_bar_margin">
                    android:layout_marginTop="@dimen/action_bar_margin"
                    android:touchscreenBlocksFocus="false">

                    <TextView
                        android:id="@+id/searchbar_title"
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
        <item name="contentInsetStart">@dimen/toolbar_content_inset_start</item>
        <item name="contentInsetStartWithNavigation">@dimen/toolbar_content_inset_start</item>
        <item name="titleMarginStart">@dimen/search_bar_text_margin_start</item>
        <item name="titleTextAppearance">@style/ToolbarTitle</item>
    </style>

    <style name="ActionModeStyle" parent="Widget.AppCompat.ActionMode">
+1 −0
Original line number Diff line number Diff line
@@ -377,6 +377,7 @@ public class SearchChipViewManager {

    /**
     * When the chip is focused, adding a focus ring indicator using Stroke.
     * TODO(b/381957932): Remove this once Material Chip supports focus ring.
     */
    private void onChipFocusChange(View v, boolean hasFocus) {
        Chip chip = (Chip) v;
+4 −1
Original line number Diff line number Diff line
@@ -137,7 +137,10 @@ public class RootItem extends Item {
        RootsFragment.ejectClicked(view, root, mActionHandler);
    }

    /** When the action icon is focused, adding a focus ring indicator using Stroke. */
    /**
     * When the action icon is focused, adding a focus ring indicator using Stroke.
     * TODO(b/381957932): Remove this once Material Button supports focus ring.
     */
    protected void onActionIconFocusChange(View view, boolean hasFocus) {
        MaterialButton actionIcon = (MaterialButton) view;
        if (hasFocus) {