Fix TalkBack page announcments in RecentsView
Because a PagedView has page a11y actions (PAGE_LEFT/RIGHT), a11y services now identify recents apps as a pager. Tweak the a11y event info to accomodate this so the announcements are correct. Also fix the CollectionItemInfo to have the correct page index. Bug: 141899192 Test: Tested with TalkBack on device Change-Id: Ic578bee8de26a41f0ab0e5468f1fd060ed21a7e1
This commit is contained in:
@@ -1673,8 +1673,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
|
||||
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED) {
|
||||
final int[] visibleTasks = getVisibleChildrenRange();
|
||||
event.setFromIndex(taskViewCount - visibleTasks[1] - 1);
|
||||
event.setToIndex(taskViewCount - visibleTasks[0] - 1);
|
||||
event.setFromIndex(taskViewCount - visibleTasks[1]);
|
||||
event.setToIndex(taskViewCount - visibleTasks[0]);
|
||||
event.setItemCount(taskViewCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,8 +728,8 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
final RecentsView recentsView = getRecentsView();
|
||||
final AccessibilityNodeInfo.CollectionItemInfo itemInfo =
|
||||
AccessibilityNodeInfo.CollectionItemInfo.obtain(
|
||||
0, 1, recentsView.getChildCount() - recentsView.indexOfChild(this) - 1, 1,
|
||||
false);
|
||||
0, 1, recentsView.getTaskViewCount() - recentsView.indexOfChild(this) - 1,
|
||||
1, false);
|
||||
info.setCollectionItemInfo(itemInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user