Commit Graph

52 Commits

Author SHA1 Message Date
Chet Haase
37f74cad46 Add ability to reuse bitmaps when loading new content
Change-Id: Ic5f5f40ee39787403977fb372b335dc21cf07243
2010-12-09 15:07:39 -08:00
Makoto Onuki
a52a5e7c4c Add space after property name in error message
Change-Id: I15c1acc468ff17a1ebd1bc28288d0ac7113748b2
2010-12-07 15:27:53 -08:00
Chet Haase
1a8e404743 Remove broken doc link to removed method
Change-Id: Id1b1ab8e15d9af9fa38946cc5c673062a4b5a72d
2010-12-07 11:29:39 -08:00
Chet Haase
e2ab7ccd38 Change cancel/end behavior of animations to be synchronous
Previously, cancel() and end() calls would simply log a message to
be handled later by the animation handler. This caused problems with
coordinating complex animations, where some start() events for
future animations would occur before end() events for animations already
completed.
The change is to make these events synchronous (and require them to be
called from the appropriate thread), simplifying the code and the usage.

Also, fixed various timing and event bugs in AnimatorSet, and removed
the getter/setter properties from ObjectAnimator, since an earlier change
makes these properties undesirable (because the code will use a faster
JNI approach instead of reflection when it can).

Change-Id: I05c16645c2a31a92048a6031ddb126eb4312a946
2010-12-07 10:44:08 -08:00
Chet Haase
2e1f5b0de3 Merge "Add methods to AnimatorSet that take collections" 2010-12-01 11:15:39 -08:00
Chet Haase
37a7bec599 Add methods to AnimatorSet that take collections
Change-Id: I5664bee6d27b32a70ca7d335e7fbe0af39a240bd
2010-12-01 11:05:59 -08:00
Chet Haase
5bed88e12d Animators can now have dimension and color values.
You can now use floats, ints, dimensions, or colors as input values
in XML for Animator objects. There is still a 'valueType' attribute
that lets you specify the number values to create the animator with,
though it defaults to floats (or in the case of color inputs, to ints).

Change-Id: I65f1df802db602c33f2a0308a663b6f808148e25
2010-12-01 08:11:29 -08:00
Chet Haase
7306668586 animation bugfix plus xml resources for new View properties
There was a bug around animation duration where it was possible,
for small durations or large inter-frame times, to calculate
fractions outside of the 0-1 range, causing bad value calculations.

Unrelated: new View properties for translation, scale, and rotation
were added in this release. This commit addes XML resources for
those properties.

Change-Id: Ieaf5dd729588adb2a40656aa82beecc3576f4af5
2010-11-30 11:11:43 -08:00
Chet Haase
2970c49938 various fixes for animations and javadocs
Issues around threading of animations and AnimatorSet bugs are
fixed in this change. Unrelated fixes to javadocs in other
framework classes are also part of the change.

Change-Id: I35f7e03ffdec9143bc2eb155e8f9384798ad35b3
2010-11-23 14:05:42 -08:00
Chet Haase
6e0ecb4eed Adding JNI methods as a faster reflection mechanism
This approach is only for the common cases of void-return,
single-argument float/int methods.

Change-Id: Ifb31535a6f717b85417eced93c579be6e461e039
2010-11-04 13:37:45 -07:00
Chet Haase
691ac26817 Fixed problem with setting updated values on existing animators
The previous version of PropertyValuesHolder handled construction fine,
but setting new values did not result in things getting completely set
up correctly for interpolation between those new values.

Change-Id: Ibffb16e58b4fe76b8d1cad6f0224ffd4d5404c05
2010-11-03 22:38:32 -07:00
Chet Haase
7c608f25d4 optimizing for primitive types in animations
The animator classes caused autoboxing by converting primitive types (by far
the most typical types used in animations) to be converted to their
Object equivalents because of various APIs that required Object
(like getValue() to get the animated value). This change creates
factory methods on some classes instead of the former constructors
so that we can create and return private type-specific subclasses
which operate directly on the primitive types instead.

In particular, float and int are natively supported by the animators
now. Support in the APIs for double and long was removed because it
seemed like these less common types did not justify the extra
baggage of the added API and code.

Change-Id: I6008a3883e3d6dd5225005f45f112af148e5a4ea
2010-11-03 17:42:04 -07:00
Chet Haase
70d4ba15b1 Performance optimizations for animations and toolkit
Change-Id: I316a48273a9cbb428a965e4b849b3e5e9e8202f1
2010-11-01 10:19:44 -07:00
Chet Haase
e3bc4e6f10 Use ThreadLocal for static Animator variables.
Certain fields in Animator are statics, like the list of current animations and the
main handler. However, since there may be >1 UI thread per process, these should really
be ThreadLocal variables, so that they are local to each UI thread. For example,
most animators will cause an invalidation in the view hierarchy, which can only
happen in the UI thread for that view.

Change-Id: I42be61c781ffac97b527f78ce1ffc2e0cdc42999
2010-10-27 13:48:02 -07:00
Brad Fitzpatrick
599ca29986 Expose (internally only) the number of animations currently running.
This will be used for StrictMode to annotate violations with
whether or not they janked up an animation.

Change-Id: I5bc691f49b74c45279cd2ae044d2a81dcf1204a9
2010-10-22 15:58:47 -07:00
Chet Haase
5c13d89c13 Optimizing display lists by referencing pointers to resources instead of copying them
Change-Id: I81ad3551d74aa1e5bb64d69e33d2eb29a6c1eb6a
2010-10-21 12:02:42 -07:00
Chet Haase
3a64f241fe Merge "Remove errant minus sign" 2010-10-14 15:07:30 -07:00
Chet Haase
51b3227c2e Remove errant minus sign
Change-Id: I39a76484884615aa86f4a845eb4637467ec5abc7
2010-10-14 14:59:39 -07:00
Chet Haase
fec30790e8 Removed obsolete trace statements
Change-Id: I98041460da3109201b13b00ff553eb3e7290debb
2010-10-14 14:23:30 -07:00
Chet Haase
2794eb3b02 Remove generics from Animator APIs
Change the manner of constructing Animator-related objects from constructors
via generics to factory methods with type-specific method names. Should
improve the proliferation of warnings due to generics issues and make the
code more readable (less irrelevant angle brackets Floating around).

Change-Id: Ib59a7dd72a95d438022e409ddeac48853082b943
2010-10-14 13:13:34 -07:00
Romain Guy
83d6e82132 Revert "Remove generics from Animator APIs"
This reverts commit 41f041d998.
2010-10-14 10:13:53 -07:00
Chet Haase
41f041d998 Remove generics from Animator APIs
Change the manner of constructing Animator-related objects from constructors
via generics to factory methods with type-specific method names. Should
improve the proliferation of warnings due to generics issues and make the
code more readable (less irrelevant angle brackets Floating around).

Change-Id: I7c1776b15f3c9f245c09fb7de6dc005fdba58fe2
2010-10-14 08:39:00 -07:00
Chet Haase
608fc3cbed Double the performance of animations.
There is a hard-coded limit to the frame rate of animations; this commit increases that rate by changing the inter-frame delay from 30 ms to 10 ms (although the actual delay will be determined by the maximum refresh rate of the system and the system load). For example, the effective maximum on current devices is 55 fps, or a delay of about 16 ms.

Change-Id: Id96a41cef36851e2d9508a98934f4b25595251ea
2010-10-11 08:47:13 -07:00
Chet Haase
e0ee2e9f31 New TimeInterpolator interface for android.animation package.
The new animation package's reliance on the old Interpolator interface (in
android.view.animation) was an eyesore. Adding TimeInterpolator, and having the
old Interpolator interface extend it, allows the new Animator classes to break
the tie to the older animation package completely. However, developers can still
use the older Interpolator-based classes, such as AccelerateInterpolator,
because they all implicitly extend the new TimeInterpolator class.

Change-Id: I41132fa56167ba564f4839113289114d0ea31a92
2010-10-07 12:27:06 -07:00
Chet Haase
5d6d7b9c3d Changed LayoutTransition to disable animations when set to null
Change-Id: Ic4d67135a273ea816c3d15bce05da611bd6bae53
2010-10-04 16:58:04 -07:00
Chet Haase
5e25c2c145 Add ability to automate animated transitions on View show/hide
Change-Id: Id6ff92c8fd06c3f5fb30c41b020b4de4f567154f
2010-10-04 15:11:36 -07:00
Chet Haase
0e0590bf3c bug fixes in animation classes
Change-Id: I5465bc95032c94851b8cf4e4db3477f546e8b0d1
2010-09-26 13:05:09 -07:00
Jim Miller
3060421045 Add new WaveView widget to framework and integrate into LockScreen.
This adds a new "Energy Wave" widget to the internal widgets and
integrates it into LockScreen.

ValueAnimator needed a slight modification since it expects to
be run inside of Activities with a Looper. Additionally, this adds
an API, removeAllUpdateListeners(), which is needed to properly
recycle ValueAnimator objects.

Some minor code cleanup and UI tweaks after review.

Changed delay timeout from 1.3s to 0.5s.

Change-Id: Ibcf015e61fa8ba79d62f2019f1b29ace7caa00c8
2010-09-23 17:14:48 -07:00
Joe Onorato
9316232130 Fix broken javadoc.
Change-Id: I4729ebee36117f281af613e0b49f70d7dee5f334
2010-09-16 16:01:53 -04:00
Chet Haase
b20db3ec34 Make fragment animations work when fragments go away
Change-Id: I136de6ef910cc02b8181fcfa065bdb0770841396
2010-09-10 17:43:04 -07:00
Chet Haase
634a20acf7 Fix bug with LayoutTransition when layouts are just coming on line
Change-Id: Ia7061d8ec138f8f7aea822596f46b3549a996700
2010-09-08 17:17:25 -07:00
Chet Haase
a18a86b43e Rename several animation classes
Change-Id: I6a4544875090db485163c8d56de8718f56d267c7
2010-09-08 09:41:21 -07:00
Chet Haase
21cd1389d2 Add transition effects for layout changes on ViewGroups
Change-Id: Ibefcca5692450188fbcec608f3f7e36be1213b21
2010-09-03 12:20:00 -07:00
Chet Haase
1e0ac5a106 Fix Sequencer end events when terminated early
Change-Id: I3e10d17000182419219dbd1243d42cd0ecda7aa0
2010-08-27 08:36:59 -07:00
Chet Haase
f1b9b46421 Fix problems with early ending of Sequencer
Change-Id: Ib7548059ee3d3d713b78f86a2d290be4397c167d
2010-08-26 13:59:20 -07:00
Chet Haase
673e42fafd Fix for end events from Sequencer objects
Change-Id: I8947d8b016b880f9f54f2bf6ab22b4e188cdb29a
2010-08-25 17:32:27 -07:00
Chet Haase
d51d368f2d Change animator xml importing to use new inflater class
Change-Id: I97225ee9868f4dcce5e4c1ba55e16414eb6c0464
2010-08-24 19:37:19 -07:00
Chet Haase
49afa5bc10 Add facilities for layout transitions
Change-Id: I5c73ce6c6ba3bc9e3b57fcfbbcab37d511db6132
2010-08-24 13:09:20 -07:00
Chet Haase
602e4d3824 Adding animation facilities to simplify layout transitions
Change-Id: I70992a0dff6a75727f51abcfdfc7d7f2c2a8c101
2010-08-23 13:01:06 -07:00
Chet Haase
d953d08e92 multiple-property animations
Change-Id: Ida9440dad165f3450ff62862fc1627e138595e5f
2010-08-19 18:04:28 -07:00
Chet Haase
5c76498572 Implement reversing functionality for Animator
Change-Id: I5cf32363a363c17a1d5c5dd0c602b06dc9ebc785
2010-08-17 16:42:29 -07:00
Chet Haase
811ed1065f Make Fragments use the new animation APIs
Change-Id: I3e3c271234c737491b6ae37821f16434f4563b1d
2010-08-11 17:54:24 -07:00
Chet Haase
5d7b50b800 Add new API to Animator to allow seeking of animations
Change-Id: I3960030f54814ed0ef6fb6853061c64ab3b4dd1c
2010-08-05 11:45:04 -07:00
Patrick Dubroy
40771bc433 Fix NPE in onAnimationEnd when using Sequencer.after(long) 2010-08-04 13:49:39 -07:00
Chet Haase
8fbf8d2b08 Fix problems with moving Views around (invalidation, conflict with layout)
Change-Id: I38f8f8a4e8082854a53a2975da258b5d946ed525
2010-07-30 15:01:32 -07:00
Chet Haase
3b69b6f0be Make the new android.animation package public
Change-Id: Iff31676f25fc989707a1e17fb172296014a22c27
2010-07-29 09:09:05 -07:00
Chet Haase
f54a8d7c47 Adding xml declarations for new animation framework
Change-Id: Ic789e47790cf24d1c4b3bcbe9048b992ab93517b
2010-07-28 17:22:14 -07:00
Chet Haase
fe591563f8 Add ability to instantiate PropertyAnimator objects with single "to" value.
Change-Id: I44c57ee175e8a7bcc4532323ef9b4cfbbf58ae32
2010-07-27 15:05:51 -07:00
Chet Haase
a6e4a17577 Sequencer now sends out onAnimationEnd() event correctly.
Previously, Sequencer did not detect child animation ending correctly, so it never sent an end event. This made it difficult to have nested sequencers.

Change-Id: I6c67d0846176191cf77a49c21a5ab9a00acb5159
2010-07-23 11:21:23 -07:00
Chet Haase
3dd207a6db Add keyframes to animation framework.
Change-Id: I5c8c8037aeeedae1ce7a18200986caf57264772f
2010-07-21 08:00:40 -07:00