summaryrefslogtreecommitdiffstats
path: root/core/java/android/text
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Merge "Load hyphenation data for more languages." into mnc-devRoozbeh Pournader2015-06-031-21/+101
|\ \ \ \ | |/ / / |/| | |
| * | | Load hyphenation data for more languages.Roozbeh Pournader2015-05-281-21/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This loads hyphenation data for the languages we currently provide at initialization time. It also has a poor man's locale fallback mechanism for finding hyphenation patterns where the locale doesn't exactly match what may be available and caches the results. Bug: 20088132 Change-Id: If7b2a8d5295df9cb2bdae7418df27bf77fb44e58
* | | | Revert "Revert "Use getRunAdvance to position cursor""Raph Levien2015-06-012-6/+5
| | | | | | | | | | | | | | | | This reverts commit 5730c974800a0ffed59a041d9e249a5c42e417db.
* | | | Revert "Use getRunAdvance to position cursor"Raph Levien2015-06-012-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cb5499c85097450c48f66f6c08a35bab2ad5ab12. Bug: 21549197
* | | | Merge "Fix javadocs based on recent case consistency change" into mnc-devNeil Fuller2015-06-011-2/+2
|\ \ \ \
| * | | | Fix javadocs based on recent case consistency changeNeil Fuller2015-06-011-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a40d2447b6f516116135ee7f126579771ba98a2c made the case consistently "as for the beginning of a sentence". This updates the docs to reflect that. Previously the result depended on the string returned (e.g. "Tomorrow" was capitalized in English) and the casing varied within and between locales. Bug: 20247811 (cherry-picked from commit 0e1c0e11e41c85487349fcb719d2ab1d1823534e) Change-Id: I7b48958725b32b13bee00347585472f8073e7761
* | | | Use getRunAdvance to position cursorRaph Levien2015-05-282-6/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TextLine used to use getTextRunAdvances on a substring to compute a cursor position, but this had a number of problems, especially when the substring is a wider than the full string (as can happen in certain Tamil ligatures). This patch changes the implementation to use getRunAdvance, which was explicitly designed for this use case. We should also change Layout.getHorizontal to use the dual getOffsetForAdvance, but that's basically a performance optimization, the functionality should be basically equivalent. Bug: 21125816 Change-Id: I669b85eaecfbf6f7aa6c6a9dddbf1a210eb94571
* | | Make unicodeWrap() return null if the input string is null.Roozbeh Pournader2015-05-161-2/+4
| | | | | | | | | | | | | | | | | | | | | Previously, a NullPointerException was raised if the input was null. Bug: 12894042 Change-Id: I5c5db484e5659659c1da91079adcba773ba7d83d
* | | Merge "Fix issue where handle is in front of word rather than end of word" ↵Mady Mellor2015-05-131-0/+81
|\ \ \ | | | | | | | | | | | | into mnc-dev
| * | | Fix issue where handle is in front of word rather than end of wordMady Mellor2015-05-121-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous getWordEnd and getWordStart functions would return a boundary rather than a word end / start boundary in some cases. This behavior is most evident when moving between short lines -- the handle would go to the next boundary rather than the word end on the next line (and the start handle would go to the word end rather than the word start on the prev line). This CL ensures that word or punctuation boundaries are returned and moves most of the punctuation boundary logic into WordIterator since it makes a bit more sense there. Bug: 21030788 Change-Id: I96c6aff7f2c213aa3c4f66ac87ca913ca16fd347
* | | | Add hyphenationFrequency attribute to TextView and StaticLayout.Roozbeh Pournader2015-05-123-6/+55
|/ / / | | | | | | | | | | | | | | | | | | | | | This patch adds plumbing to TextView and StaticLayout to control the frequency of automatic hyphenation used in laying out paragraphs. Bug: 21038249 Change-Id: Ib45de190eb0a1ed738e69fd61f2b39561b11aec7
* | | Consider punctuation treatment when selecting text.Mady Mellor2015-05-071-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | This treats punctuation as "words", so groups of punctuation will be selected together, i.e. "Hmm... yay!!!" would be treated as four words: Hmm-...-yay-!!! Bug: 19950062 Change-Id: Ic9514c524092734fad1abdf19a736bfa1406157b
* | | Merge "Clear all StaticLayout.Builder fields on pool recycle" into mnc-devRaph Levien2015-05-061-0/+3
|\ \ \
| * | | Clear all StaticLayout.Builder fields on pool recycleRaph Levien2015-05-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When returning a StaticLayout.Builder object to the pool, it is important to clear everything out. If not, then the object may have stale state from a previous layout operation. This was causing CTS test failures and probably other mischief. Bug: 20636917 Change-Id: I76fb20076ee954fcb476131a8fbe8833d72fbc0d
* | | | Fix NPE in Html.inParagraph()Raph Levien2015-05-051-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | The typeface in a TypefaceSpan can be the null string. This patch fixes the string comparison to not throw a NullPointerException. Bug: 20849738 Change-Id: Ied049305794966bcbca00cfd11fe97a91b685d79
* | | Expose StaticLayout.Builder publiclyRaph Levien2015-05-012-18/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose the new Builder pattern for creating StaticLayout. This allows access to a number of features that have been available to TextView through a hidden constructor. Some of these features have existed for a while (mostly maxLines), while others are new (breakStrategy, indents). The builder is cleaner and has a better upgrade path than the old pattern of lots of constructors with varying numbers of arguments. Bug: 20190561 Change-Id: Ia3cd124825ab0cb469d22d1fc576ad26454545b8
* | | Make Paint a required field of StaticLayout BuilderRaph Levien2015-04-302-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the Paint parameter from being an option set from setPaint to being a required field passed into the obtain() method of StaticLayout.Builder. Thus, it is now possible to get a valid StaticLayout object just doing .build() on the Builder; all other fields are optional. This is in preparation for exposing the builder publicly, but that is to be a separate CL. Bug: 20190561 Change-Id: Iefd7800203004e565d068b0c76502cf7cf52d91f
* | | Merge "Enable mouse drag text selection for unfocused TextView."Keisuke Kuroyanagi2015-04-201-16/+23
|\ \ \
| * | | Enable mouse drag text selection for unfocused TextView.Keisuke Kuroyanagi2015-04-161-16/+23
| | | | | | | | | | | | | | | | | | | | Bug: 17643755 Change-Id: If6ca064a082feaf6faf9555b1455c4b2f6312952
* | | | Merge "Stop Shift+Backspace from foward deleting."Michael Wright2015-04-161-1/+1
|\ \ \ \
| * | | | Stop Shift+Backspace from foward deleting.Michael Wright2015-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 17538139 Change-Id: Ia193c59058d99880ea5afe5bd1bbcc0dce97f9d4
* | | | | Merge "Fix various conformance issues with TextDirectionHeuristics."Roozbeh Pournader2015-04-161-40/+80
|\ \ \ \ \
| * | | | | Fix various conformance issues with TextDirectionHeuristics.Roozbeh Pournader2015-04-151-40/+80
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The algorithms no longer consider directional embeddings and overrides as strong characters. 2. The algorithms are updated to Unicode 7.0, and consider the directional isolates in determining the direction of input. 3. Codepoints are used instead of code units for looking up bidi properties. 4. The bidi direction of unassigned characters is considered. Bug: 20142480 Change-Id: I9be161c112b8f23565ed8961bb7d44ced234f67a
* | | | | Add left and right indent arrays to TextViewRaph Levien2015-04-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In support of layout of paragraphs to non-rectangular regions, add arrays for left and right indents to TextView, along with supporting StaticLayout builder setters. Bug: 20182243 Change-Id: I015bcef8f258c89001fcf8a54c179d2dfc0d7943
* | | | | Merge "Fix crash when ellipsize="start" is applied to short line."Keisuke Kuroyanagi2015-04-151-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Fix crash when ellipsize="start" is applied to short line.Keisuke Kuroyanagi2015-04-141-1/+1
| |/ / / | | | | | | | | | | | | | | | | Bug: 19833548 Change-Id: I05a36f00f5c7aa6f0ce1993337585f6cfc64649a
* | | | Introduce Ctrl+Backspace/Ctrl+ForwardDelete shortcut.Seigo Nonaka2015-04-101-8/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ctrl+Backspace deletes preceding one word and Ctrl+ForwardDelete delets following one word. Used Chrome's implementation/behvior as a reference. Bug: 17810742 Change-Id: I7b2ca515b2f017e457f7104ec7b8e7473ca4e081
* | | | Use TextView's text locale for capitalization.Seigo Nonaka2015-04-091-4/+17
|/ / / | | | | | | | | | | | | BUG: 19284889 Change-Id: Icd3c1dd3b31c23025bc974bcbb5a3618196434e7
* | | Merge "Clear hyphenEdit from Layout's paint"Raph Levien2015-04-081-0/+1
|\ \ \
| * | | Clear hyphenEdit from Layout's paintRaph Levien2015-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The paint of a layout may be reused with other things (in particular, it can be passed to a BoringLayout), so make sure the hyphenEdit is zeroed out after use. Change-Id: If58c5588af9642c3ba827acefea7895e814daab9
* | | | am 5b61a282: am e4d787b2: am 80e455e3: Merge "Prevent possible memory leak ↵Romain Guy2015-04-081-3/+10
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | in SpanSet" * commit '5b61a282255b5273f5194db73f3c88550dc11a57': Prevent possible memory leak in SpanSet
| * | Prevent possible memory leak in SpanSetRomain Guy2015-04-071-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If SpanSet.init() is called several times in a row with different values, it is possible to change "numberOfSpans" in a way that will prevent SpanSet.recycle() from nulling out all the spans. This can lead to memory leaks of large objects through spans references. User @piwai reported this leak: com.squareup.marketfont.MarketSpan `-[1] of array android.text.style.CharacterStyle[] `-spans of object android.text.SpanSet `-mCharacterStyleSpanSet of object android.text.TextLine `-[1] of array android.text.TextLine[] `-sCached of class android.text.TextLine The MarketSpan instance is kept alive through a recycled TextLine which itself contains a SpanSet. Change-Id: Idfb2233ca16895dbe735c312662eaf0b4a2ecd65
* | | Merge "Load hyphenation data at Zygote init"Raph Levien2015-04-061-11/+22
|\ \ \
| * | | Load hyphenation data at Zygote initRaph Levien2015-04-061-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loading hyphenation data on demand can cause UI jank (and can be a strict mode violation). This patch explicitly loads the data at Zygote init time. It also chooses /system/usr/hyphen-data as the path for this data. Bug: 20060770 Change-Id: Idac68e3971f8638f1d70960594bf6c1050bb23d6
* | | | Add breakStrategy attribute to TextViewRaph Levien2015-04-013-38/+94
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds plumbing to TextView to control the strategy used for breaking paragraphs into lines. The default for TextView is "quality", while the default for EditText is "simple", largely to avoid too much re-layout when editing. StaticLayout now has a builder which provides access to more functionality and is also cleaner than the old mechanism of having lots of constructors with varying numbers of arguments. This patch changes TextView to use that builder, and also contains cleanups of the Builder within StaticLayout. Change-Id: Iee3cf3a05a3e51ba0834554e4a3ec606e9cabca5
* | | Revert "Fix build: Revert "Record hyphens from Minikin and draw them""Raph Levien2015-03-305-29/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5a6eeb3cbe0896ddf4bdccc0b1a81d7aac49821e and fixes the underlying issue (needed to @hide getHyphen() for subclasses of Layout, not just the base class), and layoutlib changes for checkbuild. Change-Id: I7a2b5f20ae014ea8e224d8c4079cf9131e17e1c1
* | | Merge "Fix build: Revert "Record hyphens from Minikin and draw them""Ed Heyl2015-03-305-139/+29
|\ \ \
| * | | Fix build: Revert "Record hyphens from Minikin and draw them"Ed Heyl2015-03-305-139/+29
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 27fb878c04e18d3bdd6c42ed347194a7c816ed97. Change-Id: I2b3390cb0b258a2e1a38ad72ae9686177d6ffdb8
* | | | Merge "Record hyphens from Minikin and draw them"Raph Levien2015-03-305-29/+139
|\ \ \ \ | |/ / /
| * | | Record hyphens from Minikin and draw themRaph Levien2015-03-275-29/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch plumbs up hyphens computed in Minikin's LineBreaker, records them in a new column in StaticLayout, and draws them. DynamicLayout mirrors the new column, and TextLine is also changed to make sure the hyphen is only drawn for the last run in a line. There is a rather primitive mechanism for loading hyphenation patterns, for testing only at this point. Change-Id: Ib208568c0f6cff12cf834047500ec1da9ea9f430
* | | | Merge "Document that Time doesn't support pseudo-zones."Elliott Hughes2015-03-271-0/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Document that Time doesn't support pseudo-zones.Elliott Hughes2015-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | Bug: 19110194 Change-Id: I653b7dc46d5f15da70435f6bddd49042f4d03b54
* | | | Calculate line breaks using MinikinRaph Levien2015-03-262-26/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the calculation of line breaks for StaticLayout into the new LineBreaker class provided by Minikin. This specific patch should preserve existing functionality, but perhaps performance is better, and the movement opens the door to much more sophisticated line-breaking. Change-Id: Iafccb9da4e3559bbeaeb2c7c85f86ddfd8ae2fa1
* | | | am 46c95313: am ddb30cd3: am 7506f499: Merge "Fix to crash when clicking ↵Alan Viverette2015-03-251-1/+7
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | text link without view activity" * commit '46c953138298285d9cb06a75030fc73081ccc121': Fix to crash when clicking text link without view activity
| * | | Merge "Fix to crash when clicking text link without view activity"Alan Viverette2015-03-251-1/+7
| |\ \ \
| | * | | Fix to crash when clicking text link without view activityDaniel 2 Olofsson2014-12-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A generated quick link to telephone number gets clicked and crashes if corresponding activity doesn't exist in device. It attempts to open up an activity to view content which will in turn generate an uncaught ActivityNotFoundException. Solved by catching exception when launching activity for the specified content. Change-Id: I47364519f1eceb5b978b29382107deae1891c7da
* | | | | Make Html#toHTML() generate correct bidi directions.Roozbeh Pournader2015-03-231-7/+9
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, after the first paragraph, the the detected bidi direction of the text in the last paragraph was used, nstead of the detected bidi direction of the current one. Bug: 12027356 Change-Id: I51622a3156f1e321f53f7ca1855bc37aa6f77319
* | | | Replace usages of deprecated Resources.getColor() and getColorStateList()Alan Viverette2015-03-181-1/+1
| | | | | | | | | | | | | | | | Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
* | | | Merge "Improve undo support for text entered with IME"James Cook2015-03-181-0/+19
|\ \ \ \
| * | | | Improve undo support for text entered with IMEJames Cook2015-03-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use span properties to detect: * Composing text - don't record undo operations * Completing a composition - record an insert undo operation * Canceling a composition - don't record Save the composition state on parcel/unparcel. Stop using begin/end batch edit to try to detect when a TextWatcher is modifying the text. IMEs trigger multiple InputFilter passes in a single batch edit. Use SpannableStringBuilder to determine when we're in a TextWatcher callback because it is the authority on that state. Fix a bug in undo manager where it doesn't forget undos correctly if there are more than one in the stack. Bug: 19332904 Change-Id: Iaa9b0b2a7bf6683302cc85e7616e5d5fcc9fa202