| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | | |
This reverts commit 5730c974800a0ffed59a041d9e249a5c42e417db.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit cb5499c85097450c48f66f6c08a35bab2ad5ab12.
Bug: 21549197
|
|\ \ \ \ |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously, a NullPointerException was raised if the input was null.
Bug: 12894042
Change-Id: I5c5db484e5659659c1da91079adcba773ba7d83d
|
|\ \ \
| | | |
| | | |
| | | | |
into mnc-dev
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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 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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Bug: 17643755
Change-Id: If6ca064a082feaf6faf9555b1455c4b2f6312952
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Bug: 17538139
Change-Id: Ia193c59058d99880ea5afe5bd1bbcc0dce97f9d4
|
|\ \ \ \ \ |
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
|
| |/ / /
| | | |
| | | |
| | | |
| | | | |
Bug: 19833548
Change-Id: I05a36f00f5c7aa6f0ce1993337585f6cfc64649a
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|/ / /
| | |
| | |
| | |
| | | |
BUG: 19284889
Change-Id: Icd3c1dd3b31c23025bc974bcbb5a3618196434e7
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| |/ / /
|/| / /
| |/ /
| | |
| | |
| | | |
in SpanSet"
* commit '5b61a282255b5273f5194db73f3c88550dc11a57':
Prevent possible memory leak in SpanSet
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit 27fb878c04e18d3bdd6c42ed347194a7c816ed97.
Change-Id: I2b3390cb0b258a2e1a38ad72ae9686177d6ffdb8
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Bug: 19110194
Change-Id: I653b7dc46d5f15da70435f6bddd49042f4d03b54
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | | |
text link without view activity"
* commit '46c953138298285d9cb06a75030fc73081ccc121':
Fix to crash when clicking text link without view activity
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|