summaryrefslogtreecommitdiffstats
path: root/core/java/android/text/TextUtils.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'f395e304' into mConley Owens2011-05-021-3/+9
|\ | | | | | | | | | | | | Conflicts: core/tests/coretests/src/android/text/TextUtilsTest.java Change-Id: I7439f7f80cf91ff654c0ddd79c3e6b3808ba4784
| * am 19653c64: am 425db473: Merge "CHAR_SEQUENCE_CREATOR cannot handle null ↵Conley Owens2011-04-291-3/+9
| |\ | | | | | | | | | | | | | | | | | | string" * commit '19653c6440eaf7328ecbc01c3ca6d7a910906484': CHAR_SEQUENCE_CREATOR cannot handle null string
| | * CHAR_SEQUENCE_CREATOR cannot handle null stringMartin Wallgren2011-04-071-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | TextUtils.writeToParcel can handle null as input CharSequence but createFromParcel will throw NullPointerException. Transforming to and from parcel should handle null in the same way. Change-Id: I707ea9be2091d2655c5f63eaa57c5674befa5ad3
* | | Fix around suggestionSpan.Gilles Debunne2011-04-131-1/+6
| | | | | | | | | | | | | | | | | | Since the kind was unknown, doing a copy/cut on text with a SuggestionSpan crashed. Change-Id: I10c0677b3587897b82c794db57d7b07149f12e09
* | | Add CorrectionSpan and APIs to pass a secure CorrectionSpan to TextViewsatok2011-03-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CorrectionSpan is a span which has suggestions made by IME. This has a function to change the current IME to other IME specified in this span. For security reasons, only the current IME is allowed to use this function through InputConnection. (IME token is used for checking the validity of it.). - CorrectionSpan stores following information: flags, subtype Id, InputMethodInfo Id, suggests, locale, original string Change-Id: Id3abc9ea4d11753cdc4f483a2bb3128f49ba198a
* | | Empty spans are not considered in text layout/rendering process.Gilles Debunne2011-03-091-9/+60
|/ / | | | | | | | | | | | | | | | | Bug http://code.google.com/p/android/issues/detail?id=14786 Empty spans are affecting the text before and after them. See the comment in TextUtils.removeEmptySpans for details. Change-Id: I40376c32fd56a17efde6219f9b2593e4b4ab1ba1
* | Fix TextUtils#commaEllipsizeBrian Muramatsu2011-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug 3400770 TextUtils#commaEllipsize creates a MeasuredText "mt" object with the text to be ellipsized. It calls setPara which initializes mt's mPos member to be 0. It then calls addStyleRun which moves mPos to the end of the string. The loop back in commaEllipsize then calls mt addStyleRun again and this causes IndexOutOfBoundsException, because the paint object is trying to measure text past the text's length. It seems this was a typo and that the tempMt variable should be used, because the code is trying to measure the format string...not the the string to be ellipsized. This makes the saner parts of CTS test for this method pass now. Change-Id: Ib6aa6e4bbd6afff4c95ad4c4d51a384cc1389875
* | resolved conflicts for merge of 171c83f4 to masterBrad Fitzpatrick2010-09-121-0/+29
|\ \ | |/ | | | | Change-Id: I56a4c1838b17cf40d96763f95df3c84fc86359eb
| * Add faster TextUtil function for searching delimited lists.Brad Fitzpatrick2010-09-121-1/+30
| | | | | | | | | | | | The previous version in Settings allocated memory. Change-Id: I0f821112dc8f830689489f201ce268195f9e6cbd
* | Refactor Styled utility functions into reusable objects.Doug Felt2010-04-071-293/+149
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This takes utility functions from Styled and a few other classes and incorporates them into two new utility classes, TextLine and MeasuredText. The main point of this is to support shaping by skia, to experiment with how this will look, this also introduces character-based Arabic shaping. MeasuredText is used by code that determines line breaks by generating and examining character widths in logical order. Factoring the code in this way makes it usable by the ellipsize functions in TextUtils as well as by StaticLayout. This class takes over the caching of widths and chars arrays that was previously performed by StyledText. A small number of MeasuredText objects are themselves cached by the class and accesed using static obtain and recycle methods. Generally only these few cached instances are ever created. TextLine is used by code that draws or measures text on a line. This unifies the line measuring and rendering code, and pushes assumptions about how rtl text is treated closer to the points where skia code is invoked. TextLine implements the functions that were previously provided by Styled, working on member arrays rather than explicitly-passed arguments. It implements the same kind of static cache as MeasuredText. TextLine and MeasureText simulate arabic glyph generation and shaping by using ArabicShaping, ported with very minor changes from ICU4J's ArabicShaping. This class generates shaped Arabic glyphs and Lam-Alef ligatures using Unicode presentation forms. ArabicShaping is not intended to be permanent, but to be replaced by real shaping from the skia layer. It is introduced in order to emulate the behavior of real shaping so that higher level code dealing with rendering shaped text and cursor movement over ligatures can be developed and tested; it also provides basic-level support for Arabic. Since cursor movement depends on conjuncts whose formation is font-dependent, cursor movement code that was formerly in Layout and StaticLayout was moved into TextLine so that it can work on the shaped text. Other than these changes, the other major change is a rework of the ellipsize utility functions to combine multiple branches into fewer branches with additional state. Updated copyright notices on new files. Change-Id: I492cb58b51f5aaf6f14cb1419bdbed49eac5ba29
* check offset and don't crashMark Wagner2010-03-011-1/+5
|
* Add isPrintableAscii() and isPrintableAsciiOnly() to TextUtils.java as ↵Daisuke Miyakawa2009-12-031-0/+22
| | | | | | | | | hidden methods, and make vCard code use them. In the future, ContactsProvider will use those methods. See also the change 34604 Internal issue number: 2275764, 2195990
* Manual merge from cupcake_dcm. Need to be reviewed by enf.Daisuke Miyakawa2009-05-251-0/+11
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+1620
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-1620/+0
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-184/+81
|
* auto import from //branches/cupcake/...@127436The Android Open Source Project2009-01-221-3/+3
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-3/+156
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+1570