From d05a94888c1f29186a8573db17b2a84b052572d6 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Sat, 23 Nov 2024 00:37:01 +0000 Subject: [PATCH] [a11y] Fix talkback column and item count for AllAppsGrid The new ItemCount API in Baklava is for AccessibilityNodeInfo, for total items in grid. Since in AllApps grid we override and use AccessbiilityNodeInfoForItem for the specific app within the column, we should instead fix the column count override with the proper column counts. Bug: b/228935017 Flag: EXEMPT a11y bug fix Test: Manual; Before: https://recall.googleplex.com/clips/24b23bab-add8-4c13-a203-9f92144537a3 Test: Manual; After: https://recall.googleplex.com/clips/d9190fb5-c912-4dc9-8a09-868a1a1fd500 Test: Manual; Changing grid: http://recall/clips/2d513dc2-ffee-4680-95a0-ba263155d194 Change-Id: Id4a22fdbd258bca8102c16502629ea51971b139d --- src/com/android/launcher3/allapps/AllAppsGridAdapter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index df383bf9f6..b6ba2644fd 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -124,6 +124,12 @@ public class AllAppsGridAdapter extends getRowsNotForAccessibility(mApps.getAdapterItems().size() - 1); } + @Override + public int getColumnCountForAccessibility(RecyclerView.Recycler recycler, + RecyclerView.State state) { + return mAppsPerRow; + } + @Override public void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler, RecyclerView.State state, View host, AccessibilityNodeInfoCompat info) {