Skip to content

Commit 201501f

Browse files
committed
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
1 parent 71d7c3c commit 201501f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

api/current.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29564,6 +29564,7 @@ package android.widget {
2956429564
public class ViewAnimator extends android.widget.FrameLayout {
2956529565
ctor public ViewAnimator(android.content.Context);
2956629566
ctor public ViewAnimator(android.content.Context, android.util.AttributeSet);
29567+
method public boolean getAnimateFirstView();
2956729568
method public android.view.View getCurrentView();
2956829569
method public int getDisplayedChild();
2956929570
method public android.view.animation.Animation getInAnimation();

core/java/android/widget/ViewAnimator.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,22 @@ public void setOutAnimation(Context context, int resourceID) {
328328
setOutAnimation(AnimationUtils.loadAnimation(context, resourceID));
329329
}
330330

331+
/**
332+
* Returns whether the current View should be animated the first time the ViewAnimator
333+
* is displayed.
334+
*
335+
* @return true if the current View will be animated the first time it is displayed,
336+
* false otherwise.
337+
*
338+
* @see #setAnimateFirstView(boolean)
339+
*/
340+
public boolean getAnimateFirstView() {
341+
return mAnimateFirstTime;
342+
}
343+
331344
/**
332345
* Indicates whether the current View should be animated the first time
333-
* the ViewAnimation is displayed.
346+
* the ViewAnimator is displayed.
334347
*
335348
* @param animate True to animate the current View the first time it is displayed,
336349
* false otherwise.

0 commit comments

Comments
 (0)