Bug: 73529437
Test: I27af7c3b2e08fa50bc19e08930d970931ce4b5e9
If isAutoMirrored, and the layout direction is RTL, make
AnimatedImageDrawable draw flipped.
Change-Id: I9a3436ef4cb9df2845a67663a2503c2c1a3dba89
Bug: 73529437
Test: I60fbee6d3610070413e8c46f363ec3c19c2e7c52
Allow setting AnimatedImageDrawable's loop count in xml. Use
"repeatCount" to match the existing attr used by other objects, and
change the Java api from "loop" to "repeat".
Cache the repeat count in the State object for the situation where we
inflate but are waiting on a theme, so that when we get a src we can
apply the existing repeat count.
Change-Id: Ie723fe9a40c64dd0e1e8fd7b5d5cf81e5c5ccd0d
Bug: 73788928
Test: No change in behavior; no new tests.
There is already an overload for both decodeDrawable and decodeBitmap
that allows not using an OnHeaderDecodedListener, so require calls to
the method that includes a parameter for it to contain a non-null
version.
Throw an exception if OnHeaderDecodedListener is null. Move
implementation to Impl methods to share code without lint warnings.
Rename the non-static decodeBitmap to decodeBitmapInternal, to
distinguish it from the others.
Change-Id: I12c0a35786d8d1267044ac09b5c9203cdfb7175a
Note that AppCompatTextView doesn't work well with this attribute since
it overwrites the selected Typeface.
Bug: 63135308
Test: atest android.widget.cts.TextViewFontWeightTest
Change-Id: I76ee5e3007ea5f96249d2a0bfb66ff5975c62522
Bug: 73788928
Test: No change in behavior; no new tests
This will allow the generated JavaDocs to include these in setAllocator.
Change-Id: Icd109ddf45e8809da1a0980924a6f4feccefcac2
Bug: 73788928
Test: I7d5082ba7319c6c069dde5d0efb22af6e92dd243
This way the input's position is unaffected. Update the docs to reflect
the new behavior.
Change-Id: I7212948ee289ea8da1be9fe81d3f4bc9296e3e61
Bug: 73529437
Test: I7907f5dd7eb8d4ab72b8e9ddcbcbfc7aa8cb05ae
Support AutoMirroring, from inflation and setting manually.
Ensure that AnimatedImageDrawable always has a State object, even if
it has no mNativePtr. If it has no mNativePtr, throw an Exception when
trying to use it.
Require that inflation have a valid src, unless it is waiting on a theme
(like BitmapDrawable).
Change-Id: I5b22cdbf4b57862d6ccc5750a677168287860f9f
Bug: 27847286
Test: none
Now that we have a framework replacement, deprecate this little-used
class.
Change-Id: Iedec214c7eb729ccb77d2b4818971393938b2295
This is 2nd attempt of I7db9e2ca4db68a16648cfb8fcf63555f501304c2
This CL changes the MeasuredText API:
- Rename MeasuredText to PrecomputedText.
- Introduce PrecomputedText.Param which holds all text layout parameters.
- Add API to get PrecomputedText.Param from TextView.
- Remove MeasuredText.Builder and add PrecomputedText.create method instead.
- Remove setRange from MeasuredText since it is not for normal use case.
(It can not be used for TextView)
Bug: 67504091
Bug: 72861572
Test: bit FrameworksCoreTests:android.text.
Test: atest CtsWidgetTestCases:EditTextTest \
CtsWidgetTestCases:TextViewFadingEdgeTest \
FrameworksCoreTests:TextViewFallbackLineSpacingTest \
FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest \
CtsTextTestCases
Change-Id: Ie73bce52c6c673cda58973ddad04627a7cf2e5e9
This reverts commit ac9c8f7c1e.
Bug: 73083791
Bug: 73364985
Don't scale NinePatchDrawable if bitmap has no density (including fix
for 73364985).
Fixed bugs around density and input streams.
Update PointerIcon to account for the fact that BitmapDrawable no longer
scales its Bitmap up at decode time. PointerIcon now handles the
scaling. This is necessary because PointerIcon never draws its Bitmap.
Instead, native code uses the Bitmap's internal SkBitmap without
accounting for density.
Test: Ran CTS:
- CtsUiRenderingTestCases
- CtsGraphicsTestCases
- I2d3976061d164ab4d58209db1320917f272a1958
- CtsViewTestCases
- ThemeHostTests
Change-Id: I3e0c11195622d65f084ce79dad887504630177ca
The last change needs more discussion and found some edge cases. Revert and make small step-by-step changes.
Bug: 73091756
This reverts commit 7fd36d19e3.
Change-Id: I89ff52a70cf6a5d6c553afa20f83719e1f9eb726
Dew to a side effect of HWUI opengl pipeline, the hairline stroke
is not respected, but it is drawn as a fill style. Implement the
same behaviour for skiagl pipeline with SDK API 27 and older.
On SDK released with Android P, the hairline stroke is respected.
Bug: 72494357
Test: Ran duolingo app
Change-Id: I48bdcf3ddec4bf65b5e93e01c5002177c4e3da90
Resources.getDrawable() was annotated @Nullable because there was one
very particular path where Bitmap decoding would fail and trigger a null
return.
As part of the switch to ImageDecoder, that path was changed to now throw
an IOException, which will result as a NotFoundException to the caller of
getDrawable.
This CL annotates that path as @NonNull to reduce pain of dealing with
@Nullable method that was very unlikely to be null in practice.
Also fixes many other missing nullability annotations, and relabel
many @Nullable paths that would never return null in practice as
@NonNull.
Bug: 69543526
Test: ResourcesTest
Change-Id: Ib01eca970c5c9969998ce5b265b120aa7048b41a
Ensure that the start x/y is clamped to accomidate
the animations' starting radius as well
Bug: 72173993
Test: Clicked on controls in API demos
Change-Id: I2a56a240a9cd0f77bdc458930d1a844611ea7148
Turn off AA from GriadientDrawable, while drawing with SRC
transfer mode. This CL speeds up drawing by avoiding intermediate
texture buffer in skia.
Bug:72804165
Test: Measured performance with systrace on opening a notifiation.
Change-Id: Icc69de90d81e8b1c4492f97722f72e7440d9acac