summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/widget/ViewAnimator.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/widget/ViewAnimator.java b/core/java/android/widget/ViewAnimator.java
index 3c683d6b5330..71ff66b48fc9 100644
--- a/core/java/android/widget/ViewAnimator.java
+++ b/core/java/android/widget/ViewAnimator.java
@@ -185,6 +185,10 @@ public class ViewAnimator extends FrameLayout {
} else {
child.setVisibility(View.GONE);
}
+ if (index >= 0 && mWhichChild >= index) {
+ // Added item above current one, increment the index of the displayed child
+ setDisplayedChild(mWhichChild + 1);
+ }
}
@Override