summaryrefslogtreecommitdiff
path: root/core/java/android/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-13.0.0_r52' of ↵George Zacharia2023-08-021-1/+1
|\ | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into t13.0 Android 13.0.0 Release 52 (TQ3A.230605.012) Change-Id: Ic80f318636f1f70bbd009504352ddde511d0dead
| * docs: Fix typo ("An consumer" -> "A consumer")Andrew Solovay2023-01-031-1/+1
| | | | | | | | | | | | | | | | | | CommonTypos linter complained about this in the generated reference doc. No changes to source code, just doc comment. Bug: 263824202 Change-Id: I715f841f1d8d5680472bca1d92f754781f1c8bf9 Test: [go/abtd test]
* | MetaKeyKeyListener: Disable locking of toggled modifier keysSean McCreary2023-04-241-2/+0
|/ | | | | | | | | | | | | | | | Toggled (or 'sticky') modifier keys that lock when pressed twice cause unexpected behavior that confuses users. Shift is especially problematic, as there are three distinct Caps Lock states in Android: The Caps Lock key, Alt + Meta, and Shift pressed twice. Only the first illuminates the Caps Lock LED, and each can only be disabled by pressing the right key/combination again. This forces users to 'hunt' to find the right one, and pressing Alt twice will lock that modifier leading to yet more unexpected behavior... Get rid of locking for toggled modifier keys to improve this mess. Change-Id: I94de5d8d051b2d518457a1a44c9ee939508b9abb (cherry picked from commit 1d018cfaff04521b37b5116bb22a621ca73da128)
* Merge changes from topic "truncate operator name" am: ffa0f982b6 am: ↵Ling Ma2022-04-011-0/+47
|\ | | | | | | | | | | | | | | | | 9cf73e369d am: eb897b1d85 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004810 Change-Id: Ie1a67a1a9fae4dbbc321755f7ec9bde8bb84613f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * Add truncateStringForUtf8Storage()Ling Ma2022-03-311-0/+47
| | | | | | | | | | | | Test: manual Bug: 210502588 Change-Id: I5d4ded0cb30151bc567cfedcdb1bbbdb9abdca9b
| * Merge sc-v2-dev-plus-aosp-without-vendor@8084891Xin Li2022-02-111-3/+45
| |\ | | | | | | | | | | | | | | | Bug: 214455710 Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5 Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
* | \ Merge "Fix wrong Nullability of BoringLayout new API introduced in API33" ↵TreeHugger Robot2022-03-221-6/+6
|\ \ \ | | | | | | | | | | | | into tm-dev
| * | | Fix wrong Nullability of BoringLayout new API introduced in API33Seigo Nonaka2022-03-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 225695033 Test: N/A Change-Id: I93d3fc3041e862ad5f6064ac517e9cdbd23f1599 (cherry picked from commit c93d6b49b595a0143936d26bfb654032401439ac)
* | | | Set useFallbackLineSPacing into member valueSeigo Nonaka2022-03-211-0/+5
|/ / / | | | | | | | | | | | | | | | Bug: 225727260 Test: atest BoringLayoutTest Change-Id: Ifc7b2e3920d770a6b59cc4ea191560db057d2363
* | | Update the text wrapping API.James.cf Lin2022-03-102-33/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Improve BoringLayout#isBoring for PrecomputedText"Seigo Nonaka2022-02-163-2/+49
|\ \ \
| * | | Improve BoringLayout#isBoring for PrecomputedTextSeigo Nonaka2022-02-033-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 216736786 Test: atest PrecomputedTextTest Test: perf score becomes 758,071 -> 110,755 Change-Id: I57d3eb9d1e896ed1c847733c4e96ac52dd97d2c4
* | | | Merge "Recycle obtained TypedArrays"TreeHugger Robot2022-02-101-0/+4
|\ \ \ \
| * | | | Recycle obtained TypedArraysNikolas Havrikov2022-02-101-0/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | Bug: 218835043 Test: make Change-Id: I27c679c164920dc4b1096a316432f64501a85ae5
* / / / Migrate frameworks/base javadocs references to androidxAlan Viverette2022-02-092-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge changes Ib484fc0c,I2b9ff69c,I0a31b117,I888c65c8,I03723cfe, ...Calvin Pan2022-01-271-9/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | | Clear <plurals> in TextUtilsCalvin Pan2022-01-261-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 199230228 Test: make Change-Id: I3c0422b588a954a9e32fdcc94ea3946dbccddcd0
* | | | Merge "Prefer WeakReference.refersTo() to get()" am: 63e3c2c709 am: ↵Hans Boehm2022-01-271-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aca7bb4b9f am: a2e1dc8b9a am: db7bb39fb9 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956816 Change-Id: I8f190ce1b3c9fc97a4efd8f3d90178db6ab362da
| * \ \ \ Merge "Prefer WeakReference.refersTo() to get()" am: 63e3c2c709 am: ↵Hans Boehm2022-01-271-1/+1
| |\ \ \ \ | | | |/ / | | |/| / | | |_|/ | |/| | | | | | | | | | | | | | aca7bb4b9f am: a2e1dc8b9a Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956816 Change-Id: I449eec7c2bc21bfa5c7909a4508fbf899a59040d
| | * | Prefer WeakReference.refersTo() to get()Hans Boehm2022-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | Merge "Early exit if the target region is empty" into sc-dev am: 47d7cbaf87 ↵TreeHugger Robot2021-10-051-1/+1
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: ddda404a7e Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15391846 Change-Id: I0a368d5bb144aa182747c04687b6b23404f2329b
| | | * | Early exit if the target region is emptySeigo Nonaka2021-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 193849901 Test: atest StaticLayoutBidiTouchTest Change-Id: I55f04068a6e5b353867d50742356c272d28886b3
| * | | | Bold StyleSpan further for auto-boldJeff DeCew2021-12-161-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Merge "Early exit if the target region is empty" into sc-v2-devSeigo Nonaka2021-10-051-1/+1
| |\ \ \ \ | | |/ / / | |/| | |
| | * | | Early exit if the target region is emptySeigo Nonaka2021-07-271-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | Bug: 193849901 Test: atest StaticLayoutBidiTouchTest Change-Id: I55f04068a6e5b353867d50742356c272d28886b3
* | | | Merge "Add line break word style parameter in the LineBreakConfig"James Lin2022-01-241-0/+4
|\ \ \ \
| * | | | Add line break word style parameter in the LineBreakConfigJames.cf Lin2022-01-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""Bernardo Rufino2022-01-193-5/+5
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 331be9a6431d6489f8d1e1b80cb510d0ee073c50. 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 setLineBreakConfig APISeigo Nonaka2022-01-153-30/+127
| |_|/ |/| | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Implement fallback line spacing for BoringLayout"TreeHugger Robot2022-01-125-31/+225
|\ \ \
| * | | Implement fallback line spacing for BoringLayoutSeigo Nonaka2022-01-125-31/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex""Ashwini Oruganti2022-01-123-5/+5
|\ \ \ \ | |/ / / |/| | |
| * | | Revert "Migrate unsafe parcel APIs in framework-minus-apex"Bernardo Rufino2022-01-123-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 90bb3709dc75f7e44914222114752de5bce133d4. Reason for revert: b/214053959 Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
* | | | Revert "Implement fallback line spacing for BoringLayout"Shubham Dubey2022-01-105-208/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Implement fallback line spacing for BoringLayoutSeigo Nonaka2022-01-065-28/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Rename TextAttributeBuilderCalvin Pan2021-12-171-2/+2
|/ / / | | | | | | | | | | | | | | | Bug: 210923838 Test: atest CtsInputMethodTestCases:InputConnectionEndToEndTest Change-Id: I65b058c9353483749321a0cb79ba5033767eacaf
* | | Migrate unsafe parcel APIs in framework-minus-apexBernardo Rufino2021-12-153-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fix top/bottom to adjust fallback ascent/descent.Seigo Nonaka2021-12-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Update font weight adjustment docs for StyleSpansallyyuen2021-12-071-1/+5
| | | | | | | | | | | | | | | | | | Test: NA Bug: 209688245 Change-Id: I79f8f586bc4fc80ed7a6d05e4e8986116d82f70c
* | | Merge "Bold StyleSpan further for auto-bold"Sally Yuen2021-12-072-6/+57
|\ \ \
| * | | Bold StyleSpan further for auto-boldsallyyuen2021-12-062-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Add the new Text input type ↵James Lin2021-12-071-0/+21
|\ \ \ \ | | | | | | | | | | | | | | | TYPE_TEXT_FLAG_ENABLE_TEXT_CONVERSION_SUGGESTIONS"
| * | | | Add the new Text input type TYPE_TEXT_FLAG_ENABLE_TEXT_CONVERSION_SUGGESTIONSJames.cf Lin2021-12-071-0/+21
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* / / / Make SuggestionRangeSpan publicyingleiw2021-12-061-10/+24
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Implement fast hyphenation algorithmSeigo Nonaka2021-11-104-10/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RandomText Balanced Hyphenation ON min: 2,312,291 mean: 2,320,574 median: 2,320,112 RandomText Balanced Hyphenation ON(Fast) min: 985,850 mean: 990,922 median: 986,586 RandomText Balanced Hyphenation OFF min: 909,060 median: 923,585 mean: 930,052 Bug: 201096525 Test: TreeHugger and minikin_tests Change-Id: Ide2d73acb3de85e91018e524c89df2c949235a4e
* | | Deprecate Linkify.ALLKevin Jeon2021-10-081-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Fix the existing translation doesn't update for new translated ↵Joanne Chung2021-09-231-0/+7
|\| | | | | | | | | | | | | | | | | | | | | | | result." into sc-qpr1-dev am: 0287b4722c am: 2b55842700 am: 8b7eb90c86 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15853776 Change-Id: I85232df3ddb496fcdb7709804e9dc94f75b5193a
| * | Fix the existing translation doesn't update for new translated result.Joanne Chung2021-09-191-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | 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
| * Improve ellipsize performanceSeigo Nonaka2021-06-081-4/+5
| | | | | | | | | | | | | | | | | | | | 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 2c6121f3e3c52965ae33317e4fe7a273fd1742c6)
* | Early exit if the target region is emptySeigo Nonaka2021-07-231-1/+1
| | | | | | | | | | | | Bug: 193849901 Test: atest StaticLayoutBidiTouchTest Change-Id: I55f04068a6e5b353867d50742356c272d28886b3