Merge "Make Talkback anounce which page is the icon being move on." into tm-qpr-dev am: 578fbee848

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18918709

Change-Id: I0acc9016753aac24d36ed496f9b53220fe76a01c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sebastián Franco
2022-06-24 04:59:00 +00:00
committed by Automerger Merge Worker
3 changed files with 10 additions and 5 deletions

View File

@@ -344,7 +344,7 @@
<string name="action_move">Move item</string>
<!-- Accessibility description to move item to empty cell. -->
<string name="move_to_empty_cell">Move to row <xliff:g id="number" example="1">%1$s</xliff:g> column <xliff:g id="number" example="1">%2$s</xliff:g></string>
<string name="move_to_empty_cell_description">Move to row <xliff:g id="number" example="1">%1$s</xliff:g> column <xliff:g id="number" example="1">%2$s</xliff:g> in <xliff:g id="string" example="Home screen 2 of 4">%3$s</xliff:g></string>
<!-- Accessibility description to move item inside a folder. -->
<string name="move_to_position">Move to position <xliff:g id="number" example="1">%1$s</xliff:g></string>

View File

@@ -1202,13 +1202,14 @@ public class CellLayout extends ViewGroup {
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));
}
}

View File

@@ -3418,7 +3418,11 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
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) {