Commit Graph

193 Commits

Author SHA1 Message Date
Yigit Boyar
d422dc358f Added a generic configuration and theme based cache
For now, only animators use it but we can consider migrating
drawable cache to it as well.

Bug: 17456416
Change-Id: I571b96856805edb171f0fc52e6bff5a365f46b70
2014-10-23 11:46:01 -07:00
Jeff Brown
7a08fe0e09 Reapply animation duration scale each time it is started.
When Battery Saver mode is enabled, we set the animation duration
scale factor to 0 to effectively disable all animations.  Later
when it is disabled, we reset the animation duration scale
factor to 1.

This change ensures that we reapply the duration scale factor
whenever the animation is started instead of only applying it
once when the duration is set (usually when the animation is
created).  This ensures that the correct scale factor is applied
even when it changes after the animation has been initialized.

Previously, certain animations would continue to be suppressed
even after Battery Saver mode was disengaged.  This wasn't much
of an issue when the duration scale was initially implemented as
a developer setting but now that it is exposed via Battery Saver
the artifacts caused by this bug have become visible to users.

Bug: 17887431
Change-Id: I91ba5ca0505d02ac389a31d067e38886112fa0c8
2014-10-07 15:55:35 -07:00
George Mount
bc68f5adc2 Allow Path Animations to support overshooting.
Bug 17458698

Change-Id: I7a29fc8932a28121d7db8b3bf695d91a55ef059b
2014-09-12 15:46:02 -07:00
Chet Haase
6f6578e81c Use constant state in AnimatedVectorDrawable
Complex animated vector drawables can be expensive to load due to
sub-optimal parsing of the String-based pathData. Suffering that penalty
every time the same drawable is loaded (such as material-themed
ProgressBars) is painful.

The new approach caches constant state of both the VectorDrawable (including
the pathData geometry) and the animators (which includes potentially expensive
path-based interpolators).

issue #17366831 Material ProgressBar taking 200+ms to inflate

Change-Id: Iba3b541e24cfce8c07f5aa9fe6aa7d7b92b2fe1c
2014-09-10 21:21:53 +00:00
George Mount
fd3c4744f2 Use intrinsic size for path animation in AnimatedVectorDrawable
Bug 16984007

Animated Vector Drawables were using the viewport dimensions for
calculating the allowable animation error. Instead of using viewport
dimensions, it is better to use the intrinsic dimensions. Using
the viewport dimensions meant that a small viewport (e.g. 1x1)
would mean that animation paths within would only have an accuracy
of 50% of the dimensions of the drawable.

Change-Id: Id0152eabb4effd1e50c644eea7a371b38baeb7c1
2014-09-09 17:09:57 -07:00
John Reck
f5945a0c8b Disable RT-anim for AnimatorSet
Bug: 17317184

 Unfortunately this will disable *all* RT animations in a scene,
 but we don't have more selective targetting currently

Change-Id: I57e1c0ae43957f45229473bdcdaf34c05825fab7
2014-09-05 15:58:26 -07:00
George Mount
984011f685 Use optimized Keyframes for Path animations.
Bug 17005728

Change-Id: I2e109ed1a3e768e1e0286fc3950516f16509e591
2014-08-29 16:02:28 -07:00
John Reck
291161ac38 Run RevealAnimator on RT
Bug: 16894195

Change-Id: I9acffa7aecc04c68b60c67f8f8a20aa225075a42
2014-08-19 16:32:43 -07:00
Craig Stout
7f9988f0f5 Fix NPEs when inflating a ValueAnimator.
Change-Id: I4489b9e80635053792668a2f8032635893fb4afd
2014-08-08 11:17:50 -07:00
Chris Craik
af4d04cab6 Use RoundRect clipping for circle reveal animation
bug:16630975

Also, remove inverse clipping feature from reveal animator.

Change-Id: I770a4eb48cd123b0ca0f39d16a0f3eefd1be3653
2014-07-30 17:15:50 +00:00
John Reck
c01bd1167a Return Animator instead of ValueAnimator
Change-Id: I29a7cfdc7ffbb3a4d33f9e64f9d7ca791f5c947c
2014-07-19 02:00:15 +00:00
John Reck
d3de42cae8 Add RT-enabled reveal animator
Bug: 16161431

 Also re-writes RevealAnimator to avoid using any listeners internally,
 removing the logic around shadowing the update listeners.

Change-Id: I6ed8126398eed971a87f20bccb7584c9acafbb6c
2014-07-18 22:10:22 +00:00
Yigit Boyar
dd223e612c Merge "Change Animators to reset values when restarted if their target changes" into lmp-dev 2014-07-16 16:25:13 +00:00
Yigit Boyar
8619f48fb3 Change Animators to reset values when restarted if their target changes
Bug: 15710503
Change-Id: Ib39bf0e13199978ffb389111c225beb30312c965
2014-07-16 14:39:25 -07:00
ztenghui
7bc6a3f023 Add more reverse support to AnimatedVD
bug:16162242

Change-Id: Ie0b7618beeb65ebeb65db41600165837524bcee4
2014-07-16 19:26:26 +00:00
Chet Haase
4ae3e6af08 Set existing TypeEvaluator on new KeyframeSet when changing object values
This avoids NullPointerException crash when changing values without
first canceling a running animator.

Issue #16245303 KeyframeSet crash on null keyframe or evaluator

Change-Id: I50ce5223310fe87e3382c446e2d36d93ae38a8fe
2014-07-15 17:39:48 +00:00
Yigit Boyar
e8c8617c28 Merge "Clone animators before running in StateListAnimator" 2014-06-23 21:50:10 +00:00
George Mount
f505b1f08d Use Property for ofFloat with Path.
Bug 15827972

Change-Id: I8917f7ab0df9709c11ae38e89af6b603ec76d430
2014-06-24 00:00:16 +00:00
ztenghui
eb034fbca4 AVD now support path morphing.
Basically extended the ValueAnimator to support a new type: pathType.
Add the PathDataEvaluator internally to interpolate path data.
Update test to show the path morphing.

Change-Id: I89db0199cbc12e3041790a6115f3f50b80213cdb
2014-06-20 15:16:47 -07:00
Yigit Boyar
de5a75ea91 Clone animators before running in StateListAnimator
Bug: 15678925
Change-Id: I81d88c08d515b90b3105936c2d665b417483dfe1
2014-06-17 14:53:10 -07:00
ztenghui
cf4832f69c Add path support into xml files for PathInterpolator and ObjectAnimator.
The test case is showing that AnimatedVectorDrawable is able to use path to
define time interpolator and object movement now.

Change-Id: If3c0418265d0fd762c8f5f0bb8c39cce3ad34ef3
2014-06-19 10:56:28 -07:00
ztenghui
e5e92602a4 Add AnimatedVectorDrawable
Currently as a hidden class.
It can support many the animations now as far as ObjectAnimator and
hierarchical group can support.
And we don't have path morphing yet.

Also support the Animator / Interpolator inflation from Context and Resources.

Change-Id: I948bbdf7373ad291171eed0b497959dce8c2edf3
2014-06-12 13:18:59 -07:00
Alan Viverette
87ac5f60e2 Use a weak reference to the ObjectAnimator target
Also adds Nullable and NonNull annotations where it was obvious.

Change-Id: I4be7a94b0510e87b260f902cc1efd3c5e4bdc228
2014-06-04 16:39:21 -07:00
George Mount
42516d19db API Review: split out BidirectionalTypeConverter.
Bug 14997858

Change-Id: I1f2ccf7c4e60320c8df759702a8f2fa24fd3acd2
2014-05-19 15:57:14 -07:00
Yigit Boyar
f4c5bf30b4 State based animators for Views
Set quantum theme buttons to elevate 2dp on press

Change-Id: Ibf4f5ef166b901382c304d392eba075836a96a35
2014-05-07 16:52:17 -07:00
Chet Haase
5f9ea81c99 Doc fix in TypeEvaluator method docs
Change-Id: Ie20ba820b0a3a6b8f0f6120dfcfc8bba6adf29b3
2014-05-06 17:07:16 -07:00
ztenghui
4dc16b370c Add RevealAnimator
Expose this as a ValueAnimator throught a new API as
View.createRevealAnimator().

Change-Id: Ia6aac452988f001023478ee1ca0f268960e23f25
2014-03-27 18:30:20 -07:00
George Mount
2ed16ac623 Fix problem on Animator with a start delay.
Bug 13589060

Change-Id: I05b9421fa141466bdbfe19f1bd5d993fa23982cb
2014-03-21 16:13:37 -07:00
Ashok Bhat
fbb35fb39e AArch64: Use of long for pointers in PropertyValuesHolder
Long is used in PropertyValuesHolder class to store native pointers
as they can be 64-bit. Note that jmethodID, a pointer to structures,
is also carried in long rather than int to support 64-bit system.

Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>

(cherry picked from commit 0141e88434)

Change-Id: I80408a7227427732db0d8b4c960bcb849b7c8060
2014-01-29 11:07:06 +00:00
George Mount
c96c7b2e54 Add animations along a Path.
Change-Id: If03bd10a3961ff874e33489e1253146b8dadca33
2013-11-20 07:39:26 -08:00
George Mount
e6702cb0f6 Merge "Add ofArgb to ObjectAnimator and ValueAnimator." 2013-10-21 21:13:08 +00:00
George Mount
1ffb280a7d Add ofArgb to ObjectAnimator and ValueAnimator.
Bug 10396985

Change-Id: Ib1fcea04b5a915800fc415b3d548a8853b05389c
2013-10-11 12:06:45 -07:00
Chet Haase
eddb9dc0a4 am a8382f70: am 1928bcbc: am 1d7b3dc1: Merge "Make LayoutTransition.setInterpolator() actually do something" into klp-dev
* commit 'a8382f7064225ac1f44d27545376607d10ee00f3':
  Make LayoutTransition.setInterpolator() actually do something
2013-10-10 11:32:23 -07:00
Chet Haase
33d08762d8 Make LayoutTransition.setInterpolator() actually do something
Previously, you could set a new interpolator on a LayoutTransition object,
but it wouldn't have any effect, since the value was only used at construction
time. This change makes the intended behavior work, byt assigning that
new interpolator to the appropriate animations when they are run.

Issue #11163487 LayoutTransition.setInterpolator() has no effect

Change-Id: I1b390a30c008ac2bf26491dc352e28f276357388
2013-10-10 11:17:48 -07:00
George Mount
7d8589c156 Merge "Support for multiple value animations." 2013-10-09 20:23:43 +00:00
George Mount
d5df8a3665 Merge "Setter values can now have different type than animated values." 2013-10-09 20:23:19 +00:00
George Mount
c75b478ced Merge "Adds reuse Rect constructor for RectEvaluator." 2013-10-09 20:22:27 +00:00
George Mount
0f3f2983db Adds reuse Rect constructor for RectEvaluator.
Adds constructor to RectEvaluator that allows reuse of the
evaluated Rect Object.

Change-Id: I09ca4fd7dadb20d1501248c83dc008c00d901fd6
2013-10-07 14:01:56 -07:00
George Mount
4eed52944c Support for multiple value animations.
Bug 2805977
Support for multi-value setters in ObjectAnimator.

Change-Id: I7854dfcb82372afc6d9afb4c50a289ff9d41574e
2013-10-07 13:22:39 -07:00
George Mount
16d2c9cc6b Setter values can now have different type than animated values.
Add TypeConverter to convert animated values type to target
setter type.

Change-Id: I7f0581b18a5321b4aafd7e47f147a81573c45061
2013-10-07 12:55:02 -07:00
George Mount
f8c40cfc72 Set evaluator after setting values so that it can take effect.
Bug 10638385

setEvaluator only takes effect after values are set in
an Animator.

Change-Id: I609a8615732182add3dd5bfc8940a4913e031cfa
2013-09-25 15:50:45 -07:00
Chet Haase
a8e176534c Merge "Reversing immediately after starting animator ends it" into klp-dev 2013-09-11 14:13:48 +00:00
Chet Haase
f43fb2a57f Reversing immediately after starting animator ends it
Previously, an animator that had started but not yet played its
first frame would be reversed from its end state, which was not the
desired behavior. Now, we detect that condition (started, but not yet
actually running) and simply end() the animator immediately.

Issue #10136266 ValueAnimator.reverse right after calling start() does the full animation

Change-Id: I2a48d267336241ce74079c75758026c6f07ebc3a
2013-09-06 07:59:36 -07:00
Chet Haase
d82c8ac4db Transition API changes from API council recommendations
Issue #10460684 KLP API Review: android.view.transition and android.animation
Issue #10570740 Transitions: inflate transition targets from xml

Change-Id: I7a3f6d3aece2fcafc5efd555d033f79e86635c98
2013-09-04 14:46:38 -07:00
Sascha Haeberling
bac752632c Fix typo in JavaDoc for TypeEvaluator.
Change-Id: Ice2b2db117e1f91ad70ed55d4cc0b14b86804c1c
2013-08-15 19:37:32 -07:00
Chet Haase
8aa1ffb0ed pause/resume for Animators
It is now possible to pause Animator-based animations. Pausing an
animator causes it to hold the current time/value indefinitely, or
until end/cancel/resume is called. When resume() is called, it continues
from where it left off.

There is a new listener interface on Animator, AnimatorPauseListener,
which can be used to listen to pause/resume events.

Change-Id: I77d1535e792fb7bf349f549a0ac0a0d85958cb47
2013-08-12 11:51:32 -07:00
Chet Haase
9b80ca81a8 Optimize calls to Trace for animators
Previously, ValueAnimator would always call into the Trace class to
log start/end events. When the animator is an ObjectAnimator, this
call necessitated building a new String to capture the animated property
name. This fix puts the calls to Trace inside a check for isTagEnabled(),
to ensure that we only bother building the trace name when tracing is
actually enabled.

Change-Id: I56ef093f3b67b31a19c861f9d1e44a84341edf53
2013-06-04 09:37:38 -07:00
Chet Haase
fdd3ad7018 Give animators more useful names in systrace
Also, fix ObjectAnimator.getPropertyName() to return useful info
for ObjectAnimators not created with string-based property names.

Change-Id: If7ab6dbcc3be13f5978840b02f4a91ef7eee1c50
2013-04-24 16:49:12 -07:00
Chet Haase
e8cee38c6a Remove Animatable interface
Push the interface methods from the new Animatable interface back
down into Animator, from whence they came.

Issue #8634310 Remove Animatable interface

Change-Id: I79e26001709d791d54fcb02561640fe2e008b1fd
2013-04-16 17:54:14 -07:00
Chet Haase
0a41431d69 Merge "API and doc cleanup, plus small animation/UI features" into jb-mr2-dev 2013-04-12 22:18:24 +00:00