2738 Commits

Author SHA1 Message Date
Teng-Hui Zhu
988fc6fa43 Fix callback issue for AVD on UI thread
We have created AnimatorSet from XML, but it is assigned to the AVD only when
we start the animation due to theme-ing operations.

Given listeners can be added to AVD at any time, we have to cache them if
AnimatorSet is not setup yet.

b/26979225

Change-Id: I94315892de83f93a0205efe5e70dca0cd0f0a8e3
2016-03-22 15:06:21 -07:00
Tenghui Zhu
aaa725647e Merge "Document the cache bitmap behavior for VD" into nyc-dev 2016-03-21 17:30:44 +00:00
Teng-Hui Zhu
c0b87a84c6 Document the cache bitmap behavior for VD
b/26454083

Change-Id: I22aeef9760aaf6bb79dca85740281cf94e19e601
2016-03-18 11:19:23 -07:00
Alan Viverette
a856e96eb5 Ensure nine-patch uses the best available target density
Bug: 27507887
Change-Id: Iddab4fdd2fe8fbf201dbb8ed42657a00509f42cc
2016-03-18 12:36:00 -04:00
Chris Craik
0b3a9ceed2 Merge "Avoid allocation in methods of Outline" into nyc-dev 2016-03-17 17:21:33 +00:00
Chris Craik
2c7f9a8fb9 Avoid allocation in methods of Outline
bug:26516265

Outlines are generally cached by the View system and reused, so optimize
for performance/allocation avoidance, rather than size.

Change-Id: I578d24c1255f1c1d8ebb30f3223fbe4ade4c67b4
2016-03-16 18:51:01 -07:00
Tenghui Zhu
71e806b2f4 Merge "Add fillType support to VectorDrawable" into nyc-dev 2016-03-16 21:13:24 +00:00
Chet Haase
d3eb078ac7 Merge "Document that Rect right/bottom are exclusive" into nyc-dev 2016-03-16 18:09:53 +00:00
Teng-Hui Zhu
46591f4a2d Add fillType support to VectorDrawable
Default as non-zero, which is the same as SVG.
b/27533958

Change-Id: Id20e6d3493bb4d2b4b65d7f6cdb13586631c40e4
2016-03-16 11:03:27 -07:00
Derek Sollenberger
7494eb2114 Merge "Remove all non-porterduff xfermodes from the public API" into nyc-dev 2016-03-16 12:17:16 +00:00
Chris Craik
ccdc3ebb9c Document that Rect right/bottom are exclusive
bug:22254401

Change-Id: I891e73404937b4b67210f0ac180f4cef952f8f16
2016-03-15 10:57:48 -07:00
Alan Viverette
e2578e2d9e Merge "Rename undefined inset constant" into nyc-dev 2016-03-15 17:23:35 +00:00
Alan Viverette
6888597c93 Rename undefined inset constant
Bug: 27531289
Change-Id: I31c5cc295c7f36b934eccf46cdbe7a7b293af9e0
2016-03-15 12:43:41 -04:00
John Reck
0e48bc913d Merge "Switch back to UI-driven AVD" into nyc-dev 2016-03-15 14:31:00 +00:00
John Reck
7ab0f835e6 Switch back to UI-driven AVD
Bug: 27550546
Change-Id: I7c37438555fb8a72d2ff0bc42bf5de25a31cc464
2016-03-14 17:16:10 -07:00
Chris Craik
fb354a3752 Return <0 if undefined Outline radius
bug:27531289

Change-Id: I0a2880693c59406e2d610f3a11020cde5379e230
2016-03-14 17:04:24 -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
Alan Viverette
f4c3d9f4c2 Merge "Invalidate DrawableContainer's cached canConstantState on child add" into nyc-dev 2016-03-11 20:19:11 +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
Alan Viverette
48653d225b Merge "Ensure Outline consistently sets the radius to be undefined" into nyc-dev 2016-03-11 19:34:05 +00:00
Alan Viverette
79936ddda4 Merge "Add consistent @NonNull annotations for drawable callbacks" into nyc-dev 2016-03-11 18:42:43 +00:00
Tenghui Zhu
335875bb48 Merge "Add the missing overriden API" into nyc-dev 2016-03-11 17:36:00 +00:00
Alan Viverette
5291a95715 Invalidate DrawableContainer's cached canConstantState on child add
Bug: 27553319
Change-Id: I625234baea8a992900935f562f9b767c85e527fd
2016-03-11 10:09:44 -05:00
Alan Viverette
f6d87ec193 Add consistent @NonNull annotations for drawable callbacks
Bug: 27599515
Change-Id: I33fdc5392302403bfff9cc74a8226173ec962af6
2016-03-11 10:09:14 -05:00
Derek Sollenberger
51e7805f14 Remove all non-porterduff xfermodes from the public API
bug: 14650725
Change-Id: I3c935c32849be8762281eb3d1c86481be3fa139f
2016-03-11 09:10:27 -05:00
Alan Viverette
24bf21b894 Ensure Outline consistently sets the radius to be undefined
Radius should only be defined when the rect is also defined. Also updates
ArcShape to not return an outline, since it may be convex.

Bug: 27593976
Bug: 27592381
Change-Id: I99010b139361607af6ec8cab26c9aa1d4dcbba77
2016-03-10 15:52:00 -05:00
Teng-Hui Zhu
1af03b1d53 Add the missing overriden API
This is exposed by the CTS test.

Change-Id: Ic25fda1567d8c8504612d4e825dbb646f7db1076
2016-03-09 15:38:55 -08:00
Makoto Onuki
4a07c34ca8 Merge "ShortcutManager: add remaining APIs." into nyc-dev 2016-03-09 22:28:45 +00:00
Alan Viverette
0dda14c671 Merge "Add missing annotations, getters to GradientDrawable" into nyc-dev 2016-03-09 19:22:34 +00:00
Alan Viverette
5f63721a6c Add missing annotations, getters to GradientDrawable
Fixes getColor() NPE when colors array is null.

Bug: 27543512
Change-Id: Ieec8a2315d0a2e4ab0ddbe053bccdd8c43080857
2016-03-09 13:30:35 -05:00
Tenghui Zhu
35d44ba439 Merge "Update the VD and AVD's getOpacity()" into nyc-dev 2016-03-09 18:07:43 +00:00
Makoto Onuki
5504622fb0 ShortcutManager: add remaining APIs.
- Icons are now persisted. (under /data/system_ce, as PNGs)
- the "load icon" APIs in LauncherApps are supported.
- Implement updateShortcuts()

- Addressed all the comments on the previous CL
- @hide the newly added constructor for PersistableBundle

- Enhance incoming shortcut validation
- A lot of internal clean-up.

Bug 27548047

Change-Id: I8e3c1ccd3e0a997a6d271c84d81170f0c022b60e
2016-03-08 18:37:32 -08:00
Teng-Hui Zhu
f10d08a3d4 Update the VD and AVD's getOpacity()
static VectorDrawable should be returning Transparent while root alpha is 0.
AnimatedVectorDrawable running on RenderThread now, and the opacity should
be conservatively set as Translucent.

http://b/27554766

Change-Id: I9a78696cab94f10ba40a733cc9c00f1c2d7ebb7f
2016-03-08 15:54:50 -08:00
Doris Liu
44027214d4 Handle multiple animation actions within one frame
Bug: 27438778
Change-Id: I1b14da4bc7b4e82e5b4e45f3eb9ad04e3d7842c4
2016-03-01 18:09:21 -08:00
Andreas Gampe
f6765f3965 Frameworks/base: Refactor Paint & Canvas native allocation support
Put the native allocation support into a holder class. This allows
statically initializing the classes in the boot image.

Bug: 27265238
Bug: 23130675
Change-Id: I857aebfdbaec39067a5eb58afceb49630176af98
2016-02-29 10:49:01 -08:00
Alan Viverette
2d3ca47ef8 Always update drawable container source res
Bug: 27349209
Change-Id: I3bb3d4862a03fd5ce0beeb2bf5208f2917ec9320
2016-02-25 12:27:02 -05:00
Doris Liu
3005843506 Merge "Support running AVD on UI thread" into nyc-dev 2016-02-23 22:43:53 +00:00
Doris Liu
28cfd20f02 Support running AVD on UI thread
By default, AVD animates on RT thread. But since in some cases there's a
need for a finer control on when the frame update for the animation should
happen, such as coordiating the AVD animation with other animations that
run on UI thread, we are providing a way to force the AVD to run on UI
thread.

Bug: 27278616
Change-Id: I372ecd3dc52e3fa0bdce3a1e9c19443f9b199027
2016-02-23 14:40:47 -08:00
Alan Viverette
921ec44647 Fix NinePatchDrawable handling of density changes
Scaling is now manually applied when the canvas density is not set.

Removes set/getNinePatch accessors that were added in N, since these
are not used and setting the nine patch directly will break padding.
Also removes local NinePatch, which was not necessary.

Bug: 27038114
Change-Id: Ie8b2e485b54d1ed1521081b329a09915fd0a95c1
2016-02-23 14:54:01 -05:00
Doris Liu
c21e8bcb01 Ensure invalidate is called after start()/reverse()
Change-Id: Iec96ada74cc7b845e21b5f0eb208ff7c7b1071ed
2016-02-19 14:35:55 -08:00
Doris Liu
8b083206ae Revert "Revert "Check RenderNode's owning view before attaching animators""
This reverts commit eb40178af3b7c8d925eaf6c1aa0bef739c8ea47e.

Change-Id: I6838ecb35b50847746ee66ac204f14eb5f579b91
2016-02-19 13:52:41 -08:00
Doris Liu
c4bb185d41 VectorDrawable native rendering - Step 5 of MANY
This is reverting the revert of what reverts the revert of the original
implementation. Fourth revert is a charm!

This reverts commit df7fdb1e0bdb5c289bbc08047e5c710185503309.

Change-Id: I6fc3a5accfd8b79c3da31bbc101ad9e9b4d6e7dd
2016-02-19 13:51:31 -08:00
Doris Liu
5b7188aebc Merge "Revert "Revert "Revert "VectorDrawable native rendering - Step 5 of MANY"""" into nyc-dev 2016-02-18 19:06:20 +00:00
Doris Liu
b9fb8fdf78 Merge "Revert "Check RenderNode's owning view before attaching animators"" into nyc-dev 2016-02-18 19:04:28 +00:00
Doris Liu
df7fdb1e0b Revert "Revert "Revert "VectorDrawable native rendering - Step 5 of MANY"""
This reverts commit 0d20a275a5baf8579c8b9111cf2ce6615874a6b6.

Change-Id: I97c782f1164a5d39ab74dc098cca71d9e1b30cd8
2016-02-18 18:37:02 +00:00
Doris Liu
eb40178af3 Revert "Check RenderNode's owning view before attaching animators"
This reverts commit 12abdeb3c7bffbc7c07b913595f6ea2cb66154d1.

Change-Id: I938deddf5f294127f87a0e70f940fe5b9a85e0b2
2016-02-18 18:34:59 +00:00
Doris Liu
e6e57a9d51 Merge "Check RenderNode's owning view before attaching animators" into nyc-dev 2016-02-16 23:38:57 +00:00
Doris Liu
5b49c6f31b Merge "Revert "Revert "VectorDrawable native rendering - Step 5 of MANY""" into nyc-dev 2016-02-16 23:38:43 +00:00
Doris Liu
12abdeb3c7 Check RenderNode's owning view before attaching animators
-Only add animators to a RenderNode when its owning view is attached
-When changing animator's target RenderNode, remove the animator from
 the old target RenderNode that it's currently running on, if any.
Bug: 27141983
Bug: 27145149
Change-Id: I9c9592382d64ecc0390f7ec743a59ce1ad7d9798
2016-02-16 14:25:48 -08:00
George Mount
d86d3fd768 Merge "Set the hover state to the same as focus state in RippleDrawable." into nyc-dev 2016-02-16 15:19:03 +00:00