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

This commit is contained in:
Sebastián Franco
2022-06-24 04:54:31 +00:00
committed by Android (Google) Code Review
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) {