Skip to content

Commit ee52adb

Browse files
leticiarossidsn5ft
authored andcommitted
[TopAppBar][a11y] Remove special key shortcut and keyboard navigation cluster for top app bar for correct keyboard navigation a11y.
PiperOrigin-RevId: 816305551
1 parent 3d8d23d commit ee52adb

File tree

1 file changed

+6
-2
lines changed
  • lib/java/com/google/android/material/appbar/res/values

1 file changed

+6
-2
lines changed

lib/java/com/google/android/material/appbar/res/values/styles.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@
126126
<item name="titleTextAppearance">@macro/m3_comp_app_bar_small_title_font</item>
127127
<item name="subtitleTextAppearance">?attr/textAppearanceTitleMedium</item>
128128
<item name="contentInsetStartWithNavigation">0dp</item>
129+
<item name="android:keyboardNavigationCluster" tools:targetApi="o">false</item>
130+
<item name="android:touchscreenBlocksFocus">false</item>
129131

130132
<!-- On newer API levels, hide shadows while keeping elevation. -->
131133
<item name="android:outlineAmbientShadowColor" tools:targetApi="p">@android:color/transparent</item>
@@ -206,8 +208,8 @@
206208
<style name="Widget.Design.AppBarLayout" parent="android:Widget">
207209
<item name="android:background">?attr/colorPrimary</item>
208210
<item name="android:stateListAnimator">@animator/design_appbar_state_list_animator</item>
209-
<item name="android:keyboardNavigationCluster" tools:targetApi="o">true</item>
210-
<item name="android:touchscreenBlocksFocus">true</item>
211+
<item name="android:keyboardNavigationCluster" tools:targetApi="o">false</item>
212+
<item name="android:touchscreenBlocksFocus">false</item>
211213
</style>
212214

213215
<style name="Widget.MaterialComponents.AppBarLayout.Primary" parent="Widget.Design.AppBarLayout"/>
@@ -239,6 +241,8 @@
239241
<!-- Overrides minimum height in landscape to avoid headline6 and subtitle1 height concerns. -->
240242
<item name="android:minHeight">@dimen/mtrl_toolbar_default_height</item>
241243
<item name="maxButtonHeight">@dimen/mtrl_toolbar_default_height</item>
244+
<item name="android:keyboardNavigationCluster" tools:targetApi="o">false</item>
245+
<item name="android:touchscreenBlocksFocus">false</item>
242246
</style>
243247

244248
<style name="Widget.MaterialComponents.Toolbar.Primary">

0 commit comments

Comments
 (0)