When AnimationDrawable becomes VISIBLE again, the current behavior is to
start the Drawable from the first frame if it's not running. For one shot
AnimationDrawable, it should start once and stay on the last frame.
Bug: 23725157
Change-Id: I5f3095aa00b07fefe7f992851d4190f268c266b2
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
This keeps the existing single-locale APIs working (and adds
parameter annotations to them), while adding an API for setting and
getting the whole locale list. At the moment, the implementation
ignores the actual data in the locale list except for its primary
locale.
Also add a method to LocaleList to return the system's default locale
list. (Currently a one-member list just containing the system
default locale.)
Change-Id: Icea9d164ddae51f50dd71e18b5d91c96f233b8b8
Cleans up collection typing and encapsulation. VObject encapsulates
inflation, theme application, and drawing. VFullPath is responsible
for rendering nodes to a Path.
Change-Id: Ic760576d8000c4844ec3cab1b4bbcecb4fa1b760
Luminance is the measure used by W3C to compute contrast ratios, so
we should be preferring that for "brightness" comparisons.
Bug: 22815971
Change-Id: I84a971d3cc6b12acebe8e455c0c0440c1c8bce06
Bug: 22214367
Previous releases would let the getters on a recycle()'d bitmap to still
work despite being firmly in undefined behavior per the documentation
on Bitmap#recycle().
As there are apps relying on this, yell very loudly about this behavior
in the log and give them a bit of time to fix it
Change-Id: I857be7e74cb217877973d9c6f03eb761d12fd056
Before, the VectorDrawable is behaving like BitmapDrawable inside a ImageView,
and it can be blurry due to scaling.
Now apply the scaling information to the cached bitmap, then the size of bitmap
will match the ImageView's screen size. Therefore, no blurry any more.
b/18185626
Change-Id: I979cef3b5178a9bd37ee6cc776df3361ca47c803
This also moves some functions that are only called when creating/completing
a displayList into the appropriate constructors and endRecording calls.
Change-Id: I9f6add156d7f476a52766934af713b0f852c8dea
Bug: 22289362
It's pretty common for ImageView#setBitmap to be called
repeatedly. Avoid re-creating the BitmapDrawable in this scenario
as that has high object churn of semi-expensive objects like
Paint.
Change-Id: Ib77719cd0366d02c1a42f774850bf3b9caa9c288
Also clears DrawableContainer's futures list when it's no longer needed,
correctly sets deep copy of state set in StateListDrawable, makes some
private methods into package-protected to avoid thunk, and propagates
state to StateListDrawable's super class so that getState() has correct
information.
Bug: 21840003
Change-Id: I0d4232807f280d663c03b4a80e4aab8626806440