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

Commit 9e2f80ef authored by Presubmit Automerger Backend's avatar Presubmit Automerger Backend
Browse files

[automerge] Fix incorrect accessibility announcement on two panel home 2p: 2dacbee0

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

Bug: 200009004
Change-Id: I80c2c625a76ae95e7987f345a80070d2b39c26d5
parents 3c93562d 2dacbee0
Loading
Loading
Loading
Loading
+17 −6
Original line number Original line Diff line number Diff line
@@ -1169,9 +1169,7 @@ public class CellLayout extends ViewGroup {
        // Apply local extracted color if the DragView is an AppWidgetHostViewDrawable.
        // Apply local extracted color if the DragView is an AppWidgetHostViewDrawable.
        View view = dragObject.dragView.getContentView();
        View view = dragObject.dragView.getContentView();
        if (view instanceof LauncherAppWidgetHostView) {
        if (view instanceof LauncherAppWidgetHostView) {
            Launcher launcher = Launcher.getLauncher(getContext());
            int screenId = getWorkspace().getIdForScreen(this);
            Workspace workspace = launcher.getWorkspace();
            int screenId = workspace.getIdForScreen(this);
            cellToRect(targetCell[0], targetCell[1], spanX, spanY, mTempRect);
            cellToRect(targetCell[0], targetCell[1], spanX, spanY, mTempRect);


            ((LauncherAppWidgetHostView) view).handleDrag(mTempRect, this, screenId);
            ((LauncherAppWidgetHostView) view).handleDrag(mTempRect, this, screenId);
@@ -1184,11 +1182,24 @@ public class CellLayout extends ViewGroup {
            return getContext().getString(R.string.move_to_hotseat_position,
            return getContext().getString(R.string.move_to_hotseat_position,
                    Math.max(cellX, cellY) + 1);
                    Math.max(cellX, cellY) + 1);
        } else {
        } else {
            return getContext().getString(R.string.move_to_empty_cell,
            Workspace workspace = getWorkspace();
                    cellY + 1, cellX + 1);
            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);
                col += (pageIndex % panelCount) * mCountX;
            }
            return getContext().getString(R.string.move_to_empty_cell, row, col);
        }
        }
    }
    }


    private Workspace getWorkspace() {
        return Launcher.cast(mActivity).getWorkspace();
    }

    public void clearDragOutlines() {
    public void clearDragOutlines() {
        final int oldIndex = mDragOutlineCurrent;
        final int oldIndex = mDragOutlineCurrent;
        mDragOutlineAnims[oldIndex].animateOut();
        mDragOutlineAnims[oldIndex].animateOut();
@@ -2243,7 +2254,7 @@ public class CellLayout extends ViewGroup {
    private void commitTempPlacement(View dragView) {
    private void commitTempPlacement(View dragView) {
        mTmpOccupied.copyTo(mOccupied);
        mTmpOccupied.copyTo(mOccupied);


        int screenId = Launcher.cast(mActivity).getWorkspace().getIdForScreen(this);
        int screenId = getWorkspace().getIdForScreen(this);
        int container = Favorites.CONTAINER_DESKTOP;
        int container = Favorites.CONTAINER_DESKTOP;


        if (mContainerType == HOTSEAT) {
        if (mContainerType == HOTSEAT) {
+4 −1
Original line number Original line Diff line number Diff line
@@ -3398,7 +3398,10 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
            // When the workspace is not loaded, we do not know how many screen will be bound.
            // When the workspace is not loaded, we do not know how many screen will be bound.
            return getContext().getString(R.string.home_screen);
            return getContext().getString(R.string.home_screen);
        }
        }
        return getContext().getString(R.string.workspace_scroll_format, page + 1, nScreens);
        int panelCount = getPanelCount();
        int currentPage = (page / panelCount) + 1;
        int totalPages = nScreens / panelCount + nScreens % panelCount;
        return getContext().getString(R.string.workspace_scroll_format, currentPage, totalPages);
    }
    }


    /**
    /**