summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
Commit message (Collapse)AuthorAgeFilesLines
* Resize the VectorDrawable according to the virtual Dpiztenghui2015-06-241-1/+1
| | | | | | b/21928507 Change-Id: I9e596192a0fdf13fc91481f990a345c3b267f225
* Add reset to AVDztenghui2015-06-051-0/+9
| | | | | | b/21664621 Change-Id: Ie40c3723860e183c8e4fedd2a76b9debbdf64a2a
* Setup the animation callback for AnimatedVectorDrawableztenghui2015-06-041-33/+80
| | | | | | b/21341096 Change-Id: I84e20366db21ceaa4f044be3e322f9215bb06ad2
* Merge "Replace PNG-based seekbar thumb animation with AVD" into mnc-devAlan Viverette2015-05-291-0/+7
|\
| * Replace PNG-based seekbar thumb animation with AVDAlan Viverette2015-05-291-0/+7
| | | | | | | | | | | | | | Adds optical inset support for VectorDrawable and GradientDrawable. Bug: 19944181 Change-Id: I9df04d9fe17ad858413e7f93694bf37ee2c43c85
* | Merge "Postpone AnimatedVectorDrawable animator inflation until ↵Alan Viverette2015-05-281-65/+208
|\ \ | |/ |/| | | applyTheme()" into mnc-dev
| * Postpone AnimatedVectorDrawable animator inflation until applyTheme()Alan Viverette2015-05-181-65/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL works around Animator's lack of support for applying a theme after inflation by postponing Animator inflation until a theme is available, either in inflate() or applyTheme(). Includes a workaround for AVDs that don't reference any theme attrs in their animators and this don't require a call to applyTheme(). Partial implementation of removing non-constant data from the AVD's constant state. Moves the mutable AnimatorSet to a local variable and treats the Animators as constant data. We'll follow up with real support for applyTheme() in Animator or AnimatorSet, at which point we can remove this workaround. Bug: 20817800 Change-Id: I555c53c955219990ee376bee568bcc038532f9ed
* | API Review: DrawableAlan Viverette2015-05-271-1/+2
|/ | | | | | | Renames boolean getters to isZzz(), callback from onChange to onChanged. Bug: 21342040 Change-Id: I9700d645453354b608fd97a832359211d828b52f
* Revert "Postpone AnimatedVectorDrawable animator inflation until applyTheme()"Alan Viverette2015-05-191-106/+13
| | | | | | This reverts commit 9b115a9870a184e32bdbd07f792f9b8c956c75ca. Change-Id: Ief148510472e129f992cf52ef8b8a25b5e17e05f
* Postpone AnimatedVectorDrawable animator inflation until applyTheme()Alan Viverette2015-05-151-13/+106
| | | | | | | | | | | | | | | This CL works around Animator's lack of support for applying a theme after inflation by postponing Animator inflation until a theme is available, either in inflate() or applyTheme(). Includes a workaround for AVDs that don't reference any theme attrs in their animators and this don't require a call to applyTheme(). We'll follow up with real support for applyTheme() in Animator, at which point we can remove this workaround. Bug: 20817800 Change-Id: I5a378a76e3625b9d754cb74ae98c07ba7c5698e5
* Fix issues with theming of preloaded ColorStateListsAlan Viverette2015-04-011-1/+1
| | | | | | | | | | | | | | | | | | Ensures changing configurations mask is propagated to the host drawable so that it can be properly cleared from cache on configuration changes. Also fixes constant state handling of the mask in the Inset and Rotate drawables. Hides new ColorStateList methods related to theming, since they should only be used during preloading or internally by framework drawables. Fixes bug where the cached versions of themeable ColorStateLists were modified by calling applyTheme() on the host drawable. Also cleans up some docs and naming in GradientDrawable. Bug: 19966397 Change-Id: I8c8d3cabbaf94b488c2b8fe9fd423e07d824c19c
* Polish the documentation for VectorDrawable and AnimatedVectorDrawableztenghui2015-03-261-5/+5
| | | | Change-Id: If6bedf84cb01971c55b5a99ad921303dad638b24
* Add listener support in AVDztenghui2015-03-241-60/+71
| | | | | | | | Internally, switch to use AnimatorSet instead of an array of Animators b/19825918 Change-Id: Ia67d2cc7dd89362e6b0019c916d3f2a0d0f3e39e
* Unify wrapper-type drawablesAlan Viverette2015-02-201-6/+5
| | | | | | | | Fixes several issues with constant state and propagation of drawable property changes to wrapped drawables. Also un-hides the layout direction accessors and hotspot getter. Change-Id: Iff19db6a95059cbcfcbde7af0ac33871ccd41615
* AVD: Deep copy the animator target setup when mutate.ztenghui2014-12-041-1/+2
| | | | | | | | | | Only calling VectorDrawable's mutate here will miss all the animator setup, when the VectorDrawable has a new state. So we just deep copy everything and setup the animators again. b/18521582 Change-Id: Id164312750bb548f9c2d21cc0b5806cd2bafcf0d
* ASLD: ASLD's XML reversible flag can turn off the reverse behavior now.ztenghui2014-11-201-6/+9
| | | | | | | | | | | | | | Previously, the android:reversible flag behaves like a suggestion. Now it is used to enforce no reverse when set to false. In this way, user can safely setup one direction animation only. When set to true, but AVD can't reverse , then it will show a warning. At the same time, update the tests to show different cases, including AnimationDrawable. b/18413484 Change-Id: I5552c49dcbd76b0724b4d5593bce8388b27bd905
* AVD: Requires all animator has stopped before start again.ztenghui2014-11-101-3/+6
| | | | | | | | | We should treat all the animator as a group, we should not start again unless all the previous animations have stopped. b/18320770 Change-Id: I5b0c2c165cd314745ee6c7152aea3c666e9dff10
* Add theme and config change support to more Drawable typesAlan Viverette2014-10-291-3/+8
| | | | | BUG: 16045735 Change-Id: Ic03173a1c1779c1bb545c4c389f77afed97011ee
* Update preload list, clean up drawable themingAlan Viverette2014-10-141-19/+38
| | | | | | | | | Removes all implementations of three-arg ConstantState constructor, since we handle mutation and applyTheme() in Resources now. Moves progress bar tinting to android:tint attribute. Correctly implements applyTheme() and canApplyTheme() in all drawable wrapper and container classes. Change-Id: Ic9cb43d0d6228aa4914f3124bed234b837beaa41
* Mutate and apply theme if needed before caching themed drawablesAlan Viverette2014-10-071-0/+9
| | | | | | | | | | | This ensures that drawables are completely separated from their cached constant states before applying a theme. After this, we can remove the implicit (and incomplete) mutation in the clone constructors. Also implements missing mutate() method on ClipDrawable. BUG: 17646144 Change-Id: If0d66b0a85724d76e0a4f506758c7ba3c0aa3410
* Fixed mutate() for RippleDrawable, ASLD, AVD, fix applyTheme in VDAlan Viverette2014-09-261-1/+1
| | | | | BUG: 17646144 Change-Id: I58c111d86224dc8f7f557073c0bcbc22ad74aa1b
* Fix AVD for CTS failure.ztenghui2014-09-231-2/+9
| | | | | | | | Mostly about changingConfig flags, the fix is just a copy from VectorDrawable. b/17631551 Change-Id: Ibad9c2f61cd86b15e9bca1d1991c8cd147897bb0
* Use constant state in AnimatedVectorDrawableChet Haase2014-09-101-7/+40
| | | | | | | | | | | | | | | 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
* Use intrinsic size for path animation in AnimatedVectorDrawableGeorge Mount2014-09-091-3/+7
| | | | | | | | | | | | | 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
* Merge "Fixing AVD animation with startOffset" into lmp-devztenghui2014-08-221-2/+14
|\
| * Fixing AVD animation with startOffsetztenghui2014-08-221-2/+14
| | | | | | | | | | | | b/17160751 Change-Id: If030ca04f5a7dd7e732dcc5dfb18d51faa7e7b79
* | Forward additional drawable methods in AVDAlan Viverette2014-08-201-1/+56
|/ | | | | BUG: 17156349 Change-Id: I1d7b41fc8d0399b31db4cf21aa47180e96bfbcfe
* End the animator when stop() is calledztenghui2014-08-061-4/+2
| | | | | | bug:16830053 Change-Id: If27ba904b0f78ee8c59df3522a97f5f86509ca0e
* API REVIEW: VectorDrawableztenghui2014-07-251-8/+6
| | | | | | | | | | | | | | | | | | | | - Merge <size> and <viewport> attributes all in to top-level <vector> tag - Indent attributes under <group> in java doc. - Updata android:stroke to be android:strokeColor, likewise android:fill - Instead of android:clipToPath, make this a different clip-path tag. - Document units of the various attributes - Add example code for defining a VectorDrawable resource More than that: = Refactor the code to better support clipPath as a sub-class. = Update all the xml files to use the new attributes and clip-path tag. TODO: -- Remove clipToPath, since that should happen on build break Friday. bug:16488254 Change-Id: I6db5680ef83cb26c8f064a60fc7d6e7142974b0f
* Add more reverse support to AnimatedVDztenghui2014-07-161-3/+21
| | | | | | bug:16162242 Change-Id: Ie0b7618beeb65ebeb65db41600165837524bcee4
* DO NOT MERGE Add support for AVD reverse() to ASLD, clean up transition handlingAlan Viverette2014-07-161-0/+17
| | | | | | BUG: 16162242 Change-Id: I29336491d01d40e5369503ece858bcbe5aa99b19 (cherry picked from commit 4e9c797a9c024e5a4226ed37eece16e3db2edb78)
* Enable the bitmap cache for the VectorDrawableztenghui2014-07-141-0/+2
| | | | | | b/16299765 Change-Id: Ia2c0fd366abc097d1ce485936de74e4e898cc07a
* Add constant state support back to VectorDrawableztenghui2014-07-091-1/+1
| | | | | | | | | | At the same time, AVD is using a mutated version of VD. And AVD won't support constant state. Move the targetsMap down into constant state. bug:16017895 Change-Id: I12fbc52a8719362adba9df1e0f97288decbd33b2
* Use AnimatedVectorDrawable for progress bar.ztenghui2014-06-301-2/+3
| | | | Change-Id: I419197ef38a611757f27ca3192350ad4bd403875
* Make AnimatedVectorDrawable public.ztenghui2014-06-231-3/+84
| | | | | | | Clean up some useless VectorDrawable functions. Add comments, too. Change-Id: I8cc2165d14d09fd71f5830c4f61f9e8ac1d7c8da
* Add AnimatedVectorDrawableztenghui2014-06-121-0/+250
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