[automerger] DO NOT MERGE Fix build with SDK 24-like implementation of constructor am: f3c2e0b3ab am: 1b6f3f9a97 am: d0fcb49352
Change-Id: Ib890ce7495c1d5e64968cc9177ce3785bcfdedde
This commit is contained in:
@@ -1255,7 +1255,7 @@ public class ViewPager extends ViewGroup {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SavedState(Parcel in, ClassLoader loader) {
|
SavedState(Parcel in, ClassLoader loader) {
|
||||||
super(in, loader);
|
super(loadParcelable(in, loader));
|
||||||
if (loader == null) {
|
if (loader == null) {
|
||||||
loader = getClass().getClassLoader();
|
loader = getClass().getClassLoader();
|
||||||
}
|
}
|
||||||
@@ -1263,6 +1263,16 @@ public class ViewPager extends ViewGroup {
|
|||||||
adapterState = in.readParcelable(loader);
|
adapterState = in.readParcelable(loader);
|
||||||
this.loader = loader;
|
this.loader = loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Substitute for AbsSavedState two-arg constructor, which was added in
|
||||||
|
* SDK 24. Loads the super state from a given class loader or returns
|
||||||
|
* the empty state if null.
|
||||||
|
*/
|
||||||
|
private static Parcelable loadParcelable(Parcel in, ClassLoader loader) {
|
||||||
|
Parcelable superState = in.readParcelable(loader);
|
||||||
|
return superState != null ? superState : AbsSavedState.EMPTY_STATE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user