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

Commit d30100ea authored by Sebastian Franco's avatar Sebastian Franco
Browse files

Move classes inside of CellLayoutBoard to their own file

Previous step for adding unit testing for MultipageCellLayout.

Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED
Bug: 270395274
Test: ReorderAlgorithmUnitTest
Change-Id: Ia5ca0b10481d7a21883594434b3406fb3a5ccf0b
parent 9739ad2e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ filegroup {
filegroup {
    name: "launcher-image-tests-src",
    srcs: [
      "src/com/android/launcher3/celllayout/TestWorkspaceBuilder.java",
      "src/com/android/launcher3/celllayout/CellLayoutBoard.java",
      "src/com/android/launcher3/celllayout/board/*.java",
      "src/com/android/launcher3/celllayout/board/*.kt",
      "src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java",
      "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
      "src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.view.View;

import com.android.launcher3.CellLayout;
import com.android.launcher3.Launcher;
import com.android.launcher3.celllayout.board.CellLayoutBoard;
import com.android.launcher3.views.DoubleShadowBubbleTextView;

import java.util.ArrayList;
+6 −3
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ import androidx.test.filters.SmallTest;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.celllayout.board.CellLayoutBoard;
import com.android.launcher3.celllayout.board.IconPoint;
import com.android.launcher3.celllayout.board.WidgetRect;
import com.android.launcher3.util.ActivityContextWrapper;
import com.android.launcher3.views.DoubleShadowBubbleTextView;

@@ -112,12 +115,12 @@ public class ReorderAlgorithmUnitTest {
        // The views have to be sorted or the result can vary
        board.getIcons()
                .stream()
                .map(CellLayoutBoard.IconPoint::getCoord)
                .map(IconPoint::getCoord)
                .sorted(Comparator.comparing(p -> ((Point) p).x).thenComparing(p -> ((Point) p).y))
                .forEach(p -> addViewInCellLayout(cl, p.x, p.y, 1, 1, false));
        board.getWidgets().stream()
                .sorted(Comparator.comparing(CellLayoutBoard.WidgetRect::getCellX)
                        .thenComparing(CellLayoutBoard.WidgetRect::getCellY))
                .sorted(Comparator.comparing(WidgetRect::getCellX)
                        .thenComparing(WidgetRect::getCellY))
                .forEach(widget -> addViewInCellLayout(cl, widget.getCellX(), widget.getCellY(),
                        widget.getSpanX(), widget.getSpanY(), true));

+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.launcher3.celllayout;

import com.android.launcher3.celllayout.board.CellLayoutBoard;

import java.util.Iterator;

/**
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package com.android.launcher3.celllayout;

import android.graphics.Point;

import com.android.launcher3.celllayout.board.CellLayoutBoard;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
Loading