|
@@ -1141,10 +1141,8 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|
|
for (int i=0; i<getChildCount(); i++) {
|
|
|
View child = getChildAt(i);
|
|
|
ii = infoForChild(child);
|
|
|
- if (ii != null && ii.position == mCurItem) {
|
|
|
- if (child.requestFocus(focusDirection)) {
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (ii != null && ii.position == mCurItem && child.requestFocus(focusDirection)) {
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1264,24 +1262,6 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|
|
private Parcelable adapterState;
|
|
|
private ClassLoader loader;
|
|
|
|
|
|
- public SavedState(Parcelable superState) {
|
|
|
- super(superState);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void writeToParcel(Parcel out, int flags) {
|
|
|
- super.writeToParcel(out, flags);
|
|
|
- out.writeInt(position);
|
|
|
- out.writeParcelable(adapterState, flags);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public String toString() {
|
|
|
- return "FragmentPager.SavedState{"
|
|
|
- + Integer.toHexString(System.identityHashCode(this))
|
|
|
- + " position=" + position + "}";
|
|
|
- }
|
|
|
-
|
|
|
public static final Parcelable.Creator<SavedState> CREATOR
|
|
|
= ParcelableCompat.newCreator(new ParcelableCompatCreatorCallbacks<SavedState>() {
|
|
|
@Override
|
|
@@ -1294,6 +1274,10 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ public SavedState(Parcelable superState) {
|
|
|
+ super(superState);
|
|
|
+ }
|
|
|
+
|
|
|
SavedState(Parcel in, ClassLoader loader) {
|
|
|
super(in);
|
|
|
if (loader == null) {
|
|
@@ -1303,6 +1287,21 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|
|
adapterState = in.readParcelable(loader);
|
|
|
this.loader = loader;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void writeToParcel(Parcel out, int flags) {
|
|
|
+ super.writeToParcel(out, flags);
|
|
|
+ out.writeInt(position);
|
|
|
+ out.writeParcelable(adapterState, flags);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String toString() {
|
|
|
+ return "FragmentPager.SavedState{"
|
|
|
+ + Integer.toHexString(System.identityHashCode(this))
|
|
|
+ + " position=" + position + "}";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1956,11 +1955,9 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|
|
if (DEBUG) Log.v(TAG, "Starting unable to drag!");
|
|
|
mIsUnableToDrag = true;
|
|
|
}
|
|
|
- if (mIsBeingDragged) {
|
|
|
- // Scroll to follow the motion event
|
|
|
- if (performDrag(y)) {
|
|
|
- ViewCompat.postInvalidateOnAnimation(this);
|
|
|
- }
|
|
|
+ // Scroll to follow the motion event
|
|
|
+ if (mIsBeingDragged && performDrag(y)) {
|
|
|
+ ViewCompat.postInvalidateOnAnimation(this);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -2811,10 +2808,8 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|
|
View child = getChildAt(i);
|
|
|
if (child.getVisibility() == VISIBLE) {
|
|
|
ItemInfo ii = infoForChild(child);
|
|
|
- if (ii != null && ii.position == mCurItem) {
|
|
|
- if (child.requestFocus(direction, previouslyFocusedRect)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ if (ii != null && ii.position == mCurItem && child.requestFocus(direction, previouslyFocusedRect)) {
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
}
|