• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.launcher3.celllayout;
17 
18 import android.graphics.Point;
19 
20 import java.util.Arrays;
21 import java.util.List;
22 import java.util.stream.Collectors;
23 
24 public class ReorderTestCase {
25     public List<CellLayoutBoard> mStart;
26     public Point moveMainTo;
27     public List<List<CellLayoutBoard>> mEnd;
28 
ReorderTestCase(List<CellLayoutBoard> start, Point moveMainTo, List<CellLayoutBoard>... end)29     public ReorderTestCase(List<CellLayoutBoard> start, Point moveMainTo,
30             List<CellLayoutBoard>... end) {
31         mStart = start;
32         this.moveMainTo = moveMainTo;
33         mEnd = Arrays.asList(end);
34     }
35 
ReorderTestCase(String start, Point moveMainTo, String ... end)36     public ReorderTestCase(String start, Point moveMainTo, String ... end) {
37         mStart = CellLayoutBoard.boardListFromString(start);
38         this.moveMainTo = moveMainTo;
39         mEnd = Arrays
40                 .asList(end)
41                 .stream()
42                 .map(CellLayoutBoard::boardListFromString)
43                 .collect(Collectors.toList());
44     }
45 }
46