2195 Commits

Author SHA1 Message Date
Alan Viverette
7c3212b2f4 Merge "Propagate DrawableContainer state on mutate, fix ColorDrawable theming" into lmp-mr1-dev 2014-12-12 22:00:26 +00:00
Alan Viverette
9bc11ac168 Move ripple to end state on jump when hardware exit is pending
BUG: 18734676
Change-Id: Ie063e1eec0b4f28f936ea27822afacfd1b72a0e9
2014-12-12 13:38:10 -08:00
Alan Viverette
419aa7ad14 Propagate DrawableContainer state on mutate, fix ColorDrawable theming
BUG: 18542282
BUG: 18467568
Change-Id: Id1d75cfe47fde3206ab40e5360289e0cb2504402
2014-12-12 12:34:15 -08:00
Alan Viverette
daec594370 Fix build
Change-Id: I2efdf2790aa768eaaa6e7e0b80a9ad7b2ddf3cb9
2014-12-10 16:29:59 -08:00
Alan Viverette
3ad771b384 Update tint filter after setting gradient drawable state
BUG: 18706381
Change-Id: I7d664303c9b796243da6c55d1ea9482736aabf07
2014-12-10 16:00:43 -08:00
Alan Viverette
62b780e85f Avoid creating futures for drawables with no constant state
We don't need to create futures for drawables without constant state,
since we only copy on mutate and we don't need to do any work on mutate()
for drawables without shared constant state. Also we would crash in that
case, so avoiding the NPE is nice too.

Rider: Also fixes elevations again.

BUG: 18696100
Change-Id: I4d7737f39ce3efc5830704e5ce412c540603e6ac
2014-12-10 13:52:28 -08:00
John Reck
dad7d84c04 Teach AssetAtlas about more drawables
Bug: 18317479

Change-Id: I16868ee204d24af72af9a2efc987f7e9eb1d266b
2014-12-09 14:18:33 -08:00
Alan Viverette
6ef76c60df Merge "Fix default value of AnimationDrawable's one shot property" into lmp-mr1-dev 2014-12-09 17:59:08 +00:00
Alan Viverette
0b9ab9749a Fix default value of AnimationDrawable's one shot property
BUG: 18676499
Change-Id: Iaaf134b3a58a04cd99db001edc4438ee75dab878
2014-12-09 09:48:18 -08:00
Alan Viverette
b942b6f15c Fix hotspot coordinate propagation in ViewGroup and AbsListView
There was a weird disconnect between setPressed() and hotspot propagation
behavior. This makes hotspot propagation work like setPressed(). Also
fixes ripple animation during drag-to-open.

BUG: 18631557
BUG: 18593243
Change-Id: Id4adf5d815e4d426b4182aac4d0c780f04472ae4
2014-12-08 10:37:39 -08:00
ztenghui
04c022f4c1 Merge "AVD: Deep copy the animator target setup when mutate." into lmp-mr1-dev 2014-12-05 18:28:30 +00:00
ztenghui
d2f50c78c3 AVD: Deep copy the animator target setup when mutate.
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
2014-12-04 16:55:26 -08:00
Alan Viverette
6dfa60f33c Avoid extra saveLayer calls in RippleDrawable, fix docs
Also fixes opacity returned from InsetDrawable to accurately reflect
the transparent inset area and updates button to correctly use tint.

BUG: 18226391
Change-Id: Ia9a88d9d663990a6829d2f251c7f59ea2a79d816
2014-12-04 16:52:16 -08:00
Alan Viverette
ebc9f2e773 Update locally cached drawables when constant state changes
Previously we were failing to update references to drawables that had
been pulled from constant state, so we were drawing the wrong ones.

Also fixes button Z translation on press, which was WAY too high.

BUG: 18542282
Change-Id: Ifde7d64e31d31737854cfcbe75777e5b07a06e3a
2014-12-04 12:54:46 -08:00
Derek Sollenberger
f29d5a5b21 Update AndroidPixelRef to prevent VM from cleaning up memory prematurely.
bug:18306529
Change-Id: I1ea94df1dcaf4fcf248b63dc8b0a13f36412570a
2014-12-03 13:43:30 -05:00
Alan Viverette
5ed8f27858 Update drawable container constant state following clone
DrawableContainer's internal state was getting out of sync with the
internal state of child classes because we failed to call set state.

BUG: 18542282
Change-Id: Iacaa12042e99c1b9e9eaf08f0ab879d82260e7ee
2014-11-26 17:16:08 -08:00
Alan Viverette
8dcd533786 Ensure calling mutate() on DrawableContainer creates a new state
Previously, a new state would only be created on newDrawable(), which
caused the first drawable loaded for a resource to share constant state
with the cached version. Even if mutate() was called, the constant
state was still shared and any changes were applied to the cached copy.

BUG: 18504919
Change-Id: I40d257867eb0a092ce580b9c4338ddc7406a031d
2014-11-25 10:40:24 -08:00
John Reck
fb6121e069 Merge "Revert "Ensure calling mutate() on DrawableContainer creates a new state"" into lmp-mr1-dev 2014-11-25 15:54:25 +00:00
John Reck
cf84ab5e7f Revert "Ensure calling mutate() on DrawableContainer creates a new state"
This reverts commit d7dab349c2af0e4bde188b1969f0c697b217dd57.

Change-Id: Icc1c4bfa296a59a551088fe7cc2449a97bb2b7b7
Reason: Broke the build
2014-11-25 15:50:59 +00:00
Alan Viverette
d30f6fba8b Merge "Cannot set Pivot X,Y values from setPivotX, setPivotY API" into lmp-mr1-dev 2014-11-25 00:53:08 +00:00
Alan Viverette
d7dab349c2 Ensure calling mutate() on DrawableContainer creates a new state
Previously, a new state would only be created on newDrawable(), which
caused the first drawable loaded for a resource to share constant state
with the cached version. Even if mutate() was called, the constant
state was still shared and any changes were applied to the cached copy.

BUG: 18504919
Change-Id: I1ce76fbbc144e9c0c93261e3a12cc613d0c74b83
2014-11-24 11:11:05 -08:00
Chris Craik
29dc496a42 Merge "Revert "Add a way to override Xfermode DO NOT MERGE"" into lmp-mr1-dev 2014-11-21 22:11:13 +00:00
Chris Craik
69e65019b0 Revert "Add a way to override Xfermode DO NOT MERGE"
Feature no longer needed.

bug:18448377

This reverts commit 4678dcc5524258908eadc5fe1e5e1874768967eb.

Change-Id: Ib0a19946e966a54857165555827b5fa7b34b6bea
2014-11-21 22:05:33 +00:00
jungheang.lee
735b75ce27 Cannot set Pivot X,Y values from setPivotX, setPivotY API
Pivot value can not be changed once they have been set to default.
To be changed "==" -> "!=" in if()

BUG: 18474532
Change-Id: Iacd16eb951154ea97c241566b704e0ad3f225bd1
2014-11-21 03:01:41 +00:00
ztenghui
002bc81088 Merge "ASLD: ASLD's XML reversible flag can turn off the reverse behavior now." into lmp-mr1-dev 2014-11-20 23:11:38 +00:00
ztenghui
5b84eace6c ASLD: ASLD's XML reversible flag can turn off the reverse behavior now.
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
2014-11-20 14:41:33 -08:00
Chris Craik
93ef96395a Merge "Improve ColorMatrix docs" into lmp-mr1-dev 2014-11-20 21:39:47 +00:00
Chris Craik
db7cc60eb2 Improve ColorMatrix docs
bug:18415632

Clean up some text, and add a sample.

Change-Id: I39fdda2004e1932831058701f95f67355786ad9d
2014-11-20 13:28:01 -08:00
Raph Levien
505ffe3633 Merge "Check bounds on CharSequence drawText methods" into lmp-mr1-dev 2014-11-14 20:54:29 +00:00
Alan Viverette
0c24237686 Merge "Set current degrees when updating RotateDrawable from typed array" into lmp-mr1-dev 2014-11-14 01:52:14 +00:00
Alan Viverette
d03963ce36 Set current degrees when updating RotateDrawable from typed array
This regressed after enabling theming in RotateDrawable.

BUG: 18288235
Change-Id: I61a7b2c178253ed2d550fa0636e27e021ac9eb64
2014-11-13 15:14:36 -08:00
Chris Craik
6b3bf0ceef Merge "Add offset method to Outline" into lmp-mr1-dev 2014-11-13 22:46:22 +00:00
Chris Craik
0e12fa12cb Add offset method to Outline
Also clean up offset docs in Path

Change-Id: Ieca02611d32acce726efba652ae1969340a55a76
2014-11-12 16:17:33 -08:00
Chris Craik
075b2b4ff9 Merge "Add details and performance warnings to save flag docs" into lmp-mr1-dev 2014-11-13 00:05:59 +00:00
Raph Levien
d82f8a9a38 Check bounds on CharSequence drawText methods
The canvas drawText() methods on CharSequence arguments didn't check
whether the start and end offsets were within bounds, which triggered
native crashes. This patch checks the bounds and throws
IndexOutOfBoundsException when invalid.

Bug: 18282500
Change-Id: I1935bf21f828b960c817b40ebce6affd4ce8bb99
2014-11-12 15:05:16 -08:00
Alan Viverette
667ec63c9e Merge "Don't propagate AnimatedStateListDrawable state change to super()" into lmp-mr1-dev 2014-11-12 22:19:06 +00:00
Rob Tsuk
41a8043b30 Merge "Add a way to override Xfermode DO NOT MERGE" into lmp-mr1-dev 2014-11-12 21:42:00 +00:00
ztenghui
ffcb5e210a Merge "AVD: Requires all animator has stopped before start again." into lmp-mr1-dev 2014-11-12 20:47:45 +00:00
Rob Tsuk
4678dcc552 Add a way to override Xfermode DO NOT MERGE
Add a non-public API to Canvas/GLES20Canvas to provide a way to draw
the touch ripple animation without using a save layer.

Change-Id: I6e2095adffe515194f669fb75bb67abf813bd518
2014-11-12 12:25:24 -08:00
Alan Viverette
f9afb46bf7 Fix default attributes in ScaleDrawable
Reverts default scales to correct value of -1, uses existing state
values when updating from typed array.

BUG: 18351309
Change-Id: I45d21fe017a7bea10e3cbda50f6db65d053aa2ec
2014-11-12 10:24:40 -08:00
Alan Viverette
2d91f63ec2 Don't propagate AnimatedStateListDrawable state change to super()
Also updates child element inflation code in AnimationDrawable so
that color resources can be used in the <item> drawable attribute.

BUG: 18322272
Change-Id: I8d13643c5cbdb76d69634a7bac3cead9e9fba4e8
2014-11-11 19:12:32 -08:00
Alan Viverette
b724314516 Merge "Reduce number of saveLayer calls in RippleDrawable" into lmp-mr1-dev 2014-11-12 02:04:22 +00:00
Chris Craik
f37a364a53 Add details and performance warnings to save flag docs
bug:18239290

Change-Id: I5f73bf3f1bf01c8db6ab085b182b14348e47fb3e
2014-11-11 17:37:04 -08:00
ztenghui
1a40facbfd AVD: Requires all animator has stopped before start again.
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
2014-11-10 15:03:59 -08:00
Alan Viverette
cc3c573334 Reduce number of saveLayer calls in RippleDrawable
Removes an extra saveLayer call by rendering ripples as overlapping. We
are now down to zero saveLayers when drawing unmasked ripples or ripples
masked against opaque content/masks, one saveLayer for ripples masked
against content and two saveLayers when masked against an explicit mask
layer.

BUG: 18226391
Change-Id: I0fc09d21fbc462fbcfe4c26fc7b18737f584043e
2014-11-07 15:31:16 -08:00
Alan Viverette
d6570d11e4 Support theme attributes in StateListDrawable <item> element
Also adds support for specifying drawable as a color since getDrawable()
automatically wraps colors to ColorDrawable. Does not currently allow
themed item elements to be used in Zygote preload, but we can add that
at some point in the future.

BUG: 18208662
Change-Id: I4c9721ffd100da4b9db7743a46c914828b943dae
2014-11-06 13:50:22 -08:00
Alan Viverette
b4f8a98176 Default gradient radius to %p when no intrinsic width or height set
BUG: 18224018
Change-Id: I05cbe3023d0a5e6813658063d3a3633c6ddd8d96
2014-11-03 18:45:23 -08:00
Svet Ganov
fce84f035c Crash apps that print malformed or password protected PDFs.
If apps are writing malformed content (typically not a PDF file) or if the
PDF content they provide to the print system is password protected, are now
crashed as both of these are app bugs.

bug:17636435

Change-Id: Ifce6a3199e587448dd38f6a84290a965c24b698b
2014-11-01 00:06:08 +00:00
Svetoslav
93134ce87e Merge "Save to a PDF file should look like print preview." into lmp-mr1-dev 2014-10-31 19:54:05 +00:00
Svetoslav
bec22beb99 Save to a PDF file should look like print preview.
When rendering a PDF file for print preview we take into account
the selected print options such as paper size, orientation, etc
without modifying the document. To print we send the doc in its
original form and the print options so the print service can apply
the necessary transforms in addition to the optional custom options
it supports. When saving to PDF we have to actually change the
document as we act as a print service.

bug:13545980

Change-Id: Icdcecf962bec6ff742cc6015df5af9d9086ce760
2014-10-31 10:41:34 -07:00