History log of /frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ac85f90466dd60d2af8ffc3942d503a0de606726 11-Mar-2016 Alan Viverette <alanv@google.com> 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
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
5f63721a6c2c29e639d8d239834a825c535c034a 09-Mar-2016 Alan Viverette <alanv@google.com> Add missing annotations, getters to GradientDrawable

Fixes getColor() NPE when colors array is null.

Bug: 27543512
Change-Id: Ieec8a2315d0a2e4ab0ddbe053bccdd8c43080857
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
d35c13df6e9befe6e63a10f7ef83183e7682affa 08-Dec-2015 Alan Viverette <alanv@google.com> Merge "Attach drawable resource ID and name to getDrawable() exceptions"
c078c605ab904b0e4a5d793cbeffd78c340f2816 08-Dec-2015 Alan Viverette <alanv@google.com> Attach drawable resource ID and name to getDrawable() exceptions

Wraps the entire getDrawable() method in a try/catch block. Clears the
stack trace from the re-thrown exception, since we only need the trace
from the original exception.

Also clears stack traces from re-thrown RuntimeExceptions in applyTheme
implementations.

Change-Id: I92396abf9e748eef78777174b297a09e118f5e70
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
f3dc7ac7242046d70e4ffee41fd7dbc9b9674ec0 07-Dec-2015 Chris Craik <ccraik@google.com> Correct GradientDrawable outline alpha computation

bug:26066107

GradientDrawable should provide a shadow casting outline if using a
translucent fill.

Change-Id: Ie6b409bafe3fcf9c5216662168d7349e2a9e3413
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
ce52037e0ae0c380f5b834fb3dad105bfaf5e374 30-Oct-2015 Alan Viverette <alanv@google.com> Support for changing density of GradientDrawable

Refactors density resolution and offset/size scaling into static
helper methods.

Also fixes VectorDrawbale insets to be treated as offset-type pixels
rather than size-type.

Bug: 25081461
Change-Id: I10fcb9ebb6c67f853a27ca0ee008c31af4b85da0
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
0b6cfe22fda3396b4790ac79fc90488bec4a49a4 14-Sep-2015 Alan Viverette <alanv@google.com> Revert "Use floating-point value for Drawable level"

This reverts commit 3da32b768899e7dabe3a16333edf5eca2b9ebe93.

Change-Id: Ie75ce0c285e0f59a7a086f64c0cfe088edb5df04
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
3da32b768899e7dabe3a16333edf5eca2b9ebe93 02-Sep-2015 Alan Viverette <alanv@google.com> Use floating-point value for Drawable level

This allows us to run fine-grained level animations.

Backwards compatibility:
Another CL will add DrawableCompat.setLevel(float) to forward calls to
the existing integer-based method. For callbacks, developers can override
onLevelChanged(int) and use DrawableCompat.getLevelFloat() to obtain the
floating-point level. Overriding onLevelChanged(float) will only work on
current API.

Bug: 23566299
Change-Id: I431fe6f3679c8f23f9cf3c2bb1f92a4059ee68e3
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
41551849e698129d4bd8861a1de9cb58f1300ec5 14-Aug-2015 Alan Viverette <alanv@google.com> Add missing accessors on GradientDrawable, NinePatchDrawable

Bug: 13248977
Bug: 13249029
Change-Id: Ia8817a264b7063926e75b2f2a238d5ba36e14ab5
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
81e7dbddf10ecae99f65641d8774ca6b1aceac30 23-Jun-2015 Alan Viverette <alanv@google.com> Remove isDither(), deprecate setDither()

Bug: 22013358
Change-Id: I37b11a94edc431a88522c6c056b76b045daa61d6
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
373954a1fd371a23c420aeeea9ccbc4d983733d7 17-Jun-2015 Alan Viverette <alanv@google.com> Refactor Drawable.getDither() to isDither()

Bug: 21342040
Change-Id: I801970c2a25289d670636ad5387ddf244fb48225
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
87e1938be8e6c2ac7e6163a63df5dd69633cc836 30-May-2015 Alan Viverette <alanv@google.com> Replace PNG-based seekbar thumb animation with AVD

Adds optical inset support for VectorDrawable and GradientDrawable.

Bug: 19944181
Change-Id: I9df04d9fe17ad858413e7f93694bf37ee2c43c85
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
6a49ddef62865c1b245ad60a13c334f0ffaf1a5f 12-May-2015 Chris Craik <ccraik@google.com> Revert "Fix build - Revert "Revert "Use default constructor to get anti-aliasing"""

Fix import

This reverts commit 7ed1431c83286abc83b9e5afc45fbd21ecb777b1.

Change-Id: Id93eba3ed1d47a90384ba20dea6f74d78755792b
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
7ed1431c83286abc83b9e5afc45fbd21ecb777b1 12-May-2015 Chris Craik <ccraik@google.com> Fix build - Revert "Revert "Use default constructor to get anti-aliasing""

This reverts commit dfe0a66ceca530e0777ebfab20f81103baa18f14.

Change-Id: I58a1bae649a284f3d3b6213064d903ea7fcf185a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
dfe0a66ceca530e0777ebfab20f81103baa18f14 12-May-2015 Chris Craik <ccraik@google.com> Revert "Use default constructor to get anti-aliasing"

bug:20948129

This reverts commit 58fc522a69e8ddf9ac8530ce88e9c2c92da1dd14.

Change-Id: Iddeccb4ad15b843bb3e610bd3673a0c7abc1bf46
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
58fc522a69e8ddf9ac8530ce88e9c2c92da1dd14 28-Apr-2015 Chris Craik <ccraik@google.com> Use default constructor to get anti-aliasing

Change-Id: I3e078a3bc91a2fd703984ba18b5e7e98069b32f1
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
e0f95f39c5a669a48ee3ebb8dc45bf2d7ee940f1 01-Apr-2015 Alan Viverette <alanv@google.com> Fix issues with theming of preloaded ColorStateLists

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
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
80756e38882720860db52f1fcc21fa1505a02abf 02-Mar-2015 Tor Norbye <tnorbye@google.com> Annotate ARGB integer parameters with @ColorInt

Change-Id: I307f72a382272cf18ddb6b07d9fcb81228568d9a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
bd3bfc5285dcacff0a69fecf3baeeeb90d887a58 02-Mar-2015 Chris Craik <ccraik@google.com> Improve docs for drawable tint and color filters

bug:19564477
Change-Id: I7e11baae2d4dd245965904c85b8855de71f6b6ac
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
f4c068b72e2dee2e6944488ef00b64c93217d7e8 06-Jan-2015 Alan Viverette <alanv@google.com> Add getDither, getFilterBitmap to Drawable for CTS testing

Also removes unnecessary overrides from PictureDrawable.

Change-Id: I13539b5204e8c0d8b9912da14de7ceae62720e3f
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
45c4bbbbce6bbad50a033efcba7948a23f1f117a 05-Jan-2015 Alan Viverette <alanv@google.com> Allow use of theme attributes in color state lists

BUG: 17384842
Change-Id: Ibdc413acbd00e37b908432abd55f6521c22b8fc9
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
934d8d85be221b86cb5097625c0f48391b3a71b2 11-Dec-2014 Alan Viverette <alanv@google.com> am daec5943: Fix build
automerge: aaf2e19

* commit 'aaf2e190d363f5934e5bc2fd3293d41aa9ac00aa':
Fix build
7d0aed2d2c0c2fd4bcaa0e786efd6134ae162d07 11-Dec-2014 Alan Viverette <alanv@google.com> am 4e137437: Merge "Update tint filter after setting gradient drawable state" into lmp-mr1-dev
automerge: c211857

* commit 'c211857af37eabb6073fa2ac402c9f7de9548822':
Update tint filter after setting gradient drawable state
daec594370f0e47bf07d0c9c968e3c5dfedf0bb5 11-Dec-2014 Alan Viverette <alanv@google.com> Fix build

Change-Id: I2efdf2790aa768eaaa6e7e0b80a9ad7b2ddf3cb9
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
3ad771b384b55bc0b9ee9519f457ea7093bb0b74 11-Dec-2014 Alan Viverette <alanv@google.com> Update tint filter after setting gradient drawable state

BUG: 18706381
Change-Id: I7d664303c9b796243da6c55d1ea9482736aabf07
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
9fb51ad840f445c387994ff1ebf8913b9d918f6a 05-Nov-2014 Alan Viverette <alanv@google.com> am a04a5e82: am 6e85abd4: Merge "Default gradient radius to %p when no intrinsic width or height set" into lmp-mr1-dev

* commit 'a04a5e82f0b84d57394c28600e3b142d649880cb':
Default gradient radius to %p when no intrinsic width or height set
b4f8a981769e95500ab6c86ab45102dc9c7e53c6 04-Nov-2014 Alan Viverette <alanv@google.com> Default gradient radius to %p when no intrinsic width or height set

BUG: 18224018
Change-Id: I05cbe3023d0a5e6813658063d3a3633c6ddd8d96
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
370403dbdec3a1d769c31aca66e5fcbd6617c897 31-Oct-2014 Alan Viverette <alanv@google.com> am 07a08010: am 425b1dc8: Merge "Add theme and config change support to more Drawable types" into lmp-mr1-dev

* commit '07a08010a87daec2091b643a8fcf2f7a27588098':
Add theme and config change support to more Drawable types
425b1dc88c47e0e9d3a653ad902a69f3ec09b966 30-Oct-2014 Alan Viverette <alanv@google.com> Merge "Add theme and config change support to more Drawable types" into lmp-mr1-dev
d21fd9d1ccd2b525f9c004a6cd9ba19a645701ab 29-Oct-2014 Alan Viverette <alanv@google.com> Add theme and config change support to more Drawable types

BUG: 16045735
Change-Id: Ic03173a1c1779c1bb545c4c389f77afed97011ee
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
51547e750e30801e2d367433d8cd59f6b77fdc8c 25-Oct-2014 Alan Viverette <alanv@google.com> am eba0a750: Merge "Clean up GradientDrawable styled attributes, fix useLevelForShape" into lmp-mr1-dev automerge: 91a1a72

* commit 'eba0a7509178094a46c3cca212bc3f07e70b159e':
Clean up GradientDrawable styled attributes, fix useLevelForShape
969ca91acd008cb33b72888e0b9e7109556db019 24-Oct-2014 Alan Viverette <alanv@google.com> Clean up GradientDrawable styled attributes, fix useLevelForShape

BUG: 18117976
Change-Id: Iff2ea392204346f68ea47d577e442d398114e5d8
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
ef2fef1719c3c2db5d44b8c6c78db2cf7d6ac882 21-Oct-2014 Alan Viverette <alanv@google.com> am ed89e452: am 7c133e19: Merge "Fix gradient drawable radius when specified as float, dimension" into lmp-mr1-dev

* commit 'ed89e45253ffded993ed88cd33457f45dbd6a32b':
Fix gradient drawable radius when specified as float, dimension
2efbe9816e097a07864a04f0722d5669b98699f4 21-Oct-2014 Alan Viverette <alanv@google.com> Fix gradient drawable radius when specified as float, dimension

BUG: 18070756
Change-Id: I991ff792c376c9695a007f8f1187390ab5ff6e3c
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
6ee5699b225db260b0660ee93e7ed2d542b4c962 15-Oct-2014 Alan Viverette <alanv@google.com> am eecfb52a: am 9a00cbcc: Merge "Update preload list, clean up drawable theming" into lmp-mr1-dev

* commit 'eecfb52ad56a3bb4f5bf2cdaeb83cfe8b33fa0c1':
Update preload list, clean up drawable theming
9a00cbcc66b5b0002ff78507a1dc1efa12e84d63 15-Oct-2014 Alan Viverette <alanv@google.com> Merge "Update preload list, clean up drawable theming" into lmp-mr1-dev
17cd4dfe3a05c2eddbcbc76066ff3b13fc3f2c8b 14-Oct-2014 Alan Viverette <alanv@google.com> Update preload list, clean up drawable theming

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
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
882d5cd051b2081e27f97dcf35a695737e00b434 14-Oct-2014 Alan Viverette <alanv@google.com> am d9a2b99d: am 42e96769: Merge "Add support for tint and tintMode to GradientDrawable" into lmp-mr1-dev

* commit 'd9a2b99de201c89b1b6c58eae213bb15bef58168':
Add support for tint and tintMode to GradientDrawable
43027b7bca554818cc4223389747d661819d5706 14-Oct-2014 Alan Viverette <alanv@google.com> Add support for tint and tintMode to GradientDrawable

BUG: 17975498
Change-Id: I8aeec48b8499abaf055e75018759f99801efdecc
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
859edf7963a4e017fd2bbde51f1ab83517a5e8d6 08-Oct-2014 Alan Viverette <alanv@google.com> am 0b6b0fa1: am 0660042a: Merge "Mutate and apply theme if needed before caching themed drawables" into lmp-mr1-dev

* commit '0b6b0fa154b2c02b6ccd90fa083acf422adfcc8c':
Mutate and apply theme if needed before caching themed drawables
727cae197b123ef764a1f8fbe08a995b000d14c3 08-Oct-2014 Alan Viverette <alanv@google.com> Mutate and apply theme if needed before caching themed drawables

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
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
068a02618726dccc9362118fe1c8c42b5726c535 13-Sep-2014 Alan Viverette <alanv@google.com> am 2b4de8b4: am f559f89c: Merge "Report button opacity for current state, fix button shadows" into lmp-dev

* commit '2b4de8b4ee417695cdc88e9aef0aded47036e8ef':
Report button opacity for current state, fix button shadows
888b4cf73c9663be37c4faa1249cef1a6a8f8c38 13-Sep-2014 Alan Viverette <alanv@google.com> Report button opacity for current state, fix button shadows

BUG: 17433604
Change-Id: I25e0bd9b96e09ed2a4d85476b60f459e7cc33002
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
51698b5e0ddae58a548ba3d2e8728d5cbd4275be 12-Sep-2014 Chet Haase <chet@google.com> am 7768b45e: am f23dcf73: Merge "Unfilled shapes should not report themselves as opaque" into lmp-dev

* commit '7768b45e8e49a87709f752ed1a3f67616b70f76a':
Unfilled shapes should not report themselves as opaque
25877af238133e7e621a48b35e041a03c27cf645 12-Sep-2014 Chet Haase <chet@google.com> Merge "Unfilled shapes should not report themselves as opaque" into lmp-dev
22cf0b0cb856336d36961280b1e968a91d4488d5 12-Sep-2014 Chet Haase <chet@google.com> Unfilled shapes should not report themselves as opaque

Issue #17470611 Stroked, unfilled GradientDrawable shouldn't cast a shadow

Change-Id: Ied60e12c2d2567efec8dac1fe69c77b49ef25b8e
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
72b834a3019b725afbdc549315adf8e6c5b5cfe9 11-Sep-2014 Alan Viverette <alanv@google.com> am 5d1f9528: am 2a94c34d: Merge "Copy opaque over shape in GradientDrawable copy constructor" into lmp-dev

* commit '5d1f9528fd1b6f4c7919c9e19f69c86bbf1dc561':
Copy opaque over shape in GradientDrawable copy constructor
c3a63c1fbb47f167f6736ad637fd6c6e3ee9d1d8 11-Sep-2014 Alan Viverette <alanv@google.com> Copy opaque over shape in GradientDrawable copy constructor

BUG: 17433604
Change-Id: I8eeba8bd68930db178545a3b25e29c3c45ae1f79
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
4656e69bf36d42a35c9290ab79eeb33b4cca1d5c 08-Sep-2014 Elliott Hughes <enh@google.com> resolved conflicts for merge of 2008cff7 to lmp-dev-plus-aosp

Change-Id: I5148eda624e8504f12dbc1288cd4a7a5b7c10850
d0646dca40ff740bd49755ad60751678b0ccca52 28-Aug-2014 Mark Doliner <mark@kingant.net> Small documentation fixes across many files.

Change-Id: I3e8787ce4bc6018ea1dc9aef2a2cd4e0a8dde663
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
38b5f597de96cd892add9017dc810212f549bf68 21-Aug-2014 John Spurlock <jspurlock@google.com> Implement GradientDrawable getColorFilter.

Otherwise the value in setColorFilter is unavailable.

Bug:17137319
Change-Id: Ief973abfa129d935aa45336275337e19a3eb0f6a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
c49e3ce6c6ac5100dc5a73c6bd12cbfda4d4ca76 19-Aug-2014 Chris Craik <ccraik@google.com> Don't cast shadows from gradients with transparent parts

bug:17070982
Change-Id: I607dd3c9397845fce53b7f097ec0b57246077ea1
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
77b5cad3efedd20f2b7cc14d87ccce1b0261960a 31-Jul-2014 Chris Craik <ccraik@google.com> Add outline alpha

bug:16140822
bug:16566746

This allows background drawables to alter the opacity of a shadow
being cast with their own alpha values.

Change-Id: I49698cc7c1bf4b2b55ffe2f82899543ca62bc61c
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
31ba192dd201df2cad96a8c503f730130ab0d80f 18-Jul-2014 Chris Craik <ccraik@google.com> Tweaks to outline API

b/15283203
b/16142564

Remove boolean return value chaining, as it's redundant with
the data in the Outline itself.

Change-Id: I3116e57cd1b35c98b74e95195117edd7e39fb2df
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
8e5e11b99fac942122ee2d6cdd30af51564861ae 07-Jul-2014 Alan Viverette <alanv@google.com> Handle configuration changes in drawable attributes

Adds themeable attribute support to InsetDrawable, adds support
for attribute configuration changes to all themable drawables.

BUG: 16045735
Change-Id: I3dc62d28801760ac69d303be81b6c78bb9bb5aca
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
3aff2a0813ad77fd41b39b6a636faf2de6d78acc 20-Jun-2014 Chet Haase <chet@google.com> Avoid resetting gradient state when not actually rebuilding it

Previous logic in GradientDrawable around rebuilding the gradient path
was incorrect, but it happened to work because of when it was called
(after ensureValidRect() in the draw() method). Further reliance on this
logic outside of the drawing cycle (in the new getOutline() method) caused
the side-effect to surface as we now clear the dirty flag without actually
rebuilding the gradient.

Fix avoids resetting the flag outside of ensureValidRect() where it belongs.

Issue #15508378 Quantum ui having issues with viewing comments on facebook app

Change-Id: Ia944d3de7e3c0920fed040188e8c1cc1bcce498d
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
07c661e677b354c2298a2b81f19fd24e5ab1b0e0 20-Jun-2014 Alan Viverette <alanv@google.com> Put dither in GradientDrawable constant state

Previously the dither attribute would be dropped when cloning a
gradient drawable from constant state. Also fixes ShapeDrawable
theme extraction.

BUG: 15754194
Change-Id: I3071f5b8236cfa6acb549627a3dfac0618518dbf
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
06318a0869b9f214bc97cabf1d2b6854acb6431b 06-Jun-2014 Alan Viverette <alanv@google.com> Update drawables to fix CTS test failures

Change-Id: I78617aedab450f5bc18807c03d07ee776584ece0
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
3b983a74c6bac40aad191dfcfbed930cd25a9a01 05-Jun-2014 Alan Viverette <alanv@google.com> Fix default stroke width and NPE for line with no stroke width

Also fixes restart on visiblity change in AnimationDrawable

BUG: 15437284
Change-Id: I698e7ffb11489061a38fbcd5cea10ba11a6abb34
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
71b2fbde5601b2347992c4e489d6dfe5f2c777e1 02-Jun-2014 Alan Viverette <alanv@google.com> Fix null paint in GradientDrawable, make default values explicit

BUG: 15237001
Change-Id: I80844919b910163ed986257efb4b6f8fb62eaf6a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
982c59a55f8f11d0e26be93780b292adacd56f49 02-Jun-2014 Alan Viverette <alanv@google.com> Fix padding for GradientDrawable

BUG: 15197745
Change-Id: Ibd1c20dd8ba8c7ffbf65031be4ca9813304d4d0f
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
0a1c6f021be032f5aecb341c2794efb06c0a8a0d 22-May-2014 Alan Viverette <alanv@google.com> Style and asset cleanup

Updates button drawable and colors, cleans up Quantum styles, updates
highlight attribute name and color, fixes popup backgrounds.

Also fixes GradientDrawable opacity check.

Change-Id: I75dd35e815a8a33ec9f0b16e881e774edfb8c092
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
17dafdc8d8cb92a03294657d3a6e36c9c546d130 22-May-2014 Alan Viverette <alanv@google.com> Clean up Gradient drawable theming & whitespace

Change-Id: I66c857a71e5b4beaee6a7e6c04959fbacee3cbe1
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
0cfb877f5a0a1bff82d9c3ee969195bf7812c0b5 15-May-2014 Alan Viverette <alanv@google.com> Simplify attribute extraction for themed Drawables

Also fixes a bug in GlowPadView that randomly popped up.

Change-Id: Id20508a44ea02b4a14c8f794de36e13a2c06587c
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
7979388d4f7d5d9dbfcf7e1cc4709f8088c034ae 25-Apr-2014 Chris Craik <ccraik@google.com> Support Oval GradientDrawable outlines, and ShapeDrawable

Change-Id: Ifc9e55757d3325cb28a1a812ec696512d4a18b39
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
e6a39b12656ab8d5c77d8366b24aa6410fd42e11 24-Apr-2014 Chris Craik <ccraik@google.com> Refactor Drawable outline production, flesh out Outline methods

Change-Id: I1b8c25384b5f123e86cf5e0b2270eb741bc3159b
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
803d91b2b2eef42e1ebe088613f83e555d2bfd04 25-Mar-2014 Tim Kilbourn <tkilbourn@google.com> Fix NPE when inflating GradientDrawables.

Change-Id: If624d6efac61dabe6009ee4368ad7b119e1d4dcd
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
52b999f0721b53e9c6e18a4bd664e89aeb65b2d5 25-Mar-2014 Alan Viverette <alanv@google.com> Implement APIs for obtaining, caching themed Drawables

When Drawables are inflated during preload (or otherwise without a theme)
they cache their themeable attributes in their constant state as an array
keyed on attribute index. Drawables inflated with a theme will simply
resolve theme attributes as part of normal inflation, and they will not
cache any themeable attributes.

Drawables obtained from Resources are pulled from theme-specific cache
when possible. If an unthemed Drawable exists in the preload cache, a
new constant state will be obtained for the Drawable and the theme will
be applied by resolving the cached themeable attributes and overwriting
their respective constant state properties. If no cached version exists,
a new Drawable is inflated against the desired theme.

Constant states from themed drawables may be cached if the applied theme
is "pure" and was loaded from a style resource without any subsequent
modifications.

This CL does not handle applying themes to several Drawable types, but it
fully supports BitmapDrawable, GradientDrawable, NinePatchDrawable,
ColorDrawable, and TouchFeedbackDrawable.

BUG: 12611005
Change-Id: I4e794fbb62f7a371715f4ebdf946ee5f9a5ad1c9
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
b49f446c98096c4790a11d9b5bc83a4e585278c9 20-Mar-2014 Chris Craik <ccraik@google.com> Rework Outline API, remove isolatedZVolume remnants

Change-Id: I30c2fe832dcb98fa6329b1a595b3d3aafbdcad6b
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
12b97f5d2b15194ed6673c9838b13c8312157709 24-Feb-2014 Alan Viverette <alanv@google.com> Change colorFilterColor to tint, allow use of ColorStateList

BUG: 13149901
Change-Id: I6487bec372cb74db53d7bbdfa35de071764763b0
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
b32b8a52a3aa2d9d7b5ffaea28e0e31cb077f5e0 14-Feb-2014 Alan Viverette <alanv@google.com> Fix gradient radius type

BUG: 13029355
Change-Id: I5139d5da592b8bbf420a31895ae50c365538b9cf
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
861621eb8a3bd8896bc00c4c5bc8af6816215e21 12-Feb-2014 Alan Viverette <alanv@google.com> Fix gradient radius attribute to match documentation

BUG: 12191666
Change-Id: I62de3296500543797c595eeee15aa250e5b1511a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
c8577b384a0e0e04eed6d05660e013b5db47b7f2 31-Jan-2014 Alan Viverette <alanv@google.com> Merge "Revert "Cache display lists for Drawables""
16f1d81d47beb1e04504a76de66e2919dde08c33 31-Jan-2014 Alan Viverette <alanv@google.com> Revert "Cache display lists for Drawables"

This reverts commit c062c7003f34999632fe4ad721dcd47cd71b2159.

Change-Id: I96d4f0482b927101f52140b667f4c38ffc8687f5
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
40df78153987409dbf299b84da9784b69029e184 31-Jan-2014 Alan Viverette <alanv@google.com> Simplify GradientDrawable's use of ColorStateList

BUG: 12816352
Change-Id: Icff432ee5d460ca733866185b8bf61fd50248cfc
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
c062c7003f34999632fe4ad721dcd47cd71b2159 15-Jan-2014 Alan Viverette <alanv@google.com> Cache display lists for Drawables

Change-Id: I86e2dd4cd4ac8871f4131450cb9082c2b8de2eed
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
083f5518d73e15d70ceb5c0cbc1370eda1928252 17-Dec-2013 Alan Viverette <alanv@google.com> Fix stroke color in GradientState.initializeWithState()

BUG: 12175674
Change-Id: I084339fd3c31a9b49f5875c9d3bac8f50cd027ca
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
7c263c6ee7433d425aa5f69e7eaeeade027dec2f 03-Dec-2013 Alan Viverette <alanv@google.com> Handle null argument to GradientDrawable.setColor() and setStroke()

BUG: 11966834
Change-Id: I5d17bd846b95eceaa7aa1dff64a3e6886f7e6539
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
616dd4780fb515c596f2764f7e35a30401f7b063 15-Nov-2013 Alan Viverette <alanv@google.com> Use correct state list for obtaining stroke color

BUG: 11696411
Change-Id: Ia9ad70cbceae18923fc79db8f07223fb0d41ae81
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
a211dd28b93473c452d68432c602d5209b01c178 04-Nov-2013 Alan Viverette <alanv@google.com> Add support for using ColorStateList as GradientDrawable's stroke

Refactors isOpaque() so that ColorStateList APIs previously added
on master branch are no longer needed.

Change-Id: I104c9a14ef81db6c4cf141e8fd0ebbd20bd52ee9
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
519494e207322581075c8ea884fde9d33bb9209e 28-Oct-2013 Alan Viverette <alanv@google.com> Add support for using ColorStateList in GradientDrawable

BUG: 11373225
Change-Id: Ie62f1546e8694822aadafe9ef1e57ce458a363d6
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
4d971c1fa0c71400ff1e843b8d8b4826d0aece16 28-Aug-2013 Alan Viverette <alanv@google.com> Set alpha channel correctly when recomputing gradient

The alpha channel is applied by modulateAlpha(). Setting it to
mAlpha in ensureValidRect() locked the maximum alpha channel to
whatever value was set before layout. Setting it to BLACK
ensures it can be modulated later.

BUG: 10514848
Change-Id: If7a824410a66f1e9b648e20ee627bdf99a42ae78
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
b1af7f3d4be6cd6bc6e1e805f22c209e19bf928f 08-Mar-2013 Chet Haase <chet@google.com> add getAlpha() to Drawable

Drawable has setAlpha(int), but no getAlpha() (although some subclasses have added the
method). This makes it more tedious to use the property. For example, animations that wish to
animate this property must explicitly give it a start value since this value cannot be queried
from the object.

The trick is that setAlpha(int) is abstract, only implemented by subclasses. We cannot take this
approach for getAlpha(), as we would break all subclasses of Drawable until they implemented the
method. Instead, we'll add a default method which returns an invalid value, making it easier for
clients of the method to detect whether the value is valid.

All subclasses of Drawble in frameworks have been changed to add an override of getAlpha() when
appropriate.

Issue #7485875 Drawables is missing getAlpha()

Change-Id: I06b6e35f1a56d202838eca44759c85c82595020a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
813680780f365648b39873fa26dfae0123d51aed 21-Nov-2012 Chet Haase <chet@google.com> Use correct alpha value when a color is not set on a GradientDrawable.

A previous fix ensured that color filters would have a default (black) color to
interact with if no color was set on the GradientDrawable object. However, that fix
assumed an opaque alpha value, which is not always the case. Specifically, calling
setImageAlpha() on an ImageView with a shape drawable source (as in the bug here)
caused the alpha to be set to a translucent value, which was then ignored in the fix
above.

The fix is to account for the current alpha value of the GradientDrawable object
when setting the color used by the paint object.

Issue #7592193 ImageView.setImageAlpha() broken when colorFilter is in use

Change-Id: Ie622ffca776fdd8731ced78ce1f683ca6a51dec8
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
39824f685c33f8aabbe9526b4cc79b7411e8b37f 31-Oct-2012 Raph Levien <raph@google.com> Fix for bug 7400445 regression in background drawable

The opacity calculation for a gradient drawable of shape must take
rounded corners into account - if the corner radius is nonzero, then the
shape is translucent rather than opaque. Previously the code always
assumed that such rectangles were fully opaque, which led to the
background (visible behind the rectangle) not getting drawn.

This patch simply checks for corner radius in addition to shape and
computes opacity as translucent in the nonzero case.

Change-Id: Iaf4d24abc6ecf49f85c82972b8f998700c83295e
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
41c769d9a8858ad20b0a6ed942a1cea19ba59d2d 03-Oct-2012 Romain Guy <romainguy@google.com> Bring back Netflix progress bar
Bug #7274157

Gradients and color filters are multiplied by the paint's color so it
needs to be set to opaque black to have an effect.

Change-Id: Ib5dd1e6185f758f55b57a0f4496dfae98f1a096b
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
cf8675ee176a375f873792684d38a47f78348dff 02-Oct-2012 Romain Guy <romainguy@google.com> Draw stroked rectangle as meshes instead of textures
Bug #7233734

Stroked rectangles were rendered using software generated textures
which would lead to slightly misaligned results. Instead, let's use
the new convex path rendering code that will do the right thing
(and save a lot of bandwidth.)

Change-Id: Ib95ff581e56c1ecead97e4919298e6fd146ca167
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
684385ddde2ac0c26de0862390ad713aff3fb149 19-Sep-2012 Romain Guy <romainguy@google.com> mutate() didn't work as advertised
Bug #7162705

Change-Id: I15b2663fa7f1c71a2a3479134b8b7f37bfcbc607
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
e91aa0fa64db892194ba82ec7d41df6fb9185471 19-Sep-2012 Romain Guy <romainguy@google.com> Compute GradientDrawable's opacity correctly

The current implementation of GradientDrawable always assumes the shape needs
to be blended. This causes all windows to be considered translucent by default.
This change recomputes the opacity as needed to ensure windows are marked
opaque when they should.

Change-Id: Iaf291d889a6c5122ab00c9f5781df3e7f61547fa
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
5f49c3023a512efbef8bc9515d310c7a72be4af2 07-Sep-2012 Romain Guy <romainguy@google.com> The drawables cache strikes again
Bug #7117785

Draawables created from the ConstantState cache found in Resources must be
mutated before they can be safely modified by apps. Failure to do so results
in all drawables sharing the same constant state to be affected by the
modification.

In the case of the bugreport above, the status bar code plays tricks with
a background drawable and modifies its color to implement a fade in/out
effect. This drawable comes from a cached resource (color 0x0) and the
modifications made by the status bar apply to other clients of this drawable,
most notably the recents panel.

This change fixes several things:
- Simplifies colors caching by removing the assetCookie from the key. This
should result in better reuse of cached drawables
- Makes View.setBackgroundColor() honor the mutate() contract
- Ensure StateListDrawable properly mutates its children before modifying
them
- Optimize Bitmap/ColorDrawable to mark them mutated when they are not
created from an existing ConstantSate. The same optimization should be
applied to other drawables in the future

Change-Id: I54adb5d5b914c7d8930bf9b46f7e3f9dcbf4bcab
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
8bd9698b66d2e1219931ca1be5f81efaba3ed95a 31-Jan-2012 Romain Guy <romainguy@google.com> Add GradientDrawable.setColors(int[])

This change also updates the documentation to warn the user about which properties
require a call to mutate().

Change-Id: I84717068bf026669e3eef1ae92db665a964fe08a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
098ffcd521cd272ee3a63174759cceeda618d2ef 11-Oct-2011 Romain Guy <romainguy@google.com> Don't call saveLayer() when it's not required
Bug #5435653

saveLayer() can be extremely expensive on some GPU architectures. Avoiding
this call greatly improve the rendering performance of drawables with
strok + fill.

Change-Id: Ib414174ba05d5bad56d942b8e67ab784e7d60b9e
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
e1c6ff4b91072a4071589938c74dd65d66f88fb5 26-Apr-2011 Romain Guy <romainguy@google.com> Make setGradientCenter/Radius work.

The previous implementation would not rebuild the gradient shader
when programmatically changing the shader's properties. Also fixes
the documentation since the gradient center does affect linear
gradients.

Change-Id: I5387188484b862f6835b0da9042b25032e55e792
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
ee6d5cfdff475f6c1119f060b139bdc1b621fa8b 26-Apr-2011 Romain Guy <romainguy@google.com> Copy the solid color when mutating a gradient drawable.

Change-Id: If3eed36b81f54bb5a56eab7784feda3e3786f8fc
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
ed7894352f8addfe3d0da75cc7fe8bc6fef201dc 24-Feb-2011 Romain Guy <romainguy@google.com> Add dither XML attribute support to Gradient and ShapeDrawable.

Change-Id: I4b60a0ba6766b7e7b176e78dc7f15f8467e2b890
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
39c512b623eff1d7a7b17f68a42723fbda9bf483 23-Feb-2011 Romain Guy <romainguy@google.com> Don't swap bottom left and bottom right corner radii.

Change-Id: If57b6627f67998edc384de15e3d970f8edf18211
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
6efd2bad954e0e5bd74916a32f036a0f149dcd4d 13-Jan-2011 Christopher Lais <chris+android@zenthought.org> Don't drop the drawable cache completely on configuration change

There was a lot of fancy code just above the clear to ensure
that drawables that aren't affected by the change are kept,
then the entire array was cleared. This patch removes the
clear, so that the drawables that haven't changed are really
kept, matching the logs, comments and larger part of the code.

This patch also fixes the various constant states to return
correct ChangingConfigurations.

Change-Id: Ic11f6179537318d3de16dc58286989eb62a07f15
Old-Change-Id: I22495e6ed232dfe056207ce5155405af1fa82428
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
9891e1fce5f29d0421d34aa481037417bd70853d 11-Nov-2010 Chet Haase <chet@google.com> Add invalidation to Drawable when its properties change

invalidateSelf() already exists on Drawable. This triggers a call to
callback listeners so that they know the drawable has been invalidated.
For example, the background drawable on View will cause the View itself
to be invalidated.

Change-Id: I45b231a7600dcf3bc139e4059b7c9940ff49f60c
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
1041aded2df45094c36831028245fb7c5e9b67b7 04-Nov-2010 Romain Guy <romainguy@google.com> Fix possible rendering issue when drawing a path.

Change-Id: I25f2e609589f0dd9294bcf7930de6398c0d7e377
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
61c8c9c5b2006d18e9310b6521c65b36ffe75ce4 10-Aug-2010 Romain Guy <romainguy@google.com> Fix tons of bugs and add new text rendering support.

Change-Id: I326c66b10784006f6df2f12d38e120cef94cd0d7
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
dfe5c204403bc56c29bb36410574eab8b1950417 09-Jun-2010 Scott Main <smain@google.com> docs: lots of additions to the resources docs
new drawable resources
add <merge> and <include> to layout resource
update drawable class descriptioons to point to resources guide
add ID resource type

Change-Id: I733eec50bb2671f28c9e6dd7dec14eb6586f5193
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
1be46d7920dbdce24f878d6f4889ea8591ab75c6 25-Mar-2010 viral.vkm <viral.vkm@gmail.com> setCornerRadii should be called when either of corners radius is specified
as 0dp and thus while checking for condition, it should be ORed and not ANDed.

It solves Android Issue: 939
http://code.google.com/p/android/issues/detail?id=939

Change-Id: Ic18fae769480972f763f634e7462c6ed3853220b
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
4e03999ca20fd326e4ded3d7444ddd5c14f369c7 29-Sep-2009 Mike Reed <reed@google.com> if we have a single value for roundrect radius, manually clamp it before drawing.

Skia will clamp the radius independently in X and Y to ensure it is not larger than 1/2 the width (or height).
If the caller to our drawable gives us a single value, we'll assume they want it to be circular, and not an oval.
To do that, we clamp it up front, so we get (possibly smaller) circular corners, rather than potentially
elliptical ones.

This makes the progress bar look "nicer" when it is very thin in one dimension.
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
c2974809373697147cbe5754835cc871fb93aef1 14-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2116977: buttons are huge and bent

Now that we are using preloaded drawables in compatibilty mode, when
constructing them from their constant state we need to set the new
drawable's target density appropriately.

Change-Id: I3665cbea09d38b9ac5f45f8c380dc8641f86b266
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
562bf17c6c7c5226b2220e27a1543d4a43543d6c 24-Jun-2009 Phil Dubach <phillipd@google.com> Fix NPE in GradientDrawable constructor

The mColors member can be null, as can be seen in
GradientDrawable.setSolidColor() or the plain constructor. In that case, an NPE
will be thrown on attempts to derive a new GradientDrawable from the instance
using the private constructor GradientDrawable(GradientDrawable).

The problem also occurs when inflating a GradientDrawable from XML without
defining the start, center and end colors and then calling mutate() on the
instance.
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
da996f390e17e16f2dfa60e972e7ebc4f868f37e 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java