From 201501f11e2934f63f9692383ade0620c45febae Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 30 Aug 2012 09:51:08 -0700 Subject: [PATCH] Add getter for animateFirstView property of ViewAnimator Tooling for xml properties is easier/better if we can properly reflect the xml properties at the Java language API level as well. We had setters/getters for the other properties of ViewAnimator, but only a setter for the animateFirstView property. Issue #6104327 Inconsistency between XML API and Java API for widgets - ViewAnimator Change-Id: Iede7231fa433ce14f7a8299da4cedd4720370bc8 --- api/current.txt | 1 + core/java/android/widget/ViewAnimator.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index b435ad0b294c7..d05016ff73d18 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29564,6 +29564,7 @@ package android.widget { public class ViewAnimator extends android.widget.FrameLayout { ctor public ViewAnimator(android.content.Context); ctor public ViewAnimator(android.content.Context, android.util.AttributeSet); + method public boolean getAnimateFirstView(); method public android.view.View getCurrentView(); method public int getDisplayedChild(); method public android.view.animation.Animation getInAnimation(); diff --git a/core/java/android/widget/ViewAnimator.java b/core/java/android/widget/ViewAnimator.java index 6a68240c6ddd6..eee914eb4d36b 100644 --- a/core/java/android/widget/ViewAnimator.java +++ b/core/java/android/widget/ViewAnimator.java @@ -328,9 +328,22 @@ public class ViewAnimator extends FrameLayout { setOutAnimation(AnimationUtils.loadAnimation(context, resourceID)); } + /** + * Returns whether the current View should be animated the first time the ViewAnimator + * is displayed. + * + * @return true if the current View will be animated the first time it is displayed, + * false otherwise. + * + * @see #setAnimateFirstView(boolean) + */ + public boolean getAnimateFirstView() { + return mAnimateFirstTime; + } + /** * Indicates whether the current View should be animated the first time - * the ViewAnimation is displayed. + * the ViewAnimator is displayed. * * @param animate True to animate the current View the first time it is displayed, * false otherwise.