diff options
author | 2024-12-17 04:41:46 +0000 | |
---|---|---|
committer | 2024-12-17 04:54:31 +0000 | |
commit | 390e4cc4b326c61b3794d3e0547bafbaa5c800c2 (patch) | |
tree | 30e226145e65ab4659760aff653095db6d8599fc | |
parent | a7fc30a11222a035fc9f2448d08e471413380f79 (diff) |
[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
5 files changed, 11 insertions, 5 deletions
diff --git a/res/flag(com.android.documentsui.flags.use_material3)/layout/directory_app_bar.xml b/res/flag(com.android.documentsui.flags.use_material3)/layout/directory_app_bar.xml index 8aaaff83e..95b322454 100644 --- a/res/flag(com.android.documentsui.flags.use_material3)/layout/directory_app_bar.xml +++ b/res/flag(com.android.documentsui.flags.use_material3)/layout/directory_app_bar.xml @@ -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" diff --git a/res/flag(com.android.documentsui.flags.use_material3)/layout/fixed_layout.xml b/res/flag(com.android.documentsui.flags.use_material3)/layout/fixed_layout.xml index 40accb6af..0b03572ac 100644 --- a/res/flag(com.android.documentsui.flags.use_material3)/layout/fixed_layout.xml +++ b/res/flag(com.android.documentsui.flags.use_material3)/layout/fixed_layout.xml @@ -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" diff --git a/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml b/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml index 043e7bc02..e491d95a1 100644 --- a/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml +++ b/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml @@ -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"> diff --git a/src/com/android/documentsui/queries/SearchChipViewManager.java b/src/com/android/documentsui/queries/SearchChipViewManager.java index 193cccb3f..ad1dfc201 100644 --- a/src/com/android/documentsui/queries/SearchChipViewManager.java +++ b/src/com/android/documentsui/queries/SearchChipViewManager.java @@ -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; diff --git a/src/com/android/documentsui/sidebar/RootItem.java b/src/com/android/documentsui/sidebar/RootItem.java index 2a652e703..4b40d91b3 100644 --- a/src/com/android/documentsui/sidebar/RootItem.java +++ b/src/com/android/documentsui/sidebar/RootItem.java @@ -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) { |