History log of /frameworks/base/core/java/android/text/DynamicLayout.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a6a082862b9e2ea4c9e9a1a945927c4040993f6e 03-Jun-2015 Raph Levien <raph@google.com> Rename setTextDir to setTextDirection

StaticLayout.Builder used "setTextDir" as a shorthand, but it's not
as clear as spelling it out. So, setTextDirection.

Bug: 21572282
Change-Id: Ia94476562d70678f963196b87bb63511d30836b6
/frameworks/base/core/java/android/text/DynamicLayout.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/DynamicLayout.java
531c30c62b14881aab31a5133920a971b1fbb50e 01-May-2015 Raph Levien <raph@google.com> Expose StaticLayout.Builder publicly

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
/frameworks/base/core/java/android/text/DynamicLayout.java
ebd66ca600dc2c43edb0830bcf1a92fafec30a5a 01-May-2015 Raph Levien <raph@google.com> Make Paint a required field of StaticLayout Builder

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
/frameworks/base/core/java/android/text/DynamicLayout.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/DynamicLayout.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/DynamicLayout.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/DynamicLayout.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/DynamicLayout.java
d3ab692d28018825578ff05832644cfad60233fb 02-Mar-2015 Raph Levien <raph@google.com> Some refactoring of StaticLayout

This patch refactors construction of StaticLayout to use an explicit
Builder object, which is intended to hold state used for constructing
the layout but not needed for merely reading out the results.

Builder objects are allocated from a pool and explicitly recycled,
so there is insignificant additional allocation cost.

This patch has very little impact on performance (it does avoid
allocating a FontMetricsInt object) but opens the way for significant
performance and functionality improvements as more of the Builder
functionality migrates to native code.

Change-Id: I2a576643e573a38b61f895a80d5d92a85c94b6b4
/frameworks/base/core/java/android/text/DynamicLayout.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/DynamicLayout.java
63b3eb65234c8a8b9224c262442816cc429560ef 03-Oct-2013 Raph Levien <raph@google.com> Fix Text appears on top of existing text when composing in gmail.

Fix for bug 6473708. This patch changes from "last update wins" to
merging together the change regions, in the logic of deciding which
blocks need to be updated for painting, so that when there are multiple
changes batched for a draw, they're all taken into account.

Change-Id: I183d453c436125e5efec7031b4d61b43989653f9
/frameworks/base/core/java/android/text/DynamicLayout.java
955beb2b96a78cf6ee990d0f20bcaf2d22ce608b 10-Dec-2012 Sangkyu Lee <sk82.lee@lge.com> Optimize drawHardwareAccelerated method in Editor class

When inserting a new line or breaking a line,
every display list was invalidated and rebuilt before.
However, we can reuse the display lists above intactly and also
reuse the display lists below with only updating drawing locations.

This patch reuses the display lists if possible.
The display lists above the inserted line are just reused
and the display lists below are reused with only updating
drawing locations not fullly rebuilt.

mIndexOfFirstChangedBlock is the index of the first block
which is moved by inserting or breaking a line.
So the display list whose index is >= mIndexOfFirstChangedBlock
only needs to update its drawing location.

Change-Id: Ica20deb0ebb5750de21356ed31fa9f86e657ff92
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
/frameworks/base/core/java/android/text/DynamicLayout.java
71afc39d68413d125d46ea69e6c9fb077016bb9b 10-May-2012 Gilles Debunne <debunne@google.com> Cut long text into multiple DL at start

Bug 5763685

To improve performance, preventively cut the the into display
list of 3-10 lines of text. Further updates to small parts of
the text (such as adding an underline on a word) will only
invalidate and redraw the affected sub display list.

DLs are aligned with paragraphs, just like they will be during
text edition.

Change-Id: I0d60debc7fdaea8b29080a6eacb2d60205e7d547
/frameworks/base/core/java/android/text/DynamicLayout.java
157aafcbee0eabda798a3be406ccc4200ee86756 20-Apr-2012 Gilles Debunne <debunne@google.com> TextView's sub display lists have tighten bounds

An editable TextView caches text rendering inside an adaptive
number of sub display lists. The bounds of these use to be those
of the entire View.

This CL creates block display lists with tighten bounds, so that
(a still-to-be-implemented) quick rejection can occur.

Also cleaned-up the contradictory translations that were used to
handle the TextView's internal scroll and removed the invalidation
of display lists in that case.

TODO: When internal scroll sets a tighter clipping rect, quick
reject the creation and display of the clipped display lists.

Also renamed blockEnds to a more explicit blockEndLines.

Change-Id: I7d79bea78d06d19b6935aef75ff7aa7df2594050
/frameworks/base/core/java/android/text/DynamicLayout.java
1e130b2abc051081982b5a793a18a28376c945e4 15-Mar-2012 Gilles Debunne <debunne@google.com> Added a unit test for DynamicLayout#updateBlocks

Change-Id: I1824ebeae2bbb5c60a65de36fe1696bf003347c9
/frameworks/base/core/java/android/text/DynamicLayout.java
cde6adf45c90ad3fdc94446ede6a228ce264c886 16-Mar-2012 Romain Guy <romainguy@google.com> Fix the build

Change-Id: I6de62c7bfaecd85810178f58707157466291eca3
/frameworks/base/core/java/android/text/DynamicLayout.java
33b7de85b6918b7714641f12f1ba2ff03a344740 12-Mar-2012 Gilles Debunne <debunne@google.com> Multiple display lists for editable text

Bug 5763685

Long text in a ScrollView (not when the View's internal
scroll is used) is cached as a unique display list when hardware
rendering is on.

As a result, each time the text is edited, the entire display
list has to be updated, which takes a significant amount of
time (up to 500ms for a few thousand lines), proportional to the
size of the text.

This CL splits the text into multiple display lists as the
text is edited. The boundaries of the display list are aligned
with paragraphs.

There is still an issue when the number of lines changes: onLayout()
is called which invalidates all the display list. When the source
of that change is line wrapping and not a change in the view's
dimensions, we should be able to simply shift down the previous DL
instead of re-creating everything.

Change-Id: I7de49a1e5637cdfc9ef06b64b1ec4b61d9ea2415
/frameworks/base/core/java/android/text/DynamicLayout.java
d300e75eff0d5e54390400cbd3f80dc4cea8b617 17-Oct-2011 Gilles Debunne <debunne@google.com> Wrong word cut at end of lines with spaces

Bug 5185017: when the line length is exceeded at a space character,
we use the previous ok width, and the last word is wrapped to next line
although it fits.

This back-track also generates problem with the span parsing, where the
spanStart indexes are no longer monotonuously increasing.

Plus some refactoring in this code (unused parameters, calls to out())

Change-Id: Ia8cd310a732752af3bd370bf0a16db23d40e83f2
/frameworks/base/core/java/android/text/DynamicLayout.java
ad0b051b133baf92f199c96a8ac1e81b3393190c 05-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Revert "Fix bug #5387832 [UI/Visual] Address of the website is not displayed properly(second line of the address is partly shown)"

This reverts commit a130e5f59dc6b2117e4c1a8ffef54828e9ea44c7
/frameworks/base/core/java/android/text/DynamicLayout.java
a130e5f59dc6b2117e4c1a8ffef54828e9ea44c7 29-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5387832 [UI/Visual] Address of the website is not displayed properly(second line of the address is partly shown)

- make DynamicLayout honor max lines
- make StaticLayout.generate() take maxLines as a parameter instead of using the field mMaximumVisibleLineCount

Change-Id: I9eafb1be4b8bb2aa881514955a6903f559cb6a1e
/frameworks/base/core/java/android/text/DynamicLayout.java
09175735c562652be1a1b0dc0f941d36ac4f076a 26-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5344067 android.text.DynamicLayout.sStaticLayout can hold onto an Activity, potential memory leak

- make the StaticLayout constructor not depending on the text as we just need the "generate()" call to be done

Change-Id: I65249e65ed6446b6ac13dbf8c8f58fcdf54046cb
/frameworks/base/core/java/android/text/DynamicLayout.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/DynamicLayout.java
b724c346e19d63d7ff194b2b06c4a1e0f7bc07b7 13-Aug-2011 Amith Yamasani <yamasani@google.com> Revert "Use a weakreference to prevent the static variable from holding an Activity."
Bug was fixed in a different way.

This reverts commit 352c01e2133b71918fa1cb2783a0a10e56117775.
/frameworks/base/core/java/android/text/DynamicLayout.java
352c01e2133b71918fa1cb2783a0a10e56117775 26-Jul-2011 Amith Yamasani <yamasani@google.com> Use a weakreference to prevent the static variable from holding an Activity.

Bug: 5057764

Change-Id: If734e3ef4928b21a5e31e0ad50c97da287c3c116
/frameworks/base/core/java/android/text/DynamicLayout.java
e5ea4403ce58982522554b7ff23f41e6551923c1 01-Aug-2011 Romain Guy <romainguy@google.com> Plug memory leak in EditText.

Change-Id: I0b42c23ceeaa958d02255945c35ff6807c177114
/frameworks/base/core/java/android/text/DynamicLayout.java
cb379120456d8065d742021fc5c66748fc8a11a8 07-Jul-2011 Doug Felt <dougfelt@google.com> Implement textDirection heuristic selection.

Change-Id: I2fcf18de573f2d66494fa5ed61e4273c3c6078c7
/frameworks/base/core/java/android/text/DynamicLayout.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/DynamicLayout.java
d6e568c4f3b30431a0086e647f38d24ffd81457a 25-Jan-2011 Gilles Debunne <debunne@google.com> Removed warnings in DynamicLayout

Change-Id: Ied1c330795412d0bdcac1236b466951112fabc7d
/frameworks/base/core/java/android/text/DynamicLayout.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/DynamicLayout.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/DynamicLayout.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/DynamicLayout.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/text/DynamicLayout.java