It was supposed to be enabled in S, but we missed it due to
https://r.android.com/1490737
Test: android.text.format.DateFormatTest
Change-Id: I0f6495bf2e4434396606743da1e32a39a54a0b19
Re-land http://ag/2443141 because the over-translation issue should be
resolved now.
Use ICU's MeasureFormat to the degree possible for formatting file
sizes.
Bug: 36994779
Bug: 71580745
Bug: 217592956
Test: atest FrameworksCoreTests:android.text
Test: atest CtsTextTestCases
Change-Id: If3416ec38cf18c0441576643bfab850148e18c8e
1) Update the LineBreakConfig class to be immutable.
2) Do not return null in the PrecomputedText.Params#getLineBreaiConfig API
Bug: 216638444
Test: atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest; atest TextViewPrecomputedTextTest; atest StaticLayoutLineBreakingVariantsTest
Merged-In: I93bcb6ebc35344e34e9bb8a24df375aa7b3a8d81
Merged-In: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
Change-Id: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
Does not remove Support Library artifacts from docs classpath (ApiDocs.bp)
because they are still used in development/samples, which is not as easy
to migrate as javadoc.
Bug: 158779503
Test: make docs
Exempt-From-Owner-Approval: Mass find/replace for androidx migration
Change-Id: Icf7f53ec36a0e970413352e2ebf40ce9d60ed17e
* changes:
Clean <plurals> in DateTimeView
Clean <plurals> in CertificateMonitor
Clean <plurals> in FillUi
Clean <plurals> in BugreportProgressService
Clean <plurals> in keyguard
Clean <plurals> in ChooserActivity
Clear <plurals> in TextUtils
Clean <plurals> in FindActionModeCallback
Clean <plurals> in ZenModeConfig
Add util class for plurals
The line break word style(lw) provides the phrase-based breaking opportunities. When the line break word style is set, it will be brought to ICU for calculation.
Bug: 183780874
Test: atest minikin_tests; atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest
Change-Id: Idd851497e46c1fca87ff590230d93f8bb5c9afae
This is an initial pass over frameworks/core to avoid WeakReference
get(), since that can cause the referent to be unnecessarily retained.
Most of these were found by searching for "get() == null".
Bug: 215259836
Test: Treehugger
Change-Id: I5227b05ca22e83b886ccf6713989961076df3f8c
This reverts commit 331be9a643.
Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).
Original commit message:
Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()
This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).
A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.
Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
Add new API to allow applications to specify the line break word style. The line break style is one of the locale extension. When the line break style is set, it will be brought to ICU for calculation.
Bug: 183780874
Test: atest minikin_tests; atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest
Change-Id: Ia9cdb5b83e346f96ae22abbb1bcce05c43207bba
The fallback line spacing is a feature of extending the line height
when the fallback font has taller glyph. This was implemented to
StaticLayout in Android P but not yet implemented in BoringLayout.
This CL enables this feature to the BoringLayout as well.
Not to break existing apps, change this behavior only if the
targetSdk version is T or later.
This is a 2nd attempt of Ia6d6f9f44e73ddaf5e8fe9a8aead7a53efbddd44
The root cause of SystemUI crash was wrong API usage. (start, end) was
passed instead of (start, count).
Bug: 210923482
Test: atest FallbackLineSpacingTest BoringLayoutFallbackLineSpacingTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Test: atest SystemUITests
Change-Id: I9137607b0120934f7ad2a12c0f0b8aaa52915831
Revert "Add font extent calculation"
Revert "Add test case for fallback line spacing"
Revert submission 16486662-fallback_line_spacing
Reason for revert: Investigate test failures on master
BUGID: b/213826416
BUGID: b/213829920
Reverted Changes:
I06cd7ab71:Add font extent calculation
I6214d52cd:Implement fallback line spacing for BoringLayout
Ia5825c474:Add test case for fallback line spacing
Change-Id: Ia6d6f9f44e73ddaf5e8fe9a8aead7a53efbddd44
The fallback line spacing is a feature of extending the line height
when the fallback font has taller glyph. This was implemented to
StaticLayout in Android P but not yet implemented in BoringLayout.
This CL enables this feature to the BoringLayout as well.
Not to break existing apps, change this behavior only if the
targetSdk version is T or later.
Bug: 210923482
Test: atest FallbackLineSpacingTest BoringLayoutFallbackLineSpacingTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Change-Id: I6214d52cde25a044bc6e246d2118e35d3a243c9d
StyleSpan with Typeface.BOLD will only bold if the text doesn't already
have a BOLD style. But auto-bolded text needs to be further bolded.
If the Typeface style is BOLD, bold more for auto-bold.
(The fake bold works for Typefaces with weight < 700)
NOTE: This backports a public API change from master
but hides the public methods, so that we can use the new
feature in SystemUI, which has access to hidden APIs.
This does NOT backport the changes to HTML or StringBlock
as those changes may have broad affects that we do not
have time to validate before release.
Test: manual - settings page, example StyleSpans,
atest StyleSpanTest TextViewTests
Bug: 175177807
Bug: 208592419
Merged-In: Iec7db7eadd18ed6a2efc6ee39b49c1d6cb15d870
Change-Id: I8da1d3f903b265e0331e7166a0afa0720c0eaa01
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()
This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).
A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.
Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
The fallback ascent/descent can be larger than default font top/bottom
height. Not to clip the bottom of the view, adjust the top/bottom with
fallback ascent/descent.
Bug: 210163467
Test: atest StaticLayoutFallbackLineSpacingTest
Change-Id: Ifbf64f6d281d3324a926a6f0b45941824d499179
Add the new input type to indicate that the text conversion suggestions are required by the application. IME should provide the TextAttribute with the text conversion suggestions.
Bug: 194878427
Test: atest android.widget.cts.EditTextTest
Change-Id: Ib37a9816bbf594a5405ea6cd8943fd92491c005b
StyleSpan with Typeface.BOLD will only bold if the text doesn't already
have a BOLD style. But auto-bolded text needs to be further bolded.
If the Typeface style is BOLD, bold more for auto-bold.
(The fake bold works for Typefaces with weight < 700)
Test: manual - settings page, example StyleSpans,
atest StyleSpanTest TextViewTests
Bug: 175177807
Change-Id: Iec7db7eadd18ed6a2efc6ee39b49c1d6cb15d870
when we have overlapped SuggestionSpans, the
range of text being replaced can change depends on
the number of suggestions in the SuggestionSpans, so
accessibility services need to know the text being replaced.
We send text change event with the before text doesn't have the
SuggestionRangeSpan and after text has the SuggestionRangeSpan,
so a11y services can inform the user about the text being
replaced.
Other ui toolkits like compose can convert their style indicating
text being replaced to SuggestionRangeSpan.
Bug: b/143378480
Test: tested the event is sent.
Change-Id: I6d0d33e46f7c8ac9dbcc177ab54718184e715fb6
This change deprecates Linkify.ALL because it uses
Linkify.MAP_ADDRESSES, which is deprecated. The deprecation message is
the same as the one for MAP_ADDRESSES; users are directed to use
TextClassifier.generateLinks() instead.
Bug: 202556787
Test: N/A
Change-Id: I40a344410d2794f590d72faa6fcd9bf4582449bf
It is possible the existing text is changed that triggers a new
translation. We cache the translation response when onShowTransltion
is called. We should keep the translation response is updated if this
is a new translation result.
Bug: 200232741
Test: atest CtsTranslationTestCases
Test: manual. The issue app works fine.
Change-Id: Iaf7423cd35d4484e33de84e478256b77a000f390
Instead of iterate all ellipsized characters, only iterate the necessary
ranges for copying.
Bug: 188913943
Test: atest CtsTextTestCases CtsGraphicsTestCases CtsWidgetTestCases
Change-Id: I3d03b1e3897e427c23fbe51315f412c57a4ce9e9
(cherry picked from commit 2c6121f3e3)