Commit Graph

313 Commits

Author SHA1 Message Date
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
Jorim Jaggi
787e9dd6c8 Implement transition for docking task in recents #5
- Move task along a curved path.

Bug: 27607141
Change-Id: I945071de55efed0d327b68045e48fea6989adf63
2016-03-25 14:53:19 -07:00
George Mount
907c177b04 Start seeked animators without waiting for start delay.
Bug 24872727

Change-Id: I954efd7113565f9b8f9a569f57960b8d91620758
2016-03-24 16:29:03 -07:00
Chet Haase
e60a693d84 Clarify docs around weak references to animator targets
Issue #26069047 Weak reference to the target in animators
can cause interrupted animations

Change-Id: I719f619006e93a94af907c4de7840c691a5aed37
2016-03-22 16:20:46 -07:00
George Mount
7f1bdd9f91 Merge "Add @SafeVarargs for methods using typevar varargs." into nyc-dev 2016-03-18 22:11:39 +00:00
George Mount
d98f4ba86c Add @SafeVarargs for methods using typevar varargs.
Bug 27142336
Using a type variable in a varargs leads to a javac warning
because type variables are treated as Object after compilation.
Because these uses do not require a specific typed array, we
can use @SafeVarargs to suppress the warning.

Change-Id: I860bcc79667a9c85c381c7994fd1d798209d7c66
2016-03-14 14:32:14 -07:00
Alan Viverette
781fbf28c7 Merge "Ensure all Java-side usages of config flags are using Java flags" into nyc-dev 2016-03-14 15:01:51 +00:00
Doris Liu
5a705d0bbb Merge "Set end value immediately when start a 0-duration animation" into nyc-dev 2016-03-11 20:25:21 +00:00
Alan Viverette
ac85f90466 Ensure all Java-side usages of config flags are using Java flags
Previously we were using native config flags in some places that expected
Java flags, and vice-versa. All usages of config flags are now annotated
to ensure we're using the right type.

Cleans up annotations on most methods that were touched.

Bug: 21161798
Change-Id: Ifd87dfb12199fc8258915d8a510e03ddb681ca89
2016-03-11 15:15:51 -05:00
Adam Lesinski
c4dd2e7d52 Merge "Move the guts of Resources to ResourcesImpl" into nyc-dev 2016-03-04 00:16:47 +00:00
George Mount
a06b3f19d4 Remove animation listener while paused.
Bug 27418573

While an animator was paused, it continued to receive
Choreographer callbacks. This has been changed now so
that after the first callback, it is removed.

Change-Id: If73483404b38f1f354a63fc98d07696f442987e6
2016-03-03 08:12:58 -08:00
Adam Lesinski
fb302ccd8e Move the guts of Resources to ResourcesImpl
In order to satisfy the requirement that clients can
cache a Resources object when a configuration change happens,
we move the caches and all other method bodies to ResourcesImpl.
These can then be swapped out for the correct version when needed,
while allowing clients to keep holding the existing Resources references.

This is part 1 of 2 CLs. The next one will do the actual switching of implementations
based on configuration changes for multiwindow.

Bug:26854894
Change-Id: I41156194a3541e59053b4048c3a15981c7d8a506
2016-03-01 16:58:19 -08:00
Doris Liu
b199da785b Set end value immediately when start a 0-duration animation
This is to be consistent with pre-N behavior.

Bug: 27066791
Change-Id: I24cb7bc7645339a6e52be35a8cb15902b7d7bd5e
2016-02-25 14:25:15 -08:00