resolved conflicts w/0ede734d0780a968c9c345f99a18f9f8b9fc02cd
Change-Id: I50900698a590e8d84a6cbcc560f95209d3a6d110
This commit is contained in:
@@ -43,6 +43,7 @@ import android.os.IBinder;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.view.Display;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -224,6 +225,9 @@ public class Workspace extends SmoothPagedView
|
||||
private int mLastReorderX = -1;
|
||||
private int mLastReorderY = -1;
|
||||
|
||||
private SparseArray<Parcelable> mSavedStates;
|
||||
private final ArrayList<Integer> mRestoredPages = new ArrayList<Integer>();
|
||||
|
||||
// These variables are used for storing the initial and final values during workspace animations
|
||||
private int mSavedScrollX;
|
||||
private float mSavedRotationY;
|
||||
@@ -3419,6 +3423,32 @@ public class Workspace extends SmoothPagedView
|
||||
Launcher.setScreen(mCurrentPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
|
||||
// We don't dispatch restoreInstanceState to our children using this code path.
|
||||
// Some pages will be restored immediately as their items are bound immediately, and
|
||||
// others we will need to wait until after their items are bound.
|
||||
mSavedStates = container;
|
||||
}
|
||||
|
||||
public void restoreInstanceStateForChild(int child) {
|
||||
if (mSavedStates != null) {
|
||||
mRestoredPages.add(child);
|
||||
CellLayout cl = (CellLayout) getChildAt(child);
|
||||
cl.restoreInstanceState(mSavedStates);
|
||||
}
|
||||
}
|
||||
|
||||
public void restoreInstanceStateForRemainingPages() {
|
||||
int count = getChildCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (!mRestoredPages.contains(i)) {
|
||||
restoreInstanceStateForChild(i);
|
||||
}
|
||||
}
|
||||
mRestoredPages.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollLeft() {
|
||||
if (!isSmall() && !mIsSwitchingState) {
|
||||
|
||||
Reference in New Issue
Block a user