Commit Graph

325 Commits

Author SHA1 Message Date
Doris Liu
ad804a9b43 Add API info about Keyframe and PropertyValuesHolder am: 21b93c1f66
am: 046f615de8

Change-Id: I22ca65d40ef4fc04be2cf1fec214409a20aa8e07
2016-12-09 21:30:44 +00:00
Doris Liu
21b93c1f66 Add API info about Keyframe and PropertyValuesHolder
BUG: 32713413
Test: make -j20 docs
Change-Id: Ib2d11fe16cb470609058d2698b6b00173ae1928b
2016-12-05 21:16:10 +00:00
Aurimas Liutikas
67e2ae8639 Fix import statement in view|transition|animation packages.
This change also remove trailing whitespace.

Test: code still compiles
Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
2016-10-12 09:09:52 -07:00
Chet Haase
49a513b571 Add API to query whether animators are enabled
Animators can be scaled to have zero duration globally in any device.
This can happen either via Developer Options (an uncommon path) or
Battery Saver mode (much more common for real users).
In general, this works fine; it just causes app animations to be jump-cuts
instead (which is the desired effect, either to make transitions faster
(Developer Options setting) or to optimize battery usage by rendering
fewer frames (Battery Saver mode).

But sometimes, choreographed animations can have undesired artifacts. For
example, an animation that calls an end listener to restart itself
will end up doing this almost constantly due to this effect. Other artifacts
can also occur, such as intermediate results in a complex choreography of
multiple animations can show several intermediate results in a way that is
confusing to the user.

For these cases, there is nothing that the platform can do to automatically
determine how to best handle the result. Instead, we surface this new
API to help developers discover this behavior and compensate accordingly.

Bug: 31052471 Animation playback is abnormally fast during Battery saver mode
Test: unit tests, CTS test upcoming

Change-Id: Id7ef1a9652ac5c6cdaca0c126756e82582d49b1c
2016-10-10 19:52:07 +00:00
Doris Liu
2d7cb10ea4 Allow null target in ObjectAnimator if the target has never been set am: 4d04b1a446 am: fd2c4f186b
am: 07c6140cda

Change-Id: I230e79daa0e13dffeaa6137ea513272e0b9d45c5
2016-09-27 07:29:03 +00:00
Kevin Hufnagle
930012063b docs: Added note in LayoutTransition class reference that APPEARING and DISAPPEARING animation timelines cannot overlap am: 5232329b4e am: 1456a0a321
am: 4cb055832b

Change-Id: I7c28aef0e439a22a74c86cb7cdb4a5c1061bfb50
2016-09-27 02:11:31 +00:00
Doris Liu
fd2c4f186b Allow null target in ObjectAnimator if the target has never been set
am: 4d04b1a446

Change-Id: I5438b8d79f6e245e8a87e1480023c0ac77243f10
2016-09-27 00:43:23 +00:00
Kevin Hufnagle
8e9b8b6c74 docs: Added note in LayoutTransition class reference that APPEARING and DISAPPEARING animation timelines cannot overlap am: 5232329b4e
am: ad5cafd283

Change-Id: I8593de353f1186b2aa892cf541a4718d64474b15
2016-09-26 23:50:14 +00:00
Kevin Hufnagle
4cb055832b docs: Added note in LayoutTransition class reference that APPEARING and DISAPPEARING animation timelines cannot overlap am: 5232329b4e
am: 1456a0a321

Change-Id: I1771afca56ff1cf1b4bcc7bf9573a71d9b566e54
2016-09-26 23:50:12 +00:00
Kevin Hufnagle
ad5cafd283 docs: Added note in LayoutTransition class reference that APPEARING and DISAPPEARING animation timelines cannot overlap
am: 5232329b4e

Change-Id: Ib3f8ffa61495a237c6e69b8f9260b46027c26a2a
2016-09-26 23:15:18 +00:00
Doris Liu
4d04b1a446 Allow null target in ObjectAnimator if the target has never been set
BUG: 31684571
Test: http://ag/1484115

Change-Id: I867fc3f93ddf70c58ae4387317ac875c5bafbebe
2016-09-26 22:32:41 +00:00
Kevin Hufnagle
5232329b4e docs: Added note in LayoutTransition class reference that APPEARING
and DISAPPEARING animation timelines cannot overlap

Bug: 16808571
Change-Id: I8cbac11da4f866f2d3bcde45996b039e9bdfb801
2016-09-19 12:02:33 -07:00
Teng-Hui Zhu
76817faf29 Add TestApi to ValueAnimator for AnimationScaleListDrawable CTS test. am: 0a815bb94f am: 3687be955f
am: d607d75790

Change-Id: Id83875c14472af2ba44f0194c897460ec6aa427d
2016-08-29 22:39:09 +00:00
Teng-Hui Zhu
0a815bb94f Add TestApi to ValueAnimator for AnimationScaleListDrawable CTS test.
Also rename an internal class.

b/30877925

Change-Id: Ib971ed090907a0ab387dd7c768e2b77eb9b69f75
2016-08-24 16:12:20 -07:00
Doris Liu
f66d2f6f31 Fix out of order listener callback for animator set containing empty sets
BUG: 31016584

CTS test for this fix is added at:
https://googleplex-android-review.git.corp.google.com/#/c/1348858/

Change-Id: I9427a6791f4e0aafc33f5cc9fac16c3518d1cdbe
2016-08-22 14:30:48 -07:00
Justin Klaassen
a06d1f8fec Fix NPE in ValueAnimator am: 543a7ed7af
am: 705e2fb40c

Change-Id: I5beab0d64c1544344f1153f183c513839f673a1f
2016-07-26 15:11:27 +00:00
Justin Klaassen
543a7ed7af Fix NPE in ValueAnimator
- Reset mAnimationEndRequested to false in ValueAnimator#start(boolean)
  so that previously canceled animated (with a start delay) can be
  canceled again.
- In ObjectAnimator#animateValue(float) check if target == null
  regardless of mTarget == null since it's possible the target was
  explicitly set to null prior to the animator being cancelled.

Bug: 30190459
Change-Id: I6da55737df30a28f48355fc7a41ab91d05979deb
2016-07-25 12:40:09 -07:00
Doris Liu
2c0a36a1ec Merge "Rounding per-channel interpolation in ArgbEvaluator to closest integer" 2016-06-27 18:49:51 +00:00
Doris Liu
d0ff41c406 Rounding per-channel interpolation in ArgbEvaluator to closest integer
In case of interpolating between x+1 and x in a color channel, the
previous implementation would jump to x in the *beginning* of the
animation, as it rounds down the interpolated float that's [x, x+1].
This CL rounds the per-channel interpolated float to the closest
integer.

Change-Id: I8610fb14ab3dd0ee2b1816868977c5653c178660
2016-06-27 11:32:35 -07:00
Doris Liu
91fcf575f1 Merge \\"Fix NPE for checking for whether animators should play together\\" into nyc-mr1-dev am: 7f9c189f06
am: b53c9c1658

Change-Id: Ia8b14a4e79c60e3c83f12ab07160ff2d36247088
2016-06-24 17:58:08 +00:00
Doris Liu
c470466d7c Fix NPE for checking for whether animators should play together
BUG: 29586505
Change-Id: Ic2a67d51d2ac8d5bfb11ed7773c7c7e413cc28c7
2016-06-24 00:01:39 +00:00
George Mount
0eba1dfba0 Notify end animation after setting the state to not running.
Bug 28404635

Change-Id: I13a480b54bb652e52d6b36addfe6d3799ece7568
2016-06-14 10:35:31 -07:00
Doris Liu
c88ded5a50 Merge \"Merge \\\"Fix setCurrentPlayTime for started but not yet pulsed animations\\\" into nyc-dev am: 42d39300cf am: a28f0003eb\" into nyc-mr1-dev-plus-aosp
am: 18b9573517

Change-Id: I6b9360bdbb145d4d0b6947ae11dd9dce7bdcbd5e
2016-06-13 22:39:07 +00:00
Doris Liu
a28f0003eb Merge \"Fix setCurrentPlayTime for started but not yet pulsed animations\" into nyc-dev
am: 42d39300cf

Change-Id: I7c1f2adb31ece266b082ffb9ea85b17c083b518c
2016-06-13 20:31:32 +00:00
Doris Liu
caa2ebf814 Fix setCurrentPlayTime for started but not yet pulsed animations
Also fix the behavior for calling reverse() immediately after
start(). Such case now triggers end() right away, which is
consistent with what the animation would do in M.

Bug: 29271714
Change-Id: I045e36e039179a3c462f22bc6a3a765437de4074
2016-06-13 17:29:03 +00:00
George Mount
51cfa78b25 Merge "Ensure Animators and AnimatorSets run together are sync'd" 2016-06-10 14:16:08 +00:00
George Mount
b04a0e57a7 Ensure Animators and AnimatorSets run together are sync'd
Bug 18122022

Previously, each animator would wait a frame after it was
started the animation was actually started. This is fine
for the first frame of an animation, but when it is within
an AnimatorSet, each animator will add a frame of delay.
This skews the animations so that they can no longer be
synchronized.

This CL refrains from waiting for an animation frame when it
is started during the animator callback and just start
the animation immediately on that frame.

Change-Id: I007dad9aef7596f0e954377a36a17afd4801b7fe
2016-06-09 16:55:27 -07:00
Doris Liu
c9493879d7 Support Keyframe definition for AVD on RT
BUG: 27441613
Change-Id: Iece386f65f3704d1b7caa2b3690a8d3048ccf6e2
2016-06-09 14:40:32 -07:00
Doris Liu
a57e95a6a3 Throw Exception for wrong valueType with API guard
Previously, wrong valueType error is swallowed in jni. As a result,
some animations are quietly skipped without letting developers know.
This CL maintains that behavior for pre-N, and throws Exception
to notify developers of the error for N and above.

Bug: 29009391
Change-Id: I3e8f003cdb97d214da72af3f93a84f64797b1c2c
(cherry picked from commit 94db09917a)
2016-06-09 14:39:18 -07:00
TreeHugger Robot
a282745fb8 Merge "Simplify KeyframeSet to avoid caching." 2016-06-09 19:26:50 +00:00
Doris Liu
7e1d493267 Merge "Support Keyframe definition for AVD on RT" 2016-06-09 00:05:41 +00:00
Doris Liu
a6b967cfc5 Support Keyframe definition for AVD on RT
BUG: 27441613
Change-Id: Iece386f65f3704d1b7caa2b3690a8d3048ccf6e2
2016-06-08 15:21:15 -07:00
Doris Liu
792926a58c Improve the property modification effiency of VectorDrawable animators
Previously, the VectorDrawable animators modify the VD properties by
doing reflection based on the property name. This CL avoids the overhead
of calling reflection by wrapping the setters of VD objects in
Float/IntProperty.

Bug: 28124049
Change-Id: I562c8d749fdfe508564c82a700a92e835cdd9ff4
(cherry picked from commit 9f3b31b953)
2016-06-08 20:43:34 +00:00
George Mount
2c0f9885e5 Simplify KeyframeSet to avoid caching.
Bug 27367940


Change-Id: I76426def5d4b46c0a0ba534fd952f6c41725c74a
2016-06-08 19:38:19 +00:00
Doris Liu
204550983a Merge "Add additional type check for animating along a path" 2016-06-03 17:56:09 +00:00
Doris Liu
02f03120a9 Add additional type check for animating along a path
BUG: 29009391
Change-Id: I58c98e64f89d0e4e5e2d800a16e71ef853ecd5f6
2016-06-01 17:52:33 -07:00
Doris Liu
94db09917a Throw Exception for wrong valueType with API guard
Previously, wrong valueType error is swallowed in jni. As a result,
some animations are quietly skipped without letting developers know.
This CL maintains that behavior for pre-N, and throws Exception
to notify developers of the error for N and above.

Bug: 29009391
Change-Id: I3e8f003cdb97d214da72af3f93a84f64797b1c2c
2016-06-01 14:22:28 -07:00
Doris Liu
b37b27ff19 Merge "Merge "Add more doc for Object animators defined with a single value" into nyc-dev am: f97a0f5c9c" into nyc-mr1-dev am: d01f474773
am: d38541009b

* commit 'd38541009b847cba108a71a49d64d809b0bb5f42':
  Add more doc for Object animators defined with a single value

Change-Id: Icbc5a547c8a586335d4a826059765103cb59f26f
2016-05-28 01:00:20 +00:00
Doris Liu
3c85983996 Add more doc for Object animators defined with a single value
Bug: 28104516
Change-Id: I181b2817ceda5dfaf87e12c81b21e7d0d2f002fc
2016-05-27 15:08:46 -07:00
Doris Liu
3cea02f3ce Merge "Clamp start delay to non-negative range" into nyc-dev am: 54d89e078d am: 0890a4708e
am: a38cbfbd1f

* commit 'a38cbfbd1f51da95eb15063a2e7cf412fc1a0e93':
  Clamp start delay to non-negative range

Change-Id: I56a05ae6ba65508f20b91699f319de71641a7fd1
2016-05-25 01:57:48 +00:00
Doris Liu
61045c518b Clamp start delay to non-negative range
Bug: 28936388
Change-Id: I2a225e07cad53c6ffc3637219f8c741aca5c008c
2016-05-25 00:10:25 +00:00
Doris Liu
9f3b31b953 Improve the property modification effiency of VectorDrawable animators
Previously, the VectorDrawable animators modify the VD properties by
doing reflection based on the property name. This CL avoids the overhead
of calling reflection by wrapping the setters of VD objects in
Float/IntProperty.

Bug: 28124049
Change-Id: I562c8d749fdfe508564c82a700a92e835cdd9ff4
2016-05-23 18:33:24 -07:00
Romain Guy
ed45ab9004 Evaluate ARGB values in linear space instead of sRGB
A comparison between the old behavior and the behavior proposed in
this change can be found in the following document:

https://docs.google.com/a/google.com/document/d/1x8g5VcEZbuZd-RhSITc1VPpZ_dc0FlF1WbDscBYPQzM

Change-Id: I29d3fdfdd45cb64f32ad6a6f3f25fa3dafe1a6d0
2016-04-29 15:52:57 -07:00
Chet Haase
fa21bdfd5a Document behavior of object references in Animator classes
Animators that are created with Object values may have undefined
behavior when those objects are changed outside of the animator itself.
For example, an animator created with a start Rect and end Rect
will animate the bounds between those two objects. But if the caller
changes either the start or end rect before or during the animation,
that will affect the values used on every frame of the animation.

Issue #28304520 Strange interpolation of property values holder values

Change-Id: Id6ac19c8369ae34450e6b53d68f5e492b27c577e
2016-04-26 13:03:31 -07:00
Doris Liu
dd67b0d525 Merge "Fix pause/resume for AnimatorSet" into nyc-dev 2016-04-19 22:14:37 +00:00
Doris Liu
2987dffb72 Fix pause/resume for AnimatorSet
Bug: 28251945
Change-Id: Ie98c779791bf181e2e8fbf38bbd453228ce43310
2016-04-18 18:48:43 -07:00
Doris Liu
c5801fb933 Merge "Add api check to guard AnimatorSet behavior change" into nyc-dev 2016-04-13 23:15:33 +00:00
Doris Liu
56b0b57089 Skip to end for 0-duration animation
Repeating a 0-duration animation makes no sense. In the case of
battery saver mode, all animators are set to 0 duration, and
repeating the 0 duration animations not only waste battery power
but also potentially produce flickers on screen. In this CL,
0-duration animations are skipped to the end, regardless their
repeat count.

Bug: 25451472
Change-Id: I20f9dc2f0ff9c027782a8363ff4cf4a4d390736c
2016-04-13 14:13:49 -07:00
Doris Liu
58606db8be Add api check to guard AnimatorSet behavior change
For pre-N, we have inconsistent behavior between ValueAnimator and
AnimatorSet in the case of calling end() when already ended:
ValueAnimator would start() and immediately end, whereas AnimatorSet
would be no-op. We made a decision to be consistent within Animation
Framework from N forward, which means that AnimatorSet will have the
new behavior of starting and immediately ending just like
ValueAnimator. This new behavior will be guarded by an API check.

Bug: 25601129
Change-Id: I2d952a93d8521c547ec8cde173c80d1d8ead0639
2016-04-13 13:37:45 -07:00
Jorim Jaggi
c69bd2246f Implement transition for docking task in recents #6
- Use a future to provide the app thumbnail so the app can restart
in parallel when recents draws the bitmap (extremely expensive).
- Don't call startRecents from AM when recents is already running - this
messes up the transition information.
- Make sure to put the task into resizing mode if it needs to be restored
from the disk.
- Some minor fixes for the transition animation spec.
- Add NO_MOVE_ANIMATION to recents flags to prevent wallpaper
flickering.

Bug: 27607141
Change-Id: I7d0c75b88775ab467927b8cf94303ddb60222e7f
2016-03-25 15:13:36 -07:00