Fix Talkback Announcement for Workspace Pages
Bug: 379649357 Test: Verified manually that the fixes work for announcements. Flag: EXEMPT bug fix Change-Id: I0a2e989eb34adbd975a7211d8334d264d64b3933
This commit is contained in:
@@ -3554,7 +3554,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
int nScreens = getChildCount();
|
||||
int extraScreenId = mScreenOrder.indexOf(EXTRA_EMPTY_SCREEN_ID);
|
||||
if (extraScreenId >= 0 && nScreens > 1) {
|
||||
if (page == extraScreenId) {
|
||||
if (page == extraScreenId || (isTwoPanelEnabled() && page == extraScreenId + 1)) {
|
||||
return getContext().getString(R.string.workspace_new_page);
|
||||
}
|
||||
nScreens--;
|
||||
@@ -3566,6 +3566,11 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
int panelCount = getPanelCount();
|
||||
int currentPage = (page / panelCount) + 1;
|
||||
int totalPages = nScreens / panelCount + nScreens % panelCount;
|
||||
|
||||
// When dragging, a blank screen is added. This increases the total page count, but we still
|
||||
// want to describe the original page count where icons are currently pinned
|
||||
if (extraScreenId > 0) totalPages--;
|
||||
|
||||
return getContext().getString(R.string.workspace_scroll_format, currentPage, totalPages);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user