Bug 5740435
The new SpanSet cached objects should be recycled when the TextLine is
recycled to prevent a reference to their span, which may lead to the
entire activity.
Change-Id: I4469e418a228bd71eb8be1d43ed86de49baba165
Bug 5738416
This problem was introduced in
https://android-git.corp.google.com/g/#/c/152599
The invalidated cursor region is no longer expanded to include the
cursor drawable (different from the handles' drawables).
Added that code back. Added a flag, since invalidateRegion is also
used to invalidate text span regions in spell check (assumes the decorated
span bounds are not bigger that text boundaries), which is fine in case
of underline.
When the cursor is moved on a single line, invalidate the whole line
(same as what was done before). This is sub-optimal, will file a bug
to fix this. The core problem is that we should invalidate the previous
and the new cursor's positions. We only have one of these.
Change-Id: I9ada9340fb52aad3d80c39efd021fd3f9ec0cc4d
CTS test revealed that persistSwitchSetting could take more than 1 second.
STATE_TURNING_ON intent missed the test timing. We move the broadcast
before persistSwitchSetting
bug 5740715
Change-Id: I54a0a0afc8d1c4fc28f84e6122809af2f1456ca7
Limit each parse to batches of a few words, to keep the UI thread
responsive.
Possible optimizations for the future:
- SpellCheck in a thread, but that requires some locking mecanism
- Only spell check what is visible on screen. Will require additional
spans to tag the pieces of text.
This is a cherry pick of 145656 into ICS-MR1
Patch Set 2: Make the Runnable shared and stop it when detached.
Change-Id: Ibf8e98274bda84b7176aac181ff267fc1f1fa4cb
TextLine objects are already stored in a pool to limit allocation.
Associate SpanSet objects to each TextLine to further limit the
allocation of these and re-use their internal arrays (re-sized if needed).
Drastically reduces new objects allocation during rendering.
Priority code removed in init: priorities are already handled by getSpans.
This is a duplicate of the already accepted
https://android-git.corp.google.com/g/#/c/153970/
but without the dependency on an other CL.
Change-Id: Iaa7e2f7a8ea4337c8d60c3a9a620e9e3e60caf12
1. If the number picker was not wrapping the selector wheel
it was incorrectly initializing the fling scroller and
the error was proportional to the difference of the
current value and the max size. As a result if the number
picker gets stuck for a very long time.
2. The alpha of the selector wheel paint was not reset on
every subsequent fling so if the wheel was fading out
and a new fling is performed the selector wheel is
dimmed during the fling, rather bright.
bug:5728363
Change-Id: Ia90a6af86f162bda1b28f43f7ba7e4a9f5051b78
Reduce likelihood of crash when state machine has quit and someone
sends a message using one of the public functions.
Bug: 5724844
Change-Id: I6582a1d19113e6ed545c8ab20adb0a414d8784a7
Bug 5709546
Change 1a22db29 created a potential leak: setText calls
sendOnTextChange that now calls updateSpellCheckSpans.
The original call to updateSpellCheckSpans made sure the
View had been attached to a window, through the existence
of the SpellChecker object.
The mSpellChecker object will now only be created when the
View is attached, all other spell related method will do
nothing if it has not been initialized.
Change-Id: I8885c12be6395e2346c0ed057bb6a275256f012b
This fixes a bug where a word would be entered in the user
dictionary with the wrong locale.
Bug: 5667272
Change-Id: I219d5461f8f8c74b6ab34f9bb157a4b977f00e68
Bug 5555929
This problem only happens when in landscape extracted text mode.
A suggestion pick from the popup window replaces the text in the ExtractedText,
when it should do it in the underlying source EditText instead.
When the replacement text is longer than the replaced text and is at the end
of the text, an IOOB occurs because the ExtractedText was not modified (we now
correctly change the source text using replaceText_internal).
This is basically an implementation of the TODO comment next to setSpan in
TextView.
Change-Id: I6575137530e0bb5c9ac7e40cc2bba9c66dc254d2