138b106402d86653eaf296a02708737a6e360b58 |
|
09-May-2018 |
Mihai Popa <popam@google.com> |
Optimise the hit test algorithm Layout#getOffsetForHorizontal was running in O(n^2) time, where n is the length of the current line. The method is used when a touch event happens on a text line, to compute the cursor offset (and the character) where it happened. Although this is not an issue in common usecases, where the number of characters on a line is relatively small, this can be very inefficient as a consequence of Unicode containing 0-width (invisible) characters. Specifically, there are characters defining the text direction (LTR or RTL), which cause our algorithm to touch the worst case quadratic runtime. For example, a person is able to send a message containing a few visible characters, and also a lot of these direction changing invisible ones. When the receiver touches the message (causing the Layout#getOffsetForHorizontal method to be called), the receiver's application would become not responsive. This CL optimizes the method to run in O(n) worst case. This is achieved by computing the measurements of all line prefixes at first, which can be done in a single pass. Then, all the prefix measurement queries will be answered in O(1), rather than O(n) as it was happening before. Bug: 79215201 Test: manual testing Change-Id: Ib66ef392c19c937718e7101f6d48fac3abe51ad0 Merged-In: Ib66ef392c19c937718e7101f6d48fac3abe51ad0
/frameworks/base/core/java/android/text/Layout.java
|
4e90fa262d57c1c1ee72166e2ddfce391696ca24 |
|
13-Feb-2018 |
Seigo Nonaka <nona@google.com> |
Revert "Reorganize MeasuredText API" The last change needs more discussion and found some edge cases. Revert and make small step-by-step changes. Bug: 73091756 This reverts commit 7fd36d19e309ea515b4048cfaabb8035ceab7baf. Change-Id: I89ff52a70cf6a5d6c553afa20f83719e1f9eb726
/frameworks/base/core/java/android/text/Layout.java
|
7fd36d19e309ea515b4048cfaabb8035ceab7baf |
|
02-Feb-2018 |
Seigo Nonaka <nona@google.com> |
Reorganize MeasuredText API This CL changes the MeasuredText API: - Rename MeasuredText to PrecomputedText. - PrecomputedText is no longer a Spanned. - 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) Here is a performance scores: (median, walleye-userdebug, N=20) StaticLayout creation time (w/o patch -> w/ patch) PrecomputedText Balanced Hyphenation : 743,615 -> 737,145: (-0.9%) PrecomputedText Balanced NoHyphenation: 551,544 -> 542,715: (-1.6%) PrecomputedText Greedy Hyphenation : 500,343 -> 499,601: (-0.1%) PrecomputedText Greedy NoHyphenation : 497,987 -> 492,587: (-1.1%) RandomText Balanced Hyphenation : 19,100,592 -> 19,135,289: (+0.2%) RandomText Balanced NoHyphenation : 8,015,088 -> 7,954,260: (-0.8%) RandomText Greedy Hyphenation : 7,950,915 -> 7,877,424: (-0.9%) RandomText Greedy NoHyphenation : 7,939,337 -> 7,863,471: (-1.0%) PrecomputedText creation time (w/o patch -> w/ patch) NoStyled Hyphenation : 18,935,638 -> 18,925,422: (-0.1%) NoStyled Hyphenation WidthOnly : 18,469,726 -> 18,978,413: (+2.8%) NoStyled NoHyphenation : 7,940,792 -> 7,919,127: (-0.3%) NoStyled NoHyphenation WidthOnly : 7,463,230 -> 7,922,643: (+6.2%) Styled Hyphenation : 14,822,501 -> 14,809,017: (-0.1%) Styled Hyphenation WidthOnly : 13,891,770 -> 14,656,617: (+5.5%) Styled NoHyphenation : 14,511,134 -> 14,301,503: (-1.4%) Styled NoHyphenation WidthOnly : 13,495,345 -> 14,264,314: (+5.7%) StaticLayout draw time (w/o patch -> w/ patch) PrecomputedText NoStyled : 663,974 -> 661,610: (-0.4%) PrecomputedText NoStyled WithoutCache : 648,294 -> 648,766: (+0.1%) PrecomputedText Styled : 879,322 -> 852,770: (-3.0%) PrecomputedText Styled WithoutCache : 1,084,570 -> 1,110,147: (+2.4%) RandomText NoStyled : 565,682 -> 555,435: (-1.8%) RandomText NoStyled WithoutCache : 9,070,533 -> 9,064,825: (-0.1%) RandomText Styled : 2,955,202 -> 2,962,008: (+0.2%) RandomText Styled WithoutCache : 12,242,325 -> 12,228,573: (-0.1%) Bug: 67504091 Bug: 73091756 Test: bit FrameworksCoreTests:android.text. Test: atest CtsWidgetTestCases:EditTextTest \ CtsWidgetTestCases:TextViewFadingEdgeTest \ FrameworksCoreTests:TextViewFallbackLineSpacingTest \ FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \ CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest \ CtsTextTestCases Change-Id: I7db9e2ca4db68a16648cfb8fcf63555f501304c2
/frameworks/base/core/java/android/text/Layout.java
|
9d3bd08ebab564ed9231c8ee112e8085cda74ce8 |
|
11-Jan-2018 |
Seigo Nonaka <nona@google.com> |
Rename PremeasuredText to MeasuredText There is already MeasuredText, so renamed existing MeasuredText to MeasuredParagraph, then renamed PremeasuredText to MeasuredText. Bug: 67504091 Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest Test: bit CtsTextTestCases:* Change-Id: Ie20bea9501b18fabb36f64d388a7851c4643d4c3
/frameworks/base/core/java/android/text/Layout.java
|
ce8db9911494225fcd99711d7df85a130de5a6ce |
|
14-Dec-2017 |
Jeff Sharkey <jsharkey@android.com> |
Add more IntDef prefixes for auto-documenting. Test: builds, boots Bug: 70177949 Exempt-From-Owner-Approval: annotation-only changes Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
/frameworks/base/core/java/android/text/Layout.java
|
f1644f735de3a940d429c42ec920348e96a4d14e |
|
28-Nov-2017 |
Seigo Nonaka <nona@google.com> |
Refactor MeasuredText This is 2nd attempt of I58d3020a3fa560d05576e18888fbfe46e2975e8f The root cause of the crash is passing end offset instead of passing length. This CL contains that fix and also has a test case for that. This refactoring contains: - Add lots of comments. - Mark private the internal fields and introduce accessors and helper methods. - Factor out the auto grow array implementation to another class. - Use SynchronizedPool for pool implementation. - Introduce three build methods for each use case. - Hide addStyleRun and compute all necessary informations in build method. Locally verified that this doesn't cause performance regressions. Here is a raw performance test result on walleye-userdebug. StaticLayoutPerfTest (median, N=100): createRandom: 7,846,449 -> 8,003,903 (+2.01%) createRandom Balanced: 7,810,436 -> 7,919,200 (+1.40%) TextViewOnMeasurePerfTest (median, N=100): measure_AtMost: 94,276,376 -> 94,124,658 (-0.16%) measure_Exactly: 91,629,352 -> 91,617,639 (-0.01%) measure_Unspecified: 151,006,181 -> 150,957,598 (-0.03%) Test: bit CtsTextTestCases:* Test: bit CtsGraphicsTestCases:* Test: bit CtsWidgetTestCases:* Test: bit FrameworksCoreTests:android.text.StaticLayoutTest Bug: 65024629 Bug: 70146381 Change-Id: I772f60444d0fe87f59609977af5ef712cab3eb37
/frameworks/base/core/java/android/text/Layout.java
|
4674e642a54e1db2028c4485383994fff2af559d |
|
04-Dec-2017 |
Seigo Nonaka <nona@google.com> |
Revert "Refactor MeasuredText" This reverts commit 75492afb1b6566c889025e9ca0a15a0d0fe422aa. Reason for revert: 70146381 Change-Id: Ibb6433b5e02608326ef51cc16d8d5d8efa86beec
/frameworks/base/core/java/android/text/Layout.java
|
75492afb1b6566c889025e9ca0a15a0d0fe422aa |
|
28-Nov-2017 |
Seigo Nonaka <nona@google.com> |
Refactor MeasuredText This refactoring contains: - Add lots of comments. - Mark private the internal fields and introduce accessors and helper methods. - Factor out the auto grow array implementation to another class. - Use SynchronizedPool for pool implementation. - Introduce three build methods for each use case. - Hide addStyleRun and compute all necessary informations in build method. Locally verified that this doesn't cause performance regressions. Here is a raw performance test result on walleye-userdebug. StaticLayoutPerfTest (median, N=100): createRandom: 7,846,449 -> 8,003,903 (+2.01%) createRandom Balanced: 7,810,436 -> 7,919,200 (+1.40%) TextViewOnMeasurePerfTest (median, N=100): measure_AtMost: 94,276,376 -> 94,124,658 (-0.16%) measure_Exactly: 91,629,352 -> 91,617,639 (-0.01%) measure_Unspecified: 151,006,181 -> 150,957,598 (-0.03%) Test: bit CtsTextTestCases:* Test: bit CtsGraphicsTestCases:* Test: bit CtsWidgetTestCases:* Test: bit FrameworksCoreTests:android.text.StaticLayoutTest Bug: 65024629 Change-Id: I58d3020a3fa560d05576e18888fbfe46e2975e8f
/frameworks/base/core/java/android/text/Layout.java
|
b90e08f92ee2834f529937fc90265fee42b32254 |
|
21-Oct-2017 |
Seigo Nonaka <nona@google.com> |
Reorganize JNI in StaticLayout This CL reorganize the JNI strategy as follows: - Remove nNewBuilder/nFreeBuilder. - Make addStyleRun/addReplacementRun CriticalNative. - Remove nSetupParagraph and pass necessary arguments to nComputeLineBreaks instead. Here is a performance scores: (w/o patch -> w/ patch) StaticLayoutPerfTest (median): createRandom: 3,755,090 -> 3,781,394 (+0.70%) createRandom Balanced: 3,702,837 -> 3,730,435 (+0.74%) TextViewOnMeasurePerfTest (median): measure_AtMost: 39,172,360 -> 35,883,014 (-8.4%) measure_Exactly: 38,005,066 -> 34,585,052 (-9.0%) measure_Unspecified: 67,191,780 -> 63,100,545 (-6.1%) Bug: 65024629 Test: bit CtsTextTestCases:* Test: bit CtsWidgetTestCases:* Change-Id: If9db1fdd2b03a1cf240f87322c1e852cf8085fff
/frameworks/base/core/java/android/text/Layout.java
|
a273a70ecbb0d1aaf9aeceec7aa91591290a4871 |
|
05-Oct-2017 |
Siyamed Sinir <siyamed@google.com> |
Removed unused variables from text layout code Test: None Change-Id: I890c3d260edd0570259db5089dcb37f79c2e56e9
/frameworks/base/core/java/android/text/Layout.java
|
69ddece0b061a3cc024f191bdd3171e4e81118a5 |
|
28-Sep-2017 |
Petar Šegina <psegina@google.com> |
Merge "Update referenced constant names for Directions"
|
9a9179d48d9d845d640192cd83b8d9a090d6c995 |
|
29-Aug-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Take padding information into StaticLayout This is useful for figuring out if we should adjust width of text in case the overhangs are more than available padding. Bug: 63938206 Test: pending Change-Id: I04592a7cbce264fe133e17e4df0daee626a99d85
/frameworks/base/core/java/android/text/Layout.java
|
7c31d5c80d7bd4de3902cf06ea1d1e90b4cadfcd |
|
25-Sep-2017 |
Petar Šegina <psegina@google.com> |
Update referenced constant names for Directions The new constants were introduced in [1] 9f7a444, but the comment used the wrong prefix - DIR_ instead of RUN_ in the actual names. [1] Change-Id Iea8bb46c678a18820e237c90f76007a084c83051 Commit hash 9f7a4442b89cc06cb8cae6992484e7ae795323ab Test: comment update, no tests performed Change-Id: I4e13600b16ebd9be7ac40cf6c6292ea13f0806c2
/frameworks/base/core/java/android/text/Layout.java
|
8f1f74e23964d3f96a985b9ae5b477ff9c39dabb |
|
07-Sep-2017 |
Petar Šegina <psegina@google.com> |
Move consumer call outside of the branch Test: bit FrameworksCoreTests:android.text.LayoutTest Change-Id: I4fae9d2b16c22e7ab3856959edc5a57f4276f22f
/frameworks/base/core/java/android/text/Layout.java
|
3a92fb632b6509610c5c3bf2a117631816a56899 |
|
07-Sep-2017 |
Petar Šegina <psegina@google.com> |
Move IntDef constant definitions outside of the annotation Constant definitions do not currently work in bat_land - they are not reachable from the test, thus breaking the build. Test: lunch bat_land && make tests Test: bit FrameworksCoreTests:android.text.LayoutTest Bug: 65449093 Change-Id: I6c71fe13fc86a8e2a17e49b16fd558c6714c6f5b
/frameworks/base/core/java/android/text/Layout.java
|
b92c539232900537d5005bcf7cbc8950ff7f42d9 |
|
06-Sep-2017 |
Petar Šegina <psegina@google.com> |
Emit text direction with selection rectangle In order to properly perform the smart select animation on right-to-left and mixed text, we need the information about the direction of the text that is present below the selection rectangle. Test: manual - verify selection still works and that the generated directions match the directions of the text on the screen Test: bit FrameworksCoreTests:android.text.LayoutTest Change-Id: I564ee2db59ab583c9bff807ad0d0dfeacaf1386f
/frameworks/base/core/java/android/text/Layout.java
|
53aba29e425a62878ee1670d7d146ba94b25a0fd |
|
26-Aug-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Correct missed use of work paint for hyphenation The change in I0b95a10c05711350950d6c8d6501f6af9414d413 copied the Paint to a work paint to make sure we don't modify it, but missed actually using that Paint, resulting in hyphenation basically getting ignored in getLineExtent(). Now we correctly pass the work paint to the TextLine used. Change-Id: Ida89ba2b11d35d93012abb0adf9bb29d1b09c2d2 Fixes: 64998667 Bug: 33388205 Bug: 64452136 Test: bit FrameworksCoreTests:android.widget.TextViewTest Test: bit FrameworksCoreTests:android.text. Test: bit CtsTextTestCases:android.text.cts.
/frameworks/base/core/java/android/text/Layout.java
|
22a167cac8f585ffd3ca73e40b82a26c1e09df11 |
|
21-Aug-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Add a builder for DynamicLayout and switch TextView to it The builder mostly copies the structure and the logic of StaticLayout. We also improve various parts of code and documentation in StaticLayout's builder. Bug: 28963299 Test: bit FrameworksCoreTests:android.text. Test: bit FrameworksCoreTests:android.widget.TextViewTest Test: bit CtsTextTestCases:* Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest Change-Id: I5c4a6e031bd0f41f765a3d85e0b9b7e9be42ad4b
/frameworks/base/core/java/android/text/Layout.java
|
01f05dd3d13e4176255333fa164b7e49bcc9e5de |
|
10-Aug-2017 |
Petar Šegina <psegina@google.com> |
Merge "Add getSelection(..., RectangleConsumer) to Layout"
|
fb748b357cec2fc8244cce5af8486a72756ded41 |
|
07-Aug-2017 |
Petar Šegina <psegina@google.com> |
Add getSelection(..., RectangleConsumer) to Layout In order to generate the Smart Select animation, we need a list of rectangles which represent a given selection. The current getSelectionPath code can only fill out a Path, which loses the rectangle information in the process. Instead of working directly with a Path, a RectangleConsumer is introduced, which is an abstraction over an element that can accept rectangles (for example, a Path or a List<Rect>). getSelectionPath is now implemented with this new method using a simple consumer which takes the rectangles and feeds them to the path. Test: cts-tradefed run cts-dev -m CtsWidgetTestCases -d -t android.widget.cts.TextViewTest#testGetFocusedRect Test: manual - verify text selection still works Change-Id: I32a24f237a4b1b89df23c982fe06566f30fec464
/frameworks/base/core/java/android/text/Layout.java
|
b1f0365dc4283fda926d5ff9f35c042220022ff6 |
|
09-Aug-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Make sure Layout doesn't modify the paint Previously, Layout would modify the HyphenEdit of the Paint passed to it for its internal operations, potentially leaving the Paint in a different status than when it was created. Now we use an internal copy of the Paint to modify. Fixes: 64452136 Test: bit CtsTextTestCases:android.text.cts. Test: bit FrameworksCoreTests:android.text. Change-Id: I0b95a10c05711350950d6c8d6501f6af9414d413
/frameworks/base/core/java/android/text/Layout.java
|
917748ef5016c1f54875c35f999ba9bcda12557d |
|
04-Aug-2017 |
Seigo Nonaka <nona@google.com> |
Improve TextView.onMeasure() for multiline text. Previously, measures all paragraph for deciding view width. However, in case AT_MOST measurment, we can stop calculating measure if the measured paragraph already exceeds the upper limit. Bug: 64389125 Test: bit CtsWidgetTestCases:* Test: CorePerfTest. Here is a result before and after this patch. Before: INSTRUMENTATION_STATUS: measure_AtMost_median=50332114 INSTRUMENTATION_STATUS: measure_Exactly_median=28276317 INSTRUMENTATION_STATUS: measure_Unspecified_median=50193036 After: INSTRUMENTATION_STATUS: measure_AtMost_median=28475187 INSTRUMENTATION_STATUS: measure_Exactly_median=26944710 INSTRUMENTATION_STATUS: measure_Unspecified_median=50880088 Change-Id: I2a39eb39817a8f845c4fa2e174a905a2d057096e
/frameworks/base/core/java/android/text/Layout.java
|
7f0ebc944d49ffc1a5f269bad6acea6112a67261 |
|
03-Aug-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Revert "Make ellipsize retry if text doesn't fit" This reverts commit 1051bbe325a2fac9d5b074367d878318e2326485. Bug: 64312574 Change-Id: I6a3456172e22e94df30dcbe90988db8592886a78
/frameworks/base/core/java/android/text/Layout.java
|
1051bbe325a2fac9d5b074367d878318e2326485 |
|
25-Jul-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Make ellipsize retry if text doesn't fit This fixes the cases where the replacement of parts of text with ellipsis may result in more-than-expected width of text due to contextual width changes in the font, such as kerning or Arabic shaping. The calculations in TextUtils.ellipsize() and StaticLayout are fixed to recalculate the new width and reduce it further until the text actuall fits. BoringLayout and DynamicLayout get fixed too since they use the other two implementations indirectly. Also reverse a recently-introduced incorrect check for multi-character ellipsis in Layout.java. Fixes: 31537595 Fixes: 64156587 Test: Manual (Arabic edge cases ellipsize correctly) Test: bit CtsTextTestCases:* Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest Test: bit CtsWidgetTestCases:android.widget.cts.CheckedTextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.AutoCompleteTextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.MultiAutoCompleteTextViewTest Test: bit FrameworksCoreTests:android.text. Test: adb shell am instrument -w com.android.documentsui.tests/android.support.test.runner.AndroidJUnitRunner Change-Id: I74fdaa9bf32dc2064eeb702f7f9b78b2bb856c26
/frameworks/base/core/java/android/text/Layout.java
|
a60b59d1cc2d2d2938beb0bd34e1abbab7d65cbb |
|
26-Jul-2017 |
Siyamed Sinir <siyamed@google.com> |
Fix EditText cursor when line spacing is set Test: bit FrameworksCoreTests:android.widget.TextViewTest Test: bit FrameworksCoreTests:android.widget.EditorCursorTest Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest Bug: 30870806 Change-Id: I54f014b06af328c3e9a9c4ddb5a3348a26e290c2
/frameworks/base/core/java/android/text/Layout.java
|
c94801f816cfb98ef82e2af20849e4805e335c06 |
|
26-Jul-2017 |
Siyamed Sinir <siyamed@google.com> |
Merge "Store line extra in layouts"
|
0fa89d6f62c31a033a9dece9c7cfee2d50dc063d |
|
25-Jul-2017 |
Siyamed Sinir <siyamed@google.com> |
Store line extra in layouts StaticLayout and Dynamic layout changes the values of line bottom and descent according to linespacing modification attributes. This loses information of the real line descent and bottom, which causes some utilities not to be able to draw themselves in correct positions. Examples are cursor drawing to the empty space, BulletSpan not being able to vertically center itself in the line, and DynamicLayout not being able to calculate the last line height properly. This CL stores the extra added to bottom and descent values so that it can be used later. Test: bit CtsTextTestCases:android.text.cts.LayoutTest Test: bit CtsTextTestCases:android.text.cts.StaticLayoutTest Test: bit CtsTextTestCases:android.text.cts.DynamicLayoutTest Test: bit FrameworksCoreTests:android.text.LayoutTest Test: bit FrameworksCoreTests:android.text.StaticLayoutTest Test: bit FrameworksCoreTests:android.text.DynamicLayoutTest Test: bit FrameworksCoreTests:android.text.DynamicLayoutBlocksTest Bug: 30870806 Bug: 33138492 Bug: 25194907 Change-Id: I7a1039e71e4999c75b5f26122fe6239e3ee24868
/frameworks/base/core/java/android/text/Layout.java
|
9ea756fa7047a70ade7bc9d3c06d00605addf211 |
|
25-Jul-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Refactor ellipsis attributes and methods Mostly changed to avoid repetition of code and remove the assumptions about ellipsis being one code unit. The code for multi-code unit ellipsis is not triggered yet, but is done in preparation for potential future locale-dependent cases. Test: bit CtsTextTestCases:* Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest Test: bit CtsWidgetTestCases:android.widget.cts.CheckedTextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.AutoCompleteTextViewTest Test: bit CtsWidgetTestCases:android.widget.cts.MultiAutoCompleteTextViewTest Test: adb shell am instrument -w -e package android.text com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Change-Id: Id1dfdc503f87fabed2447d55ab2107eee0eccd08
/frameworks/base/core/java/android/text/Layout.java
|
7557a5a090204dccfd32096af4a6ded1f9bb5b17 |
|
12-Apr-2017 |
Roozbeh Pournader <roozbeh@google.com> |
Revert "Make selection end handle stick to selection at line end." This reverts commit 7c263ddd582abacbbe9c71341a6ef4c704d12100. Fixes: 35944608 Bug: 21305922 Test: Manual Test: Updated CTS and core tests pass. Change-Id: Ic840f8771c3d5850f4f6f44ea199b144cac740c0
/frameworks/base/core/java/android/text/Layout.java
|
4b4730d90eef9dd4140cf750e2feba61acae9044 |
|
31-Mar-2017 |
Seigo Nonaka <nona@google.com> |
Change justification parameter from boolean to int. Bug: 35766005 Bug: 35764323 Test: Manually done Change-Id: Ic6d78bb9a3213160cd013f1ca8294307872bf0d0
/frameworks/base/core/java/android/text/Layout.java
|
846946ec06e4f7b31d5a414f026ef03e13793df7 |
|
13-Jan-2017 |
Keisuke Kuroyanagi <ksk@google.com> |
Merge "Make selection end handle stick to selection at line end."
|
7c263ddd582abacbbe9c71341a6ef4c704d12100 |
|
12-Jan-2017 |
Keisuke Kuroyanagi <ksk@google.com> |
Make selection end handle stick to selection at line end. At line break, one offset can be mapped to two phisical position: previous line end and next line start. Previously, all cursor handles are placed at next line start. With this CL, selection end handle is placed at the previous line end in such cases. Test: FrameworksCoreTests Bug: 21305922 Change-Id: I00d9f9a0cd417ca92534e93b3d3f655cd62f25d3
/frameworks/base/core/java/android/text/Layout.java
|
09da71a6dcfe07e0efdc35933322fba16091f555 |
|
28-Nov-2016 |
Seigo Nonaka <nona@google.com> |
Introduce full justification. Adds a new get/setJustify API to TextView and StaticLayout.Builder for justification, and fully justifies text when it's enabled. This is based on a patch by Raph Levien (raph@google.com). Bug: 31707212 Test: Manually done and CTS will introduced with I0f3bbf39d60a66b71b30e1351f7c741208f05dce passes. Change-Id: Icbfab2faa11a6a0b52e6f0a77a9c9b5ef6e191da
/frameworks/base/core/java/android/text/Layout.java
|
9863f67469794af8b63666126e5d60b4eed7cdeb |
|
14-Dec-2016 |
Seigo Nonaka <nona@google.com> |
Fix getLineExtent for hyphen width. Need to set hyphen edit before measuring line. Bug: 33388205 Test: Manually done Change-Id: I32b1639d03ddd9bddb1f3ab34b577544ae358a6a
/frameworks/base/core/java/android/text/Layout.java
|
9aba698bd11b01a3c85884c425a5a16c2ef6e83c |
|
08-Nov-2016 |
Siyamed Sinir <siyamed@google.com> |
Merge "StaticLayout visual fix for maxLines"
|
fcef4a3b62a34cdf1114ee34a5cd9432fc5ffffa |
|
30-Jun-2016 |
Siyamed Sinir <siyamed@google.com> |
Merge "Visibility fixes for text related tests."
|
ed09ae1fccfb1c02109a0c1428ddff52daa939d5 |
|
16-Feb-2016 |
Siyamed Sinir <siyamed@google.com> |
Visibility fixes for text related tests. Some of the text and text layout related tests fail because of the visibility of parameters/functions they use. This CL updates annotations and visibility of related classes. Bug: 29871441 Change-Id: Ia06072815261379ff839c440482d94570ec05a80
/frameworks/base/core/java/android/text/Layout.java
|
79bf9d19f2f76cbfbd6659c9323e519deaa887c7 |
|
19-May-2016 |
Siyamed Sinir <siyamed@google.com> |
Fix bidi desired width calculation Layout.getDesiredWidth measured text with TextDirectionHeuristics.LTR, whereas the real calculations used the active direction heuristic set in the TextView instance. This CL uses the same heuristics for both of them by passing the value to Layout.getDesiredWidth function. Bug: 28845953 Change-Id: I68d23f55fe5a86255d62e83bc62df38a047e4bca
/frameworks/base/core/java/android/text/Layout.java
|
0745c729653eeeeb6468d4ec9f3ec81b18ff9b64 |
|
01-Jun-2016 |
Siyamed Sinir <siyamed@google.com> |
StaticLayout visual fix for maxLines When maxLines is set on StaticLayout, the height calculation includes the lineSpacing for the lastLine, which causes the ellipsized version and non-ellipsized version to have different heights. With this CL: * maxLines is always set on StaticLayout * the correct line count for a given text is preserved, in other words a text that would be n lines will not be cut at maxLines. * The visual height for StaticLayout for ellipsized and non-ellipsized cases are the same when maxLines is set. Bug: 28988744 Bug: 18864800 Change-Id: I1e1cae31cf33d503a8cf1c942f422893efc480bb
/frameworks/base/core/java/android/text/Layout.java
|
f0bb87b7c40efeeaee58d4c7b767961c9800463e |
|
08-Feb-2016 |
Keisuke Kuroyanagi <ksk@google.com> |
Improve selection handle behavior for bidi text. A point on a direction boundary can be mapped to two offset and one offset on a direction boundary can be mapped to two points. Previously, paragraph's primary direction is always used for deciding offset and coordinates; thus, handle movement around a direction boundary is often nonintuitive. With this CL: 1. For selection end handle, direction of character at offset - 1 is used for deciding handle shape and position. 2. For getting offset from coordinates, previous offset is used to minimize the offset delta and primary . 3. For getting coordinates form offset, new logic chooses primary or secondary horizontal coordinate depending on the current run direction and paragraph direction. 4. When a handle passes another one because it passes a direction boundary, new logic keeps the handle at the run boundary instead of minimizing the selection. Bug: 19199637 Bug: 21480356 Bug: 21649994 Change-Id: I2a7e87ad08416f4bd01a5f68e006240f77d9036b
/frameworks/base/core/java/android/text/Layout.java
|
fa05ba0b0d39fae1d2cb3d98fbee0aef6a9fed88 |
|
12-Jan-2016 |
Siyamed Sinir <siyamed@google.com> |
Sort the result of SpannableStringBuilder.getSpans SpannableStringBuilder used to return the result of getSpans in the order of start indices because of the interval tree it uses. However, style spans has to be applied in the order of insertion to get predictable results. Sorted the results of getSpans ordered first by priority flag and then by insertion time. Moreover improved the performance of SpannableStringInternal copy constructor. Bug: 26240132 Change-Id: I0b0fa7bb30a3bd9ca37dedca66d8993718586027
/frameworks/base/core/java/android/text/Layout.java
|
e53e428a7efd624459961da3f932b408f896453b |
|
13-Jan-2016 |
Raph Levien <raph@google.com> |
resolve merge conflicts of 957bdc56c5 to master. Change-Id: I4c8749f92a1fa39bf0d08e10155d9e68c87401c0
|
5bff01d72f2a49add74dd36c8d1ed5038611f20b |
|
08-Jan-2016 |
Keisuke Kuroyanagi <ksk@google.com> |
Respect grapheme clusters in Layout#getOffsetForHorizontal. TextUtils#getOffsetAfter was used for getting the next offset in Layout#getOffsetForHorizontal. However, this method doesn't treat grapheme clusters properly. Changed to use TextLine#getOffsetToLeftRightOf instead of TextUtils#getOffsetAfter. Bug: 25375561 Change-Id: I96c9e6e5da65adfb5266446ecab852c52628dbb5
/frameworks/base/core/java/android/text/Layout.java
|
720edf95db6c908f87dbbb33c6bde67aedb36899 |
|
27-Aug-2015 |
Keisuke Kuroyanagi <ksk@google.com> |
Fix: Cursor can be at an invalid offset in EditText. "getLineEnd(line) - 1" is used as the return value when the "horiz" is beyond the line end for multiple line text. In this case, the returned value can point an invalid offset like the middle point of a surrogate pair. Bug: 23069901 Change-Id: I1afef7205a15079a42bb0018df73f70fe9ada862 (cherry picked from commit 00ad16d1cd24b788262ab4f62935e720a392da6d)
/frameworks/base/core/java/android/text/Layout.java
|
00ad16d1cd24b788262ab4f62935e720a392da6d |
|
27-Aug-2015 |
Keisuke Kuroyanagi <ksk@google.com> |
Fix: Cursor can be at an invalid offset in EditText. "getLineEnd(line) - 1" is used as the return value when the "horiz" is beyond the line end for multiple line text. In this case, the returned value can point an invalid offset like the middle point of a surrogate pair. Bug: 23069901 Change-Id: I1afef7205a15079a42bb0018df73f70fe9ada862
/frameworks/base/core/java/android/text/Layout.java
|
112d9c7f116bec0a52badde81bd778e59e88cb63 |
|
07-Aug-2015 |
Roozbeh Pournader <roozbeh@google.com> |
Remove EmojiFactory and its mentions from frameworks. Bug: 18134313 Bug: 20158206 Change-Id: If46cdbd9d558e6592280b2b95f00b87d04de70a2
/frameworks/base/core/java/android/text/Layout.java
|
7209deedcde98ea0cca519e73d910bafa5193334 |
|
09-Jul-2015 |
John Reck <jreck@google.com> |
Delete dead code Bug: 22378829 Every time setText is called a BoringLayout is created. BoringLayout internally creates a new Paint called mWorkPaint. However, creating a Paint turns out to be somewhat substantial amount of work, and mWorkPaint is never actually used. Deleting this shaves off roughly 50ms and 1,000 object creations during a fling on a listview. Change-Id: I5d03402b9027df6ce0f3e58160752c66c69a4d2d
/frameworks/base/core/java/android/text/Layout.java
|
2ea5290ffb9efe0a7c187fb1177ef8ecd089803c |
|
01-Jul-2015 |
Raph Levien <raph@google.com> |
Fix problems with StaticLayout indentation The implementation of indendataion had two issues. First, the indent pattern would restart on a new paragraph, which created problems when a multi-paragraph text would flow into a shape. Second, the indents didn't affect drawing position, which is ok for centered text but not most of the other alignments. This patch fixes both. Bug: 21904268 Change-Id: I53a3eb1c192fc0f8f0beace304832eed61b38497
/frameworks/base/core/java/android/text/Layout.java
|
edb27f14ec03d9f4e1dd3959e81f58d4f1389971 |
|
01-Jun-2015 |
Raph Levien <raph@google.com> |
Revert "Revert "Use getRunAdvance to position cursor"" This reverts commit 5730c974800a0ffed59a041d9e249a5c42e417db.
/frameworks/base/core/java/android/text/Layout.java
|
5730c974800a0ffed59a041d9e249a5c42e417db |
|
01-Jun-2015 |
Raph Levien <raph@google.com> |
Revert "Use getRunAdvance to position cursor" This reverts commit cb5499c85097450c48f66f6c08a35bab2ad5ab12. Bug: 21549197
/frameworks/base/core/java/android/text/Layout.java
|
cb5499c85097450c48f66f6c08a35bab2ad5ab12 |
|
29-May-2015 |
Raph Levien <raph@google.com> |
Use getRunAdvance to position cursor 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
/frameworks/base/core/java/android/text/Layout.java
|
95c7a13f2ac4f31ed3aaec9b47b9a29a3dbca978 |
|
12-May-2015 |
Roozbeh Pournader <roozbeh@google.com> |
Add hyphenationFrequency attribute to TextView and StaticLayout. 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
/frameworks/base/core/java/android/text/Layout.java
|
9a174dda4227f602fd0b5f69909339b433a70f59 |
|
08-Apr-2015 |
Raph Levien <raph@google.com> |
Clear hyphenEdit from Layout's paint 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
/frameworks/base/core/java/android/text/Layout.java
|
39b4db73c3340ff955f67e4e5318159d19d1ab3a |
|
25-Mar-2015 |
Raph Levien <raph@google.com> |
Add breakStrategy attribute to TextView 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
/frameworks/base/core/java/android/text/Layout.java
|
26d443aee4ee5a8791417b4ca09e8c78ba8dc78b |
|
30-Mar-2015 |
Raph Levien <raph@google.com> |
Revert "Fix build: Revert "Record hyphens from Minikin and draw them"" 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
/frameworks/base/core/java/android/text/Layout.java
|
5a6eeb3cbe0896ddf4bdccc0b1a81d7aac49821e |
|
30-Mar-2015 |
Ed Heyl <edheyl@google.com> |
Fix build: Revert "Record hyphens from Minikin and draw them" This reverts commit 27fb878c04e18d3bdd6c42ed347194a7c816ed97. Change-Id: I2b3390cb0b258a2e1a38ad72ae9686177d6ffdb8
/frameworks/base/core/java/android/text/Layout.java
|
71cbc72e70a6f0e086535c51e35262eb3a4d4bd9 |
|
20-Mar-2015 |
Raph Levien <raph@google.com> |
Record hyphens from Minikin and draw them 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
/frameworks/base/core/java/android/text/Layout.java
|
c94f742f7e07a3b86c8f603836c19638472b3e83 |
|
07-Mar-2015 |
Raph Levien <raph@google.com> |
Calculate line breaks using Minikin 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
/frameworks/base/core/java/android/text/Layout.java
|
70616ecd22fafccf2fab7565ccfbb3b5f91c5580 |
|
04-Mar-2015 |
Raph Levien <raph@google.com> |
Start moving text measurement into native code We want to move text measurement into native code, mostly so that alternate measurement for hyphens can be performant. This patch begins that migration, in the main StaticLayout case, but still surfaces the widths array to Java (for ellipsis calculation), and also includes a hack (used mostly for testing) for computing widths in Java and sending them down to native code when TextPaint is subclassed. Change-Id: I476c9e8b3aa8e4e3552eb18f66c4bcd5683f3a72
/frameworks/base/core/java/android/text/Layout.java
|
d29bdb266d54b4551f42776bb790e80147a279d0 |
|
06-Feb-2015 |
Neil Fuller <nfuller@google.com> |
Avoid static initialization of Layout from TextUtils This works around a bug in standalone (e.g. non-Zygote) runtimes when a device is attached to a host that is running DDM. There is a race condition: When the runtime receives a HELLO from DDM it calls TextUtils.isEmpty(). Calling any TextUtils methods statically initializes Layout. Layout has dependencies on other classes, which in turn have dependencies on native methods that are not always registered when the call takes place. Registration and DDM handling are done in separate threads. This is not a fix, merely a workaround until the race can be resolved. Bug: 18081539 Change-Id: If1bd3de6597bc93da381c8f86dacf40156449561
/frameworks/base/core/java/android/text/Layout.java
|
875062059c4932ddf5649720c26e7f59b6ab9978 |
|
04-Sep-2014 |
Raph Levien <raph@google.com> |
Fix Layout.isRtlCharAt We weren't getting correct results from Layout.isRtlCharAt, because it was only testing half of the correct predicate for whether the argument was inside the run. This patch restores the correct predicate. Bug: 17381011 Change-Id: Ib0a77cc182f4ca4bfe824e85b7aff7268f465d73
/frameworks/base/core/java/android/text/Layout.java
|
ab08c6d38ab2e575f809ca8ce4c7f095e49d258c |
|
08-Aug-2014 |
Anish Athalye <aathalye@google.com> |
Make LeadingMarginSpan2 behavior more consistent This addresses b/16486549. This change updates public documentation to specify the behavior of LeadingMarginSpan2s. This change specifies what happens when a LeadingMarginSpan2 is combined with other LeadingMarginSpans. This behavior was not previously documented. LeadingMarginSpan2s specify the number of lines used for the leading margin. When laying out and rendering, for all LeadingMarginSpans, the first line margin is applied for the number of lines specified by the LeadingMarginSpan2. Previously, this behavior was slightly buggy -- the LeadingMarginSpan2 affected all LeadingMarginSpans when laying out text, but not when rendering. This change is designed to cause the least amount of breakage in existing code while achieving consistency with the way LeadingMarginSpan2 is handled in layout and drawing. For the most common use of LeadingMarginSpan2 -- getting a multi-line first margin in the first paragraph of text in a layout -- this should cause no change in behavior. For any other uses, the old (buggy) implementation most likely did not exhibit correct behavior to begin with, so developers were most likely not relying on that functionality. Change-Id: I6f69df09c0130e703458e65bf3eaac4a905df56e
/frameworks/base/core/java/android/text/Layout.java
|
c14b3ada5cccfdd872ccf72d928fb0088f3ce00d |
|
25-Jul-2014 |
Anish Athalye <aathalye@google.com> |
Fix bug in measurement of paragraphs This fixes b/16510772. When measuring paragraphs, leading margins should be taken into account. When computing line width, the margin should be added to the absolute value of the extent (there were missing parenthesis). Both of these caused views with leading margins to be rendered incorrectly. Change-Id: I5029b2790a249192a858eb226d7b793d0622a70d
/frameworks/base/core/java/android/text/Layout.java
|
776abc24cdd18610232a50b997cce3cffa74609b |
|
07-Mar-2014 |
Adam Lesinski <adamlesinski@google.com> |
Uses VMRuntime.newUnpaddedArray for ideal array sizes Bug:13028925 Change-Id: I0a9301248b10a339afbdc5e4ffe3310ac4fa1fb7
/frameworks/base/core/java/android/text/Layout.java
|
373b7a8d4e9dce4f71539d4dbcf627fd3e1a39da |
|
21-Sep-2013 |
Raph Levien <raph@google.com> |
Fix for "Can't place cursor after combining accent" This patch fixes behavior where attempting to place the cursor at the end of a string where the last character is a combining accent actually placed it before that accent. This was especially annoying for editing Thai text, because it made it difficult to delete a trailing tone mark. Fixes bug 8947569 "Can't place cursor after combining accent" and bug 10398332 "[Thailand] Thai Language(IME) -- Can't delete Thai tone mark while writing message" Change-Id: Ida1933c8f0ab6cdb0200db39891e9389e4bdba86
/frameworks/base/core/java/android/text/Layout.java
|
afe8e9b6d033cb854afa3024d8198a32896a804a |
|
20-Dec-2012 |
Raph Levien <raph@google.com> |
Suppress horizontal scrolling with trailing blanks The existing behavior of EditText is that trailing blanks can cause a line to exceed the layout width, causing the cursor to extend past the line, which in turn causes horizontal scrolling. This patch clamps the cursor to the layout width in the non-scrolling case, which makes the spaces effectively invisible when they're at the end of the line, but at least suppresses the scrolling. The clamping only works reliably in left-to-right alignments, so this patch checks for than and only enables the clamping in those cases. Fix for bug 7699295. Change-Id: I22bc4e6c9ded3d7716edfcf10dd2b5c31a5da9de
/frameworks/base/core/java/android/text/Layout.java
|
db24f0a73f4385aea104367a4bc71b78f25dbc3f |
|
04-Oct-2012 |
Fabrice Di Meglio <fdimeglio@google.com> |
Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT - fold LEFT/RIGHT into NORMAL/OPPOSITE cases Change-Id: Idf14342ffed4840e7b4ea53cc42f1cde8f196a4c
/frameworks/base/core/java/android/text/Layout.java
|
15c9c6141a00cd91290928bce742a2ae6761aca2 |
|
14-Jun-2012 |
Fabrice Di Meglio <fdimeglio@google.com> |
Merge "Fix bug #6661824 Hebrew Text can be clipped" into jb-dev
|
8d44fff7e62f77c3b3072a96712cc1389e63ca64 |
|
14-Jun-2012 |
Fabrice Di Meglio <fdimeglio@google.com> |
Fix bug #6661824 Hebrew Text can be clipped - use the correct ellipsis char in both measurement and rendered string Change-Id: Ia00285fc16da528f18702719026503b5d0610642
/frameworks/base/core/java/android/text/Layout.java
|
2fba3387c31b675c419030145250e5be246c50b0 |
|
12-Jun-2012 |
Gilles Debunne <debunne@google.com> |
Prevent a crash when maxLines is set to 0 Bug 6642222 Using setMaxLines(0) and setMinHeight(30) causes a crash because Layout#getLineRangeForDraw() returns a [0,0] interval in that case. Accessing the Direction in draw causes a NPE. Change-Id: If50f9b554e3cdc598a721b623992e9196982838c
/frameworks/base/core/java/android/text/Layout.java
|
eca5b7385a641ae5d8c4aa2b7823a4e573737376 |
|
26-Apr-2012 |
Gilles Debunne <debunne@google.com> |
Basic renaming refactoring in Layout Change-Id: I79f5444a097f1e2b2a81ececf1f0a14b6d7d5179
/frameworks/base/core/java/android/text/Layout.java
|
60e3b3fa60a672583fe6294139feb940845efc9b |
|
13-Mar-2012 |
Gilles Debunne <debunne@google.com> |
Use SpanSet to accelerate Layout.drawBackground The main performance improvement should come from the fact that we entirely skip the loop (which calls getLineStart, getLineTop and getLineDescent on each line) in the frequent case where there are no LineBackgroundSpans. Change-Id: Ie2d3168521e88d43f1a4236da2b3e8447606df1e
/frameworks/base/core/java/android/text/Layout.java
|
6c488de023a4797069673dc619c1a4096079ea9e |
|
02-Mar-2012 |
Gilles Debunne <debunne@google.com> |
EditText caches only text in its internal display list. Decorelate background and text in layout display. This allows to only store the text in the editable TextView's display list. Selection and cursor changes no longer need to invalidate the display list, leading to faster rendering. Change-Id: I3af3a98846e1bfe2d9ec6c42590e71bf3704595e
/frameworks/base/core/java/android/text/Layout.java
|
34d2eba560f83f4eb665cdc039cf02bf96c201da |
|
01-Sep-2011 |
Fabrice Di Meglio <fdimeglio@google.com> |
Fix bug #5243493 TextView selection is not working correctly when there is some RTL run into it Part 2 - make selection handles aware of the run direction Change-Id: Idf41036de53d8968e7ae27eb87aea09e86bcd652
/frameworks/base/core/java/android/text/Layout.java
|
3716601573f5a562f98721130e25002ad88eb164 |
|
31-Aug-2011 |
Fabrice Di Meglio <fdimeglio@google.com> |
Fix bug #5243493 TextView selection is not working correctly when there is some RTL run into it - make the selection green highlight work Change-Id: I4e3b88e3720288f973b1b9e68afa8f800ad13779
/frameworks/base/core/java/android/text/Layout.java
|
8059e0903e36cbb5cf8b5c5d5d653acc9bbc8402 |
|
11-Aug-2011 |
Fabrice Di Meglio <fdimeglio@google.com> |
Fix bug #3388534 Long file names are improperly displayed when played - force ellipsising when there are more lines found than maxLines - do not care about lines when we have reached maxLines - also fix relayouting when changing maxLines thru setMaxLines() - do not allow START / MIDDLE ellipsis when there are multiple lines (and print a log accordingly) Change-Id: I90f5a7f5200a220aceee01fb7300bec2c4c3a075
/frameworks/base/core/java/android/text/Layout.java
|
cb379120456d8065d742021fc5c66748fc8a11a8 |
|
07-Jul-2011 |
Doug Felt <dougfelt@google.com> |
Implement textDirection heuristic selection. Change-Id: I2fcf18de573f2d66494fa5ed61e4273c3c6078c7
/frameworks/base/core/java/android/text/Layout.java
|
c0ccf0c47c00942a9d0f2670600a8f2d4d7adb5b |
|
24-Jun-2011 |
Doug Felt <dougfelt@google.com> |
Support control of text alignment. Change-Id: Id6f3682f67ba2e6811e3014cd34a281e6dd0a469
/frameworks/base/core/java/android/text/Layout.java
|
27e8f1a3a6b43592e3d419d7a3cfc6192a86bf5c |
|
29-Apr-2011 |
Conley Owens <cco3@android.com> |
am 8b22ef66: am e41d2aed: Merge "Using robust equality check." * commit '8b22ef66ef1a67333e2f1d4250d2c134b50ef91a': Using robust equality check.
|
2fb503f5102dd32a8ec391b26911528852703b90 |
|
17-Mar-2011 |
Jozef BABJAK <jozef.babjak@gmail.com> |
Using robust equality check. Change-Id: Ie30684c472bfa38d0432f855f7075c34709958d5
/frameworks/base/core/java/android/text/Layout.java
|
f3fa0cdbaea109b114f7facbb5d42de3fc12bbc8 |
|
03-Feb-2011 |
Gilles Debunne <debunne@google.com> |
Bugfixes in StaticLayout. Bug 3422121 With ellipsize, lines starting with a very long word that does not fit inside the width were simply ignored. Cut the long word instead. start - widthStart index offset shift in BiDi. The original ellipsize-end patch that added '...' after the last word on end-ellipsized lines has been punted in favor of a true ellipsize support in I. I believe the StaticLayout calculateEllipsise is a no-op since textwidth <= avail by construction: fitWidth and okwidth are < outerWidth. The only exception is the paraEnd != here case in generate (when not a single character fits in width). This case is exercised by StaticLayoutTest in cts (width of 8 pixels) and revealed an offset error in widstart. All in all, it looks like this code was probably never really tested. I tried some typical text configuration to make sure these changes improved the situation. Change-Id: Ibee410bd7db453abf93e10e8beb844eae998922c
/frameworks/base/core/java/android/text/Layout.java
|
f75c97e023af7d4ad9a8c129d4ea282b1c3b8f94 |
|
11-Feb-2011 |
Gilles Debunne <debunne@google.com> |
Text insertion cursor is now defined by a Drawable. Bug 3261766 If defined, the drawable is used instead of directly drawing a 1 pixel line. This makes the cursor more fancy and more visible. The drawable is currently clipped by the TextView's limits, which is currently visible on the left when the cursor is at the first position. To solve this issue properly, we would need to propagate a do-not-clip up in the hierarchy. Change-Id: I99f6001048eed14104994acf6bab942dda8eb38e
/frameworks/base/core/java/android/text/Layout.java
|
0a4db3c5270440eeb7e4e44a7029926e239ec3bd |
|
14-Jan-2011 |
Gilles Debunne <debunne@google.com> |
Pixel were missing on the last line of text when using MaxLines. Bug 3295544 Only the last line of text includes the bottomPadding (extra line spacing below the characters' descent. When The text is clipped using maxLines, the desired height correctly added this value, but getLineTop and getLineDescent are also used when the layout is drawn. The fix is to make the layout aware of its clipping so that these values are correctly updated. Change-Id: I703656cf45022d34a90f55f0ed8fc5e4b30f80b1
/frameworks/base/core/java/android/text/Layout.java
|
162bf0f1b9fd5d78ffa801917994f6222c6efd85 |
|
17-Nov-2010 |
Gilles Debunne <debunne@google.com> |
Fix for IOOBoundsExc in SpannableStringBuilder Bug 3182953 Change-Id: Idc7faa86b8250bf325e2547d7d4c094300a06686
/frameworks/base/core/java/android/text/Layout.java
|
497a92cc5ba2176b8a8484b0a7da040eac0e887b |
|
13-Sep-2010 |
Jeff Brown <jeffbrown@google.com> |
Add keycodes and meta-key modifiers to support external keyboards. Added new key maps for external keyboards. These maps are intended to be shared across devices by inheriting the "keyboards.mk" product makefile as part of the device's product definition. One of the trickier changes here was to unwind some code in MetaKeyKeyListener that assumed that only the low 8 bits of the meta key state were actually used. The new code abandons bitshifts in favor of simple conditionals that are probably easier to read anyways. The special meta key state constants used by MetaKeyKeyListener are now (@hide) defined in KeyEvent now so as to make it clearer that they share the same code space even if those codes are not valid for KeyEvents. The EventHub now takes care of detecting the appropriate key layout map and key character map when the device is added and sets system properties accordingly. This avoids having duplicate code in KeyCharacterMap to probe for the appropriate key character map although the current probing mechanism has been preserved for legacy reasons just in case. Added support for tracking caps lock, num lock and scroll lock and turning their corresponding LEDs on and off as needed. The key character map format will need to be updated to correctly support PC style external keyboard semantics related to modifier keys. That will come in a later change so caps lock doesn't actually do anything right now except turn the shiny LEDs on and off... Added a list of symbolic key names to KeyEvent and improved the toString() output for debug diagnosis. Having this list in a central place in the framework also allows us to remove it from Monkey so there is one less thing to maintain when we add new keycodes. Bug: 2912307 Change-Id: If8c25e8d50a7c29bbf5d663c94284f5f86de5da4
/frameworks/base/core/java/android/text/Layout.java
|
12122bf7929aab7417cda5642632b81e4e15eb4e |
|
25-Aug-2010 |
Takako Ishibashi <takako.x.ishibashi@sonyericsson.com> |
Support surrogate pairs when layouting text The current framework does not consider surrogate pairs when getting the index of the character. This bug becomes visible when creating the text including Emojis. For example cursor breaks up when it moves around the Emojis. Our proposed solution will consider the surrogate pairs when calculating the index. It will fix not only the Emoji case, but also the letters that use surrogate pairs. Change-Id: I4983f2e4df933c8af9d5f0cc27df871e8e10fed4
/frameworks/base/core/java/android/text/Layout.java
|
c4d8eb6fb7c88c5c4da38b0b113c24cc4b78c0b7 |
|
19-Aug-2010 |
Romain Guy <romainguy@google.com> |
Speedup TextView fades (no more layers required.) Also fixes a crash in the drop shadows cache and improves drop shadows caching. Change-Id: I9c0208a49467f9201d786ae0c129194b8d423923
/frameworks/base/core/java/android/text/Layout.java
|
74d31ef2b2c42b54fa1f7cf94ea955ea67ab69a0 |
|
06-Aug-2010 |
Eric Fischer <enf@google.com> |
Fix a bug where paragraph styles could leak onto an adjacent empty line. When the text ends with an empty line, the getSpans() call to retrieve styles for it would also retrieve the styles of the preceding line. Add a special case to detect and prevent this. Change-Id: I888131cacce6bf45e68c53c931ebe8d58db0b7a9
/frameworks/base/core/java/android/text/Layout.java
|
0c702b88c5d0d4380930b920f5be6e66dd95a0d8 |
|
14-May-2010 |
Doug Felt <dougfelt@google.com> |
Move shaping to native. Add internal API (getTextRunAdvances) to Paint, use when measuring. Add internal API (getTextRunCursor) to Paint, use when determining valid cursor positions. Remove java-level shaping code. Remove 'prep' code in TextLine (except for replacement text) since shaping now is done on the fly as needed in native. Provide explicit shaping context bounds to internal text measuring, cursor movement, and rendering APIs. Update for to changes in external API in ushape.h. Change-Id: I146958b624802ce8553125e5c3c6c03031bc9608
/frameworks/base/core/java/android/text/Layout.java
|
c982f60e982c1d2df9f115ed9a5c3ef3643d0892 |
|
25-May-2010 |
Doug Felt <dougfelt@google.com> |
Fix alignment issues with RTL paragraphs. Also remove unused debugging code that depends on junit. Remove trailing whitespace in changed code. Change-Id: Ie02d1b8220c599a672ee6e91af0fba634e0f620c
/frameworks/base/core/java/android/text/Layout.java
|
e8e45f2c05cb3b6d23f30c8f96d8e0b3699cea7a |
|
29-Mar-2010 |
Doug Felt <dougfelt@google.com> |
Refactor Styled utility functions into reusable objects. 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
/frameworks/base/core/java/android/text/Layout.java
|
4e0c5e55e171532760d5f51e0165563827129d4e |
|
16-Mar-2010 |
Doug Felt <dougfelt@google.com> |
Don't measure for a secondary caret unless we have one. Also, clean up imports and trailing whitespace. Change-Id: I5ebaaceb756600a1ca7370ab3ef078ce200545ef
/frameworks/base/core/java/android/text/Layout.java
|
9f7a4442b89cc06cb8cae6992484e7ae795323ab |
|
01-Mar-2010 |
Doug Felt <dougfelt@google.com> |
Enable nested bidi levels in a paragraph. Changes the internal representation of direction information in the Directions object to be a visually-ordered list of start/length+direction pairs instead of a list of directionality inversion offsets. Rewrite Layout.getOffsetToLeft/RightOf to use run information instead of width metrics. Remove java Bidi, use native. Switch bidi tests to test native, expect levels instead of dirs. Add test of directionality. Leave in switch to turn new code off and restore previous behavior for now. Change-Id: Iea8bb46c678a18820e237c90f76007a084c83051
/frameworks/base/core/java/android/text/Layout.java
|
20178d62cf669af18467a16d3c4c4237ed42151c |
|
22-Feb-2010 |
Doug Felt <dougfelt@google.com> |
Factor bidi algorithm into separate method. Add rudimentary support for overriding default base line direction heuristic. Add some simple tests of the bidi implementation.
/frameworks/base/core/java/android/text/Layout.java
|
71b8dd71e49016e057c46a257f79162d186a3c3a |
|
17-Feb-2010 |
Doug Felt <dougfelt@google.com> |
Enhance text docs, rename some variables for clarity, comment places in the code for further investigation.
/frameworks/base/core/java/android/text/Layout.java
|
7b5676e4d40a09ccdbc8b6f691a3d8be23e480d3 |
|
16-Oct-2009 |
Mark Wagner <mxw@google.com> |
support for multiline paragraph style indentation This change is likely incomplete and perhaps not right in other ways. The gist of the change is that the span can return the number of lines to which to apply the "leading margin". Some specific things that should be looked at: 1) if the user has nested multiple LeadingMarginSpans then they will inherit the "line count" feature. This is wrong but I didn't want to spend time fixing it until it was clear that this overall approach was acceptible. 2) The units for how many lines should indented is "lines" rather than something like dips. 3) I wasn't sure what our strategy was for binary compatibility so I didn't want to modify the methods in LeadingMarginSpan. Instead I made another interface with extends LeadingMarginSpan that has the extra method to return the line count.
/frameworks/base/core/java/android/text/Layout.java
|
a82e99a89b7a12bd86d99d60d23a7a37624499b6 |
|
01-Sep-2009 |
Eric Fischer <enf@google.com> |
Fix an emoji-measuring bug that caused an exception when editing a contact. It was measuring the text to try to determine the size that it needed to scale the emoji character to. Unfortunately it was accidentally trying to measure the character under the cursor instead of the emoji character itself, which is wrong, but more seriously doesn't work at all when the cursor is at the end of the line. This was already fixed before in change 144474, but that change never got merged over to donut. So this merges it now. Bug 2087915 Change-Id: Ib4804d330a029a966207b3b07271f84e6b2652c0
/frameworks/base/core/java/android/text/Layout.java
|
76c0226008ee16633dc94ed4dbeadef2174f6bd9 |
|
14-Apr-2009 |
Dave Bort <dbort@android.com> |
text: Remove references to android.util.Config The semantics of Config.DEBUG will be changing soon, and all other Config.* fields will become deprecated/hidden. BUG=1780938
/frameworks/base/core/java/android/text/Layout.java
|
c2d54f46ac13e029e6d53f7471cd9c90fe6bbfe9 |
|
27-Mar-2009 |
Eric Fischer <> |
AI 143165: am: CL 142861 Make TextView Emoji scale to match the size of the text. Original author: enf Merged from: //branches/cupcake/... Automated import of CL 143165
/frameworks/base/core/java/android/text/Layout.java
|
105925376f8d0f6b318c9938c7b83ef7fef094da |
|
19-Mar-2009 |
The Android Open Source Project <initial-contribution@android.com> |
auto import from //branches/cupcake_rel/...@140373
/frameworks/base/core/java/android/text/Layout.java
|
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 |
|
04-Mar-2009 |
The Android Open Source Project <initial-contribution@android.com> |
auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/text/Layout.java
|
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 |
|
04-Mar-2009 |
The Android Open Source Project <initial-contribution@android.com> |
auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/text/Layout.java
|
b798689749c64baba81f02e10cf2157c747d6b46 |
|
10-Jan-2009 |
The Android Open Source Project <initial-contribution@android.com> |
auto import from //branches/cupcake/...@125939
/frameworks/base/core/java/android/text/Layout.java
|
54b6cfa9a9e5b861a9930af873580d6dc20f773c |
|
21-Oct-2008 |
The Android Open Source Project <initial-contribution@android.com> |
Initial Contribution
/frameworks/base/core/java/android/text/Layout.java
|