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

Commit 2ceb3b50 authored by Sebastian Franco's avatar Sebastian Franco
Browse files

Adding screen ID parameter in CellLayoutLayoutParams

Bug: 188081026
Test: launcher compiles, this test doesn't change existing logic only the model
Change-Id: I7bcf6452d5ecb9b50914defc311ad06839220c92
parent c04120e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ public class HotseatEduDialog extends AbstractSlideInView<Launcher> implements I
            icon.setEnabled(false);
            icon.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
            icon.verifyHighRes();
            CellLayoutLayoutParams lp = new CellLayoutLayoutParams(i, 0, 1, 1);
            CellLayoutLayoutParams lp = new CellLayoutLayoutParams(i, 0, 1, 1, -1);
            mSampleHotseat.addViewToCellLayout(icon, i, info.getViewId(), lp, true);
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ public class CellLayout extends ViewGroup {
        mDragCell[0] = mDragCell[1] = -1;
        mDragCellSpan[0] = mDragCellSpan[1] = -1;
        for (int i = 0; i < mDragOutlines.length; i++) {
            mDragOutlines[i] = new CellLayoutLayoutParams(0, 0, 0, 0);
            mDragOutlines[i] = new CellLayoutLayoutParams(0, 0, 0, 0, -1);
        }
        mDragOutlinePaint.setColor(Themes.getAttrColor(context, R.attr.workspaceTextColor));

+1 −1
Original line number Diff line number Diff line
@@ -582,7 +582,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
        }

        int cellHSpan = mLauncher.getDeviceProfile().inv.numSearchContainerColumns;
        CellLayoutLayoutParams lp = new CellLayoutLayoutParams(0, 0, cellHSpan, 1);
        CellLayoutLayoutParams lp = new CellLayoutLayoutParams(0, 0, cellHSpan, 1, FIRST_SCREEN_ID);
        lp.canReorder = false;
        if (!firstPage.addViewToCellLayout(
                mFirstPagePinnedItem, 0, R.id.search_container_workspace, lp, true)) {
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ public interface WorkspaceLayoutManager {
        ViewGroup.LayoutParams genericLp = child.getLayoutParams();
        CellLayoutLayoutParams lp;
        if (genericLp == null || !(genericLp instanceof CellLayoutLayoutParams)) {
            lp = new CellLayoutLayoutParams(x, y, spanX, spanY);
            lp = new CellLayoutLayoutParams(x, y, spanX, spanY, screenId);
        } else {
            lp = (CellLayoutLayoutParams) genericLp;
            lp.cellX = x;
+10 −1
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@ import androidx.annotation.Nullable;
 * Represents the logic of where a view is in a CellLayout and its size
 */
public class CellLayoutLayoutParams extends ViewGroup.MarginLayoutParams {

    public int screenId = -1;

    /**
     * Horizontal location of the item in the grid.
     */
@@ -106,14 +109,20 @@ public class CellLayoutLayoutParams extends ViewGroup.MarginLayoutParams {
        this.cellY = source.cellY;
        this.cellHSpan = source.cellHSpan;
        this.cellVSpan = source.cellVSpan;
        this.screenId = source.screenId;
        this.tmpCellX = source.tmpCellX;
        this.tmpCellY = source.tmpCellY;
        this.useTmpCoords = source.useTmpCoords;
    }

    public CellLayoutLayoutParams(int cellX, int cellY, int cellHSpan, int cellVSpan) {
    public CellLayoutLayoutParams(int cellX, int cellY, int cellHSpan, int cellVSpan,
            int screenId) {
        super(CellLayoutLayoutParams.MATCH_PARENT, CellLayoutLayoutParams.MATCH_PARENT);
        this.cellX = cellX;
        this.cellY = cellY;
        this.cellHSpan = cellHSpan;
        this.cellVSpan = cellVSpan;
        this.screenId = screenId;
    }

    /**
Loading