Skip to content

Commit 7351060

Browse files
committed
Fix Stream toList crash in ReorderAlgorithm
Signed-off-by: saulhdev <saul_henriquez@hotmail.com>
1 parent ae36086 commit 7351060

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/com/android/launcher3/celllayout/ReorderAlgorithm.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.android.launcher3.util.GridOccupancy;
2424

2525
import java.util.ArrayList;
26+
import java.util.Collections;
2627
import java.util.Comparator;
2728
import java.util.List;
2829
import java.util.Map.Entry;
@@ -148,7 +149,8 @@ private boolean rearrangementExists(int cellX, int cellY, int spanX, int spanY,
148149
).thenComparing(
149150
view -> ((CellLayoutLayoutParams) ((View) view).getLayoutParams()).getCellY()
150151
);
151-
List<View> views = solution.map.keySet().stream().sorted(comparator).toList();
152+
List<View> views = new ArrayList<>(solution.map.keySet());
153+
Collections.sort(views, comparator);
152154
for (View child : views) {
153155
if (child == ignoreView) continue;
154156
CellAndSpan c = solution.map.get(child);

0 commit comments

Comments
 (0)