2022-06-13 14:38:43 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2022 The Android Open Source Project
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
2023-01-10 10:47:46 -06:00
|
|
|
package com.android.launcher3.celllayout;
|
2022-06-13 14:38:43 -07:00
|
|
|
|
|
|
|
|
import android.graphics.Point;
|
|
|
|
|
|
2023-11-17 16:26:21 -06:00
|
|
|
import com.android.launcher3.celllayout.board.CellLayoutBoard;
|
|
|
|
|
|
2022-06-13 14:38:43 -07:00
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
public class ReorderTestCase {
|
2022-12-08 11:08:00 -08:00
|
|
|
public List<CellLayoutBoard> mStart;
|
2022-06-13 14:38:43 -07:00
|
|
|
public Point moveMainTo;
|
2022-12-08 11:08:00 -08:00
|
|
|
public List<List<CellLayoutBoard>> mEnd;
|
2022-06-13 14:38:43 -07:00
|
|
|
|
2023-01-26 17:13:03 -08:00
|
|
|
public ReorderTestCase(List<CellLayoutBoard> start, Point moveMainTo,
|
|
|
|
|
List<CellLayoutBoard>... end) {
|
2022-06-13 14:38:43 -07:00
|
|
|
mStart = start;
|
|
|
|
|
this.moveMainTo = moveMainTo;
|
|
|
|
|
mEnd = Arrays.asList(end);
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-26 17:13:03 -08:00
|
|
|
public ReorderTestCase(String start, Point moveMainTo, String ... end) {
|
2022-12-08 11:08:00 -08:00
|
|
|
mStart = CellLayoutBoard.boardListFromString(start);
|
2022-06-13 14:38:43 -07:00
|
|
|
this.moveMainTo = moveMainTo;
|
|
|
|
|
mEnd = Arrays
|
|
|
|
|
.asList(end)
|
|
|
|
|
.stream()
|
2022-12-08 11:08:00 -08:00
|
|
|
.map(CellLayoutBoard::boardListFromString)
|
2022-06-13 14:38:43 -07:00
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
}
|