Add the ability to autoStart AID from xml
am: 1dd88daf92
Change-Id: I01fc7e34b4e2909f6984b9266e237f3cc9f08432
This commit is contained in:
@@ -5968,6 +5968,9 @@
|
||||
in the encoded data. Setting this to infinite (-1) will result in the
|
||||
animation repeating as long as it is displayed (once start() is called). -->
|
||||
<attr name="repeatCount"/>
|
||||
<!-- When true, automatically start animating. The default is false, meaning
|
||||
that the animation will not start until start() is called. -->
|
||||
<attr name="autoStart" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- Drawable used to draw bitmaps. -->
|
||||
|
||||
@@ -261,6 +261,12 @@ public class AnimatedImageDrawable extends Drawable implements Animatable2 {
|
||||
if (repeatCount != REPEAT_UNDEFINED) {
|
||||
this.setRepeatCount(repeatCount);
|
||||
}
|
||||
|
||||
boolean autoStart = a.getBoolean(
|
||||
R.styleable.AnimatedImageDrawable_autoStart, false);
|
||||
if (autoStart && mState.mNativePtr != 0) {
|
||||
this.start();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user