Make Talkback anounce which page is the icon being move on.
Adding a third argument for the talkback string.
Fix: 230593493
Test: Move an item using Talkback and it should mention the row,
column and page where you can drop the item.
Change-Id: Id3d4435e9ef3348278643e6e2a1cd1e8bf5157b7
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 300e7bf..52dfcd4 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -1202,13 +1202,14 @@
int row = cellY + 1;
int col = workspace.mIsRtl ? mCountX - cellX : cellX + 1;
int panelCount = workspace.getPanelCount();
+ int screenId = workspace.getIdForScreen(this);
+ int pageIndex = workspace.getPageIndexForScreenId(screenId);
if (panelCount > 1) {
// Increment the column if the target is on the right side of a two panel home
- int screenId = workspace.getIdForScreen(this);
- int pageIndex = workspace.getPageIndexForScreenId(screenId);
col += (pageIndex % panelCount) * mCountX;
}
- return getContext().getString(R.string.move_to_empty_cell, row, col);
+ return getContext().getString(R.string.move_to_empty_cell_description, row, col,
+ workspace.getPageDescription(pageIndex));
}
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 4903d77..c482ed5 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -3418,7 +3418,11 @@
return getPageDescription(page);
}
- private String getPageDescription(int page) {
+ /**
+ * @param page page index.
+ * @return Description of the page at the given page index.
+ */
+ public String getPageDescription(int page) {
int nScreens = getChildCount();
int extraScreenId = mScreenOrder.indexOf(EXTRA_EMPTY_SCREEN_ID);
if (extraScreenId >= 0 && nScreens > 1) {