History log of /frameworks/base/core/java/android/text/SpannableStringBuilder.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e244868053cfe44742b42e75df3a08d0c5914bca 05-May-2012 Gilles Debunne <debunne@google.com> Final fix in SpannableStringBuilder.

Bug 6448052

The empty EXCLUSIVE removal condition was incorrect.
Also changed the unit test the didn't catch this problem.

Change-Id: I5576d830cdfa6cc3716c878fb698695a2978b296
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
26b62d432101084c832f5587798cfd24a4ed9c59 27-Apr-2012 Gilles Debunne <debunne@google.com> SpannableStringBuilder correctly manages MARK and POINTS

Bug 6343982

Finally deeply understood the meaning of the POINT and MARK flags.

Updated the Spanned documentation to reflect this.

Updated tests to come.

Change-Id: I400d56b7b4929bc1e7eb4f0497d8e081ee23682e
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
d60da058c6a9a63ef7347685f39a9dedebbc6afa 19-Apr-2012 Gilles Debunne <debunne@google.com> Do not notify text watchers when replace is a no-op

Bug 6344997

The early exit we used to do when both replaced and replacement
strings were empty has been added back.

Only this time it correctly also makes sure no spans from the
replacement string would get added with a 0-length.

Change-Id: Ifc38a7e3619c57aa7647c0a8e63d7627d86f1036
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
90985286442340b9ad9433d6bf8d51702c8d0fd9 18-Apr-2012 Gilles Debunne <debunne@google.com> Fixed SSB. Correct broadcast of removed spans' positions

Found while tracking bug 6326750

A bug in the SpannableStringBuilderSpanTest JUnit CTS test was hiding
this problem.

Also removed the instanceof test on SpanWatcher. All spans, including
those implementing this interface should be copied.

Change-Id: I5233818fb0c08ab56477720db932a5be453e88ee
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
174c44c6cfeead714bb180d21332e712e8b0bbd8 11-Apr-2012 Gilles Debunne <debunne@google.com> SpannableStringBuilder correctly broadcast span changes during replace

Bug 6331765

A call to replace was previously not sending any span modification to the
attached span watchers.

Change-Id: Ic9e4a8ac0210e422961adfb18e205d80531889fe
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
34ec2b54da52eeed39d9cf9e5f215650b447edd7 10-Apr-2012 Gilles Debunne <debunne@google.com> Removed exception from SpannableStringBuilder

Bug 6312196

Change-Id: I9cece36b40d8948e0e85bd433954818991009ad5
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
0249b43f6ce59bfec104f0fe606d9059244f8797 10-Apr-2012 Gilles Debunne <debunne@google.com> Faster and simpler replace in SSB, take two

This is a new version of CL 179343 which had to be reverted.

This problem of the previous CL is that the ComposingSpan that
was part of the replacement text was correctly added during the
replace but was immediately removed because it had a zero-length
size.

Swapping the add and remove blocks solves the problem.

The new non-zero length enforcement also revealed a bug in the
spell checker where we were creating useless range spans.

Change-Id: I59cebd4708af3becc7ab625ae41bc36837f1a1cf
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
425c726ae0691cadc1b03b5f3726368fbdc46bff 09-Apr-2012 Gilles Debunne <debunne@google.com> Merge "More minor refactoring in SpannableStringBuilder"
bc6862300fe5675addfe4ed5d0c7c345aad463aa 06-Apr-2012 Gilles Debunne <debunne@google.com> Revert "Faster and simpler replace in SSB"

Bug 6300658

This change reveals a weird race condition where sometimes the
text is entered twice. Adding a debugger slows down everything,
and the problem is no longer reproducable. Reverting for now.

This reverts commit ebd9a23817052c4d2aaa1058efa2b80b08003d4a.
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
7c5f670bd698c984dcafea8125f4d3939bc42972 06-Apr-2012 Gilles Debunne <debunne@google.com> More minor refactoring in SpannableStringBuilder

No change in the functionnalities.

Change-Id: I009acc75b4f70e65a810cdc67505bc0b13e627b2
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
ebd9a23817052c4d2aaa1058efa2b80b08003d4a 05-Apr-2012 Gilles Debunne <debunne@google.com> Faster and simpler replace in SSB

The original method was adding a suspicious space that was eventually
removed with a series of 3 calls to change.

This should not be necessary. I have tested this with various gap
positions and lengths, for all replace cases I could think of.

The test can not be added to the CTS as it would need to expose the
internal resizeFor and moveGapTo methods.

Change-Id: I194457fbcfd758fa69a7f380665cfd5ae4d3f1d4
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
b51036f72aa69e56133fefbf2b56724768423512 02-Apr-2012 Gilles Debunne <debunne@google.com> Refactoring SpannableStringBuilder

Made TextWatcher notification process clearer by moving it to
a single place, with methods renamed.

Also reverts CL 177544: we cannot broadcast span chages just yet,
the layout has not been reflown. A future CL will change this
behavior to make sure span changes are correctly broadcasted.

Change-Id: I9ef88dce91dff5f5f45e2845d5b3f18f1c853de3
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
fc1190b8f143bd00c825d4e52928c577e40e6c49 30-Mar-2012 Gilles Debunne <debunne@google.com> Spans added during a text change are broadcasted

More consistent with the SpanWatcher design.

Change-Id: I3a1e4d92fb422f4cc689dabcdef1473d93fef5ad
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
653d3a27878d5358b4a91518a756f6b9b3407b07 07-Dec-2011 Gilles Debunne <debunne@google.com> Limit created string size in Spell Checker

Change-Id: I2f4e7a8b0022d76bc30199ff80c2fe637dbe03ef
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
b062e81e3a16af43db3619d721aa522c137d1aa9 27-Sep-2011 Gilles Debunne <debunne@google.com> Too many SpellCheckSpans are created.

Removed the Runnable in SpellChecker, spell check is triggered at the end
of updateSpellCheckSpans instead of when a new SpellCheckSpan is created.

Cache the spans in updateSpellCheckSpans to limit the calls to getSpans.

When typing, every new letter in a word will create a SpellCheckSpan
(this is needed in case the user taps somewhere else on the screen)
The SpellCheckSpans are pooled in SpellChecker to limit unnecessary new
SpellCheckSpan creation.

Minor optimization on test order in getSpans to avoid some calculation.

Spell check is not started everytime the selection is changed (would be
triggered when the insertion handle is moved). Explicitely do that only
on tap.

Change-Id: Ibacf80dd4ba098494e0b5ba0e58a362782fc8f71
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
945ee9b1661e60e0074d4f16f61fc147c728c6bf 20-Sep-2011 Gilles Debunne <debunne@google.com> Bug 5250788: TextView gets slower as the text length grows

getSpans was called too many times in handleRun. Pre-compute the
subset of intersected spans and iterate over a subset of it instead.

Moving the instanceof test in getSpans after the other tests also
speeds things up a lot.

On a text with ~300 words, all with a span attached, getSpans went down
from 78% to 14% of the CPU usage.

Change-Id: I59bc44f610e9a548e0dcec68b180934da9e5c559
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
6435a56a8c02de98befcc8cd743b2b638cffb327 05-Aug-2011 Gilles Debunne <debunne@google.com> Spell checking in TextViews

New UX interactions (the Paste action is no longer displayed after a delay)
suggestionEnabled flag replaced by existing input type flag.
removeSpans fixed in SpannableStringBuilder to always send notifications
SuggestionSpan handled by TextView instead of SpannableStringBuilder

New span update algorithm to correctly handle edition around word boundaries.

Change-Id: I52c01172f19e595fa512e285a565a3fd97c3c50e
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
75beb336f4b164c3bed5d4b91f0b9c6ea49a3437 29-Apr-2011 Gilles Debunne <debunne@google.com> SuggestionSpans are removed around edited text.

SuggestionSpans do not make sense anymore when the text they
refer to is modified. Removed these at the lowest possible common
level: In the SpannableStringBuilder that is used to back the Editable.

This way, IME do not have to care about removing these when they change
text. And they cannot forget to so either.

Also fixed a bug in TextView's paste with multi-item paste text (never
exercised, since we have no source for such a thing).

Change-Id: I08ed921f8c04ffb1a00936a3e554a85ee82f103c
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
0a1413e4bf9dcda2a8abb2287e43f612a7fb2453 22-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Clean getTextRunAdvances() APIs

- remove ICU reference in API names
- use a "reserved" int parameter to pass either "0" for Harfbuzz or "1" for "ICU"

Change-Id: I88b4f76feafd203a6999cd7349402fa36a9a4b2a
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
eee49c699c035ffba188417489f40d34f587d65c 25-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix text redering issue where the text was sometimes truncated

- mostly was visible in Settings apps / Wi-Fi networks summary info for each network
- correctly setup the local SkPaint for advances computation
- improve test app for adding live resizing

Change-Id: Ia031fe1b115b521ba55c7e68f2a26300f02e48ca
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
b0b225602cc84e0602450a417a562e8f53f29c6b 03-Mar-2011 Gilles Debunne <debunne@google.com> getTextRunCursor gets deprecated in SpannableStringBuilder

Change-Id: I2d408ebff90add7afc242bb01df9ab96c6fc7fa7
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
616f3835a0a67328b378cb1cbc126f17478ab4a0 03-Mar-2011 Gilles Debunne <debunne@google.com> Removed documentation links

Broken build.

Should the Paint fields be made public or should the SpanStringBuilder
method be hidden ???

Change-Id: I8ecea19104357ea53ad53b23d02a707ec422161d
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
5a39c95c004d856b47a844c962b1c2b18f4e96aa 03-Mar-2011 Gilles Debunne <debunne@google.com> Extra @Override removed in SpanStringBuilder

These were added in 99657 by using a misconfigured eclipse
save action that adds @Overirde to interfaces (Java 1.6 only).

Change-Id: I766bbde917b0bb063cb6d588ee276787e2f7db66
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
f09d510cd18854f41632433503ca46cc41362feb 03-Mar-2011 Gilles Debunne <debunne@google.com> Added documentation for SpannableStringBuilder.getTextRunCursor

Bug 3370244

Change-Id: I621a1599ff18da928044dd37a0d7cc861cc6f48f
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
312cd580391d70140eeb4080a4e195039172a6a6 03-Jul-2010 Gilles Debunne <debunne@google.com> Fixed bug in getTextRunCursor.

When auto-correction is used, the text is modified to underline the corrected word, which
modifies mGapLength and mGapStart. The mGapLength shift was not properly handled in getTextRunCursor.

Bug 2807595

Change-Id: I43ee216f6780270e452aa9199ffd892fe7ab6c3f
/frameworks/base/core/java/android/text/SpannableStringBuilder.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/SpannableStringBuilder.java
f47d7405bbcb25d7cdf89ebb059f41520fe9ab87 22-Apr-2010 Doug Felt <dougfelt@google.com> Modify Canvas drawText to run bidi and shape.

Adds drawTextRun as internal API on Canvas and GraphicsOperations.
Adds implementation to implementors of GraphicsOperations.

Adds state and API on Paint to control the bidi algorithm when used
by Canvas. This API is currently hidden.

The drawText changes are incomplete since shaping is not yet available
in the native code.

Change-Id: I4368048aef9545df0953a349381771603e04b619
/frameworks/base/core/java/android/text/SpannableStringBuilder.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/SpannableStringBuilder.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/SpannableStringBuilder.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/java/android/text/SpannableStringBuilder.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/text/SpannableStringBuilder.java