Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 930531f6 authored by Sebastian Franco's avatar Sebastian Franco
Browse files

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
parent 5ecc826e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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>
+4 −3
Original line number Diff line number Diff line
@@ -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();
            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);
            if (panelCount > 1) {
                // Increment the column if the target is on the right side of a two panel home
                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));
        }
    }

+5 −1
Original line number Diff line number Diff line
@@ -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) {