Add ComplexColor interface for both GradientColor and ColorStateList.
Set up constant state, factory, theme attrs for GradientColor, while
refactoring the ColorStateList's similar code. (Functionality in CSL should
be the same).
Support themeing in both the root and item level in GradientColor.
For example, both startColor in <gradient> tag or color in <item> tag can
have theme color.
Add tests for both simple and complex cases with themeing etc.
Hook up the native VectorDrawable implementation using 2 extra JNI calls for
simplicity. Such calls only happen at inflate and applyTheme call.
b/22564318
Change-Id: Ibdc564ddb4a7ee0133c6141c4784782f0c93ce0e
There was an issue with some vector drawables, particularly those with more
than one underlying, sequential animators, where the final frame would not be
drawn when battery saver mode was enabled (or animators were set to have durations
of 0). This resulted in an incorrect fingerprint graphic on the lockscreen, because
the animation effectively didn't run at all.
The fix is to always invalidate whenever the AnimatedVectorDrawble draws itself. This
causes us to constantly invalidate() the view while the animation is running.
Issue #26591987 Fingerprint icon displayed as dots when batter saver mode is on
Change-Id: I13cbd71fd229db09418c6dcacfec5a13bbb44b2e
Uses consistent naming and ordering for padding and inset calculations.
Updates documentation to include UNDEFINED_INSET as public API, since we
return the value and will accept the value as a valid param. Flattens
out RTL logic for readability.
Change-Id: Ie704e2e5fc7f5763500ebe1217ddbbf4d0c5ef86
This changes the documentation for inPreferQualityOverSpeed,
inDither, and requestCancelDecode().
These changes are a result of modifying the backends of
BitmapFactory and BitmapRegionDecoder to be faster, higher quality,
and to use standard libraries.
BUG:26266063
BUG:25556965
Change-Id: I9008fd276a38c737e242bcc6930ffe4e36d9fd1d
- Refactored VPathRenderer & VectorDrawableState
- Moved all the VD rendering into native
- Set up hooks for VD's property changes in JNI for animated VD
TODO: JNI calls can be further reduced when we convert the animation
in AVD to use RenderNodeAnimator, in which case animation will be
driven from native and therefore most of the JNI hooks for changing
VD's properties during animation will no longer be needed.
Change-Id: I52021f4d7bea057b83ace54085d870dd45acae0f
info-activities
The icon is loaded from the discovery session only when it is displayed
to avoid having to store too many icons in memory.
Also the icons are not maintained in the historical printers. Only if
the printers are available nice icons are shown. A historical printer is
updated with the appropriate properties (including icon) once it becomes
available.
Bug: 24135005
Change-Id: Iec389bab514b024634be8fb5fc8928371cba8740
There are two reasons for this. First, the name 'ttcIndex' is over
specific, there are many indexed font containers in addition to ttc,
such as fon, pfr, bdf, and dfont. There may be others in the future.
Second, Skia implemented this attribute with the name 'index' quite
some time ago. By naming this attribute 'index' even existing apps will
be able to use this attribute (including Chrome).
BUG: 10861108
Change-Id: I68d2b69fad304d93313f96bf3365af71906dfe69
ttcIndex is used for specifying index of the TrueType Collection.
No user visible change is expected with this CL.
BUG: 10861108
Change-Id: I76a1c890164bb55a7ece7b9c7db2ce2bac3f8b89
Previously the headers all had duplicate content, which is
now optimized to look visually more appealing.
Change-Id: I38ed8db1985fd8a9470888e1b7e1e6b0f2e23b19
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
Setting the LocaleList to the native Paint object is not a lightweight
operation since it needs to propagate a string object to the native code
which then needs to parse it for making minikin language list.
To avoid performance regressions, cache the minikin language ID in
android.graphics.Paint and send the LocaleList with cached ID
instead of a string the next time native code is called.
BUG: 25122318
Change-Id: Ib5ce8bcff8a1c0a2b1a1c3d1868ea8be5a0e642f
bug:26066107
GradientDrawable should provide a shadow casting outline if using a
translucent fill.
Change-Id: Ie6b409bafe3fcf9c5216662168d7349e2a9e3413
The body of {@code} must not be HTML escaped. This is one of
several changes that fix the source in conjunction with a
doclava fix.
Bug: 25757239
Change-Id: Ib38a0fa2dd2a3d68e467f78a812071e763d7e881
Bug: 25602850
The exit-out animation doesn't want to animate from the current
value, but rather the final value of the exit-in animation
Change-Id: I1cd12b0653b5241c6e21ef1cca86b0a83ce9c5a2
Refactors density handling to look more similar to GradientDrawable's
implementation, which should make things easier to maintain. We no
longer update density directly in updateStateFromTypedArray, instead
handling it in applyTheme() and inflate().
Lazily calculates local density-dependent dimensions and invalidates
when the constant state density changes, which should ensure a random
call to applyTheme() will still result in the correct intrinsic
dimensions.
Change-Id: I726878a6cd75d38a550637e3e7a7b6bc68bcaf6d
Introduced PathData in Java, which is effectively a thin layer around the
native instance. PathData holds the verbs and points which is being used
in path morphing/interpolation. The verbs and points can be interpreted
into skia path commands, which is now done in native and therefore saves
a handful of JNI calls during path creation.
Removed the old PathDataNode mechanism and changed the PathEvaluator
to use PathData instead.
Also added tests and a microbench. Also ran CTS tests for VectorDrawable
and AnimatedVectorDrawable, and passed all of the existing tests.
Change-Id: Ia166f5172ff031fe18b154327967f911a62caec1
Previously we were discarding the Resources when forwarding from the
two-arg factory method to the one-arg method. This CL also updates the
documentation for ConstantState to be slightly more comprehensive.
Bug: 25688078
Change-Id: I4fbbf43f95fe792fa6f0bf9db8fd9a7cbfa51d1d
Also updates documentation for getIntrinsicWidth/Height to accurately
reflect the behavior of the existing implementations and provide an
explanation of what "intrinsic" means.
Bug: 25646242
Change-Id: I11daf57e598148adfda922cfc1ba31ed48a16bd7
Fixes a regression where the foreground was created against the density
in DPI rather than as a scale factor.
Bug: 25602850
Change-Id: Ia871aa5def4319682a73228efb599f31b65afdb6
Previously we would only mutate children when they were displayed, so
applyTheme() calls would be applied to the shared constant state. Now
we mutate() immediately after obtaining the child, which ensures we
have a clean constant state. This also allows us to remove extra
mutate() calls, since we know all child drawables are already mutated.
Bug: 25081461
Change-Id: I52390db268690a8e181f5b9bbe612b7ed6ce9359
All of the functionality of ConstantStateFuture has been moved into
prepareDrawable. We don't need the extra wrapper class.
Change-Id: I452b13320a838a23c8ec0dd486a89bf383142d7b
If a child drawable has no intrinsic width or height, don't attempt to
apply padding and insets to the child during the parent layer drawable's
intrinsic width and height calculations.
Bug: 25461370
Change-Id: Idf616bde0449231f38156da53feb858e1ae41c47