Merge changes from topic "viewpager_state" into oc-dev
* changes: [automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831am:fece305de0am:cb362192e8am:bc42f76941am:c42091667cam:aebf5c06dfam:d04ccc6608am:b3e984c412[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831am:fece305de0am:cb362192e8am:bc42f76941am:c42091667cam:aebf5c06dfam:d04ccc6608[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831am:fece305de0am:cb362192e8am:bc42f76941am:c42091667cam:aebf5c06df[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831am:fece305de0am:cb362192e8am:bc42f76941am:c42091667c[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831am:fece305de0am:cb362192e8am:bc42f76941[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831am:fece305de0am:cb362192e8[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831am:fece305de0[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1am:4c24e4d831[automerger] Update internal ViewPager's SavedState to match Support Library version am:187964aca1Update internal ViewPager's SavedState to match Support Library version
This commit is contained in:
committed by
Android (Google) Code Review
commit
77edd5fabe
@@ -31,6 +31,7 @@ import android.os.Parcelable;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.MathUtils;
|
import android.util.MathUtils;
|
||||||
|
import android.view.AbsSavedState;
|
||||||
import android.view.FocusFinder;
|
import android.view.FocusFinder;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@@ -1198,15 +1199,11 @@ public class ViewPager extends ViewGroup {
|
|||||||
* state, in which case it should implement a subclass of this which
|
* state, in which case it should implement a subclass of this which
|
||||||
* contains that state.
|
* contains that state.
|
||||||
*/
|
*/
|
||||||
public static class SavedState extends BaseSavedState {
|
public static class SavedState extends AbsSavedState {
|
||||||
int position;
|
int position;
|
||||||
Parcelable adapterState;
|
Parcelable adapterState;
|
||||||
ClassLoader loader;
|
ClassLoader loader;
|
||||||
|
|
||||||
public SavedState(Parcel source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SavedState(Parcelable superState) {
|
public SavedState(Parcelable superState) {
|
||||||
super(superState);
|
super(superState);
|
||||||
}
|
}
|
||||||
@@ -1225,10 +1222,15 @@ public class ViewPager extends ViewGroup {
|
|||||||
+ " position=" + position + "}";
|
+ " position=" + position + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {
|
public static final Creator<SavedState> CREATOR = new ClassLoaderCreator<SavedState>() {
|
||||||
|
@Override
|
||||||
|
public SavedState createFromParcel(Parcel in, ClassLoader loader) {
|
||||||
|
return new SavedState(in, loader);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SavedState createFromParcel(Parcel in) {
|
public SavedState createFromParcel(Parcel in) {
|
||||||
return new SavedState(in);
|
return new SavedState(in, null);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public SavedState[] newArray(int size) {
|
public SavedState[] newArray(int size) {
|
||||||
@@ -1237,7 +1239,7 @@ public class ViewPager extends ViewGroup {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SavedState(Parcel in, ClassLoader loader) {
|
SavedState(Parcel in, ClassLoader loader) {
|
||||||
super(in);
|
super(in, loader);
|
||||||
if (loader == null) {
|
if (loader == null) {
|
||||||
loader = getClass().getClassLoader();
|
loader = getClass().getClassLoader();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user