mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Add two panel home support for page binding logic
There's a logic which prioritizes the binding for the current page and defers the other pages' binding. If two panel home is enabled, we want to bind both pages together. LauncherPageRestoreHelper has been created to contain the logic for persisting restoring and calculating which pages to load immediately. Test: manual + run LauncherPageRestoreHelperTest robo test Bug: 174464691 Change-Id: I57ac3f7150303b95b272e922f44bda26f9d5ce2a
This commit is contained in:
@@ -17,13 +17,14 @@
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* Copy of the platform hidden implementation of android.util.IntArray.
|
||||
* Implements a growing array of int primitives.
|
||||
*/
|
||||
public class IntArray implements Cloneable {
|
||||
public class IntArray implements Cloneable, Iterable<Integer> {
|
||||
private static final int MIN_CAPACITY_INCREMENT = 12;
|
||||
|
||||
private static final int[] EMPTY_INT = new int[0];
|
||||
@@ -272,4 +273,30 @@ public class IntArray implements Cloneable {
|
||||
throw new ArrayIndexOutOfBoundsException("length=" + len + "; index=" + index);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Integer> iterator() {
|
||||
return new ValueIterator();
|
||||
}
|
||||
|
||||
@Thunk
|
||||
class ValueIterator implements Iterator<Integer> {
|
||||
|
||||
private int mNextIndex = 0;
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return mNextIndex < size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer next() {
|
||||
return get(mNextIndex++);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user