remove dependence of ResearchLogger on LatinImeLogger
for autocorrection
multi-project commit with I32cc134b
Bug: 6188932
Change-Id: Iaeda97eb43fa4782db2d1b2a6d8d09a93b395111
We don't need to pass this down all the way from LatinIME any more.
It fetched be done exactly where it needs to be.
Change-Id: I9f277f9c4f9de70ae755a1334d86c67bbb24c988
the new points are all at Log.x() positions; only those appearing directly
related to user input were added.
multi-project change with I159f5de2
this CL is the same as I618bcd07, which was reverted because of
incompatibilities with vendor branches.
Bug: 6188932
Change-Id: I999249dceb0c04f5a4ffbfff25caed09d24a2c52
the new points are all at Log.x() positions; only those appearing directly
related to user input were added.
Bug: 6188932
Change-Id: I618bcd07b22c9efc794745678b073afe1e79a697
This change also undoes the effects of I8694eb9016, which was an initial
effort built on Utils.UsabilityStudyLogs. Now Utils operates as it did
previously, for backward compatibility, but the ResearchLogger retains
the new log format.
Coordinated with I274b75c5.
Bug: 6188932
Change-Id: I41208bdc6b511f69a010c9fc38a936521beba7d5
The old code would remove caps from the first letter if
auto-capsed but that makes very little sense when the word
is camel-cased. Also, it would not correctly handle
surrogate pairs, and would require a direct reference to
LatinIME and a specific method to do the processing in an
unexpected place.
Change-Id: I416d6a805242788a2473f007ca7452c9fe3f5205
This fixes the input logic tests that were broken and suppresses
their dependency upon the spell checker proximity. Instead, it
gets the Keyboard instance from Latin IME and uses the actual
coordinates, which results in a test run closer to what actually
happens during typing.
Change-Id: I3a81d249ee7fb3ac6ae6940aa2e8b2421e829e5c
UserBigramDictionary -> UserHistoryDictionary.
Also update all methods, strings and comments, except those needed
for backward compatibility (which only include the name of the
database file).
Change-Id: I0bccea29880dc566b90100575b83baaa947b03ae
UserBigramDictionary now assumes both functionalities. It will
be renamed to UserHistoryDictionary in a future change.
There are several reasons to do this. First, there is a lot of
duplicate code in User{Unigram,Bigram}Dictionaries that are
factored by the few lines of code in this change. Also, other
dictionaries like BinaryDictionary or ContactsDictionary all
assume both responsibilities, as should be the case
theoretically.
It is also possible to do this because previous versions don't
write any unigram data that we'd want to reuse. For even older
versions that do write data, we can't really make any sense out
of it. Bigram data however can be useful, and this allows us to
reuse it easily.
Change-Id: I755525f92744e1536eaef097527e8151b7859a30
A lot of things don't really make sense in the old code.
Let's streamline it for now so that we have a cleaner interface
to work with. This is preliminary work for bug 4192129.
Change-Id: If01a5974cfadc43afced610c57fcf7fde67c1346
This method now only sets words, so it should be named set.
The functionality is identical since there are no more places
where the list is reused.
This will also allow to make the list final in an upcoming change.
Change-Id: I25b0c7d7f13c3fa5d89806f01f48f1026769603f
Hopefully that will end in Suggest/SuggestedWords being autonomous
and won't need the logic spoon-fed to them
Change-Id: I915661bce13c69c8a5b8e5d4a8c41e18fea594cf
We only use some of those results in one branch of an if() test.
Let's not compute those that are not needed.
Change-Id: I6ca068646b86d2980fb88e75b110ad077362c4ff
If !mInputAttributes.mInputTypeNoAutoCorrect then mCorrectionMode
will not have allowed #hasAutoCorrection() to return true.
Change-Id: I1b498d5aeb26194c765cc9b9dcb24d980de43894
It's probably simpler not to have registers dance around,
and just message the feedback manager when the audio event
happens.
Change-Id: Id0710ed102d10d01f1af93ad8cb660653bb3a9f8
This duplicates the functionality in ComposingStateManager at
a fraction of the cost. It's not used yet.
Change-Id: Ica2607fb2f7c41e11189fcb566e253db8f62596f
This fixes two defects:
- One where some separators should promote a phantom space to
a real space. This bug had a unit test but wasn't tracked.
- One where French punctuations would behave incorrectly. Tracked
Bug: 6113693
Change-Id: Ia7f86fc960e00141757632ab2c9bce9168dd6966
It makes more sense to catch words with the safety net in
updateSuggestions() than in showSuggestions(). Also, it's useless
to do it in updateBigramPredictions, because the result will
always be provably false.
This will also help with writing unit tests.
Change-Id: Ifab81e6c5a74b1aa75cf85ef7742fee69a98f5ce
I wish "are we autocorrecting?" was not computed in a dozen
places all depending on a hundred code paths
More than likely, this fixes very subtle discrepancies
between auto-correction indicator with the underline and with
the LED on the spacebar - which is not displayed any more in
the current version anyway. Especially, the LED probably
would have been off when the word was caught by the safety net.
Change-Id: Idda3021771081d6155b06915e728ecd64d9e042e
The message id 0 is used intrinsically by the framework
for all messages without a specific ID. Using 0 here
we can't reliably use the post(Runnable) method on our
handler, because these would in *some* respects be taken
for update_suggestion messages, but not all.
For example, they'd be removed on removeMessage() but
they would not trigger the actual process. This would
lead to utter confusion.
Change-Id: I5d9b01d38e2ff090cd0d80c27421dc8a41c317b8
This is never called any more, since we now use the cancelCommit
path to react to a backspace after a manual pick.
This concludes the run of changes to implement feature
request #5968922
Change-Id: I23df653bb2a3de2ba0152394d5d616a42ac7519b
Also remove a test in debug mode that would check for absence of
a situation which is now expected.
Change-Id: Ia5be350bc98a604b3bf8f6057652c5534f6a19af
This is new code, but simple code. The new code path is never
used for now, but it will be in an upcoming change. This serves
to implement feature request #5968922
Change-Id: I3e67731ec6e9fc0b86c5cbd972e9c081781c11a9
Now that we have stored our committing separator, we can use
it directly instead of reading it back from the text view
paying the IPC cost. This prepares for feature request #5968922.
Change-Id: Ifeaa2d659cf12b91c89d28e6ff7d07a669258184
This stores the separator that was used to commit the word in
the LastComposedWord. It may be NOT_A_SEPARATOR if there was
no separator (for example, the cursor moved causing a commit,
or there was a manual pick). This is necessary to implement
feature request #5968922.
Change-Id: I5fcf19a78ec66d68d4df89418eaef13952588207
There is no point storing the prospective autocorrect - we are
recomputing it anyway. The committed word however will be necessary
to implement feature request #5968922.
Change-Id: I588c18e1a5a1050a791d601de465f421ccbe36cd
This would happen when a character is not a separator but is not
a word starter. Such characters include single quote and
dollar, and others non-letter, non-separator chars.
We set the bigram predictions if any - if not so configured, this
will fallback on setting back punctuations into the strip.
Bug: 6010408
Change-Id: Id203bbe87f8c13de0d5027b555c9067c7ec98f92
It turns out this was available in an unexpected place.
Fixes both the following bugs
Bug: 5948469
Bug: 6023118
Change-Id: Ie1a91b8268540ea0f0df02bee94c3bbdeb0fa4c5
This change also cancels double tap and long press timers if other
letter key is pressed after shift key.
Bug: 5693999
Bug: 6017610
Change-Id: I3b5f3debfb8915fa73a93b409a38afadf24132e9
This change also
* Honors the custom action label in EditorInfo.actionLabel.
* Invokes InputConnection.performeEditorAction if action is specifed
at EditorInfo.imeOptions or actionLabel/actionId.
* Stops using InputMethodService.sendKeyChar. Implements
sendKeyCodePoint instead.
Bug: 2498607
Bug: 5961809
Bug: 5368408
Change-Id: If4cd5eb3dacfc6b6a7ea434b0617c2438e06e42d
A suggested punctuation is sure to be 1 character and a word separator,
so the isSuggestedPunctuation() test is redundant.
Change-Id: I3d31f0825f069f64d514682e46be62afdae25291
Remove a useless test (we can only come here if the code
is not a separator, as we are only called from onCodeInput
inside an explicit test).
Change-Id: Icd996a5a1c18a550117a144a1d35f167b96211f7
Inhibit adding phantom space for tld keys even if the last
character inserted in the textview is not a dot
Change-Id: Ie92554ead7a18c932480905c5738aff7c0159a32
When the application is modifying the text under our feet,
we may come through this code path. We should log the error
rather than crash.
Bug: 5869235
Change-Id: Ic0fd24c3bc805d44c5db0ad781ddebeca0450614
This change also
* Doesn't use Key.getRtlParenthesisCode to get correct parentheses
code in RTL context. Intead uses the outputText feature of
moreKeys specification.
* Move CVS string parser from KeyStyles to Utils.
Bug: 5948247
Change-Id: I45752c7d01b4f7d3f3da900b110a2185b336a1f0
This change also
* Rename phone shift keyboard to phone symbols keyboard.
Use CODE_SWITCH_ALPHA_SYMBOL code to switch between phone and phone symbols keyboard.
* Remove phone symbols keyboard from tablet.
* Introduces enableLongPress flag of Key.keyActionFlags attribute.
* Remove clumsy long press code from PointerTracker.
* Remove CODE_CAPSLOCK handling from LatinIME.
* Make KeyboardSwitcher to invoke haptic and audio feedback.
Change-Id: I00e1f697a10ab5112aec75e36853b96246ff5054
If any shift state variants of alphabet keyboard layout is not
specified in KeyboardSet.Element, it will be automatically generated
from base alphabet keyboard definition.
This change also
* Eliminates KeyboardShiftState object from Keyboard.
* Removes various set shift state methods from Keyboard.
* Removes KeyboardSet.Element.elementAutoGenerate attribute.
* Separates "sticky" Key.backgroundType to "stickyOff" and "stickyOn"
* Add preserveCase flag to smiley, .com, and labeled special keys.
* Rename KeyboardShiftState class to AlphabetShiftState.
* Rename some attributes from *UppercaseLetter* to *ShiftedLetterHint*.
* Introduce shiftedLetterActivated to Key.keyLabelFlags
Change-Id: I01a0a8efeeaa76820ae728a5bdfa8d02b6ce74b7
This deactivates the cancellation at each separator pressed while
not composing a word. The net effect is to fix
Bug: 5875776
Change-Id: I67aa3f842ddff250828c60596ad5a7e466c1ddaa
This is cleanup.
This also introduces a "deactivated" state to the last committed
word, that can be used for
Bug: 5875776
Change-Id: I1855adb8ac8123f6d2c5365b0ae899145e5c3ba1
...and avoid crashing in one case where the application may
change the text while we are typing.
Bug: 5685922
Change-Id: I4a22c63168986f43ac84f512aaa4267023d536e3
All calls to this method are done with the same parameter,
and it's really hard to understand if we call upon this
member inside.
Change-Id: I787664bb59053ab0fe666ed812fb12b2b9090918
Fix two related subtle bugs:
- Stop singling out fat-finger-only corrections for rejection
when touch coordinates are not available.
- Remove a racy check that would happen only in debug mode
Change-Id: Ic904f9b27c091ca6b369052c4e65a630bff81257
* Rename KeyboardActionListener.onPress to onPressKey
* Rename KeyboardActionListener.onRelease to onReleaseKey
* Merge KeyboardSwicther.onPressShift, onPressSymbol, and onPressOtherKey to onPressKey.
* Merge KeyboardSwitcher.onReleaseShift and onReleaseSymbol to onReleaseKey.
* Merge KeyboardState.onPressShift, onPressSymbol, and onPressOtherKey to onPressKey.
* Merge KeyboardState.onReleaseShift and onReleaseSymbol to onReleaseKey.
Change-Id: Icf28fd18e238c5e534c292893e4ab5b6b98e72f8
The basic idea is that in some situations, we would restart
suggestions, but before evaluating them we would bail out
because suggestions were not requested. This would lead to
the "correction" set to null, so we would commit a null word.
This fix does two things:
- Do not restart suggestions when not requested.
- If we still end up with a composing word when suggestions
are not requested, we select the typed word as the
correct version.
Bug: 5846646
Change-Id: Ic35351841d0cb20afa99092ef681ecb7bd68bec6
The method deleteWordAtCursor would call finishComposingText,
which is a very unexpected state change and would probably cause
surprising bugs to any parent that would call it.
As it happens, it's not used anywhere any more so let's just
remove it.
Change-Id: Iaa9200866e40b4e914f76baa987279948300679c
This would crash the program when inputting a punctuation
symbol that should not swap with a weak space through the
suggestion strip, then press backspace.
Those include all two-part punctuation symbols in French for
example, as well as magic space strippers like the dash in
English. For English all suggestion strips symbols happen to
be magic space swappers so this would not happen in English
by default.
Also fix a typo.
Change-Id: Ia40678c264e978509b5786290a75a3c57181648e
Also this change moves LatinKeyboard attributes,
autoCorrectionSpacebarLedEnabled, autoCorrectionSpacebarLedIcon,
spacebarTextRatio, spacebarTextColor, and spacebarTextShadowColor to
LatinKeyboardView.
Change-Id: I7cc27ce1fc550e9f620a9ed0fbe4b8172902d5a1
This is the last one (whew)
Also move a somewhat unrelated initialization out of the
input attribute initialization function.
Change-Id: Icc77b32fd16b112ab43786715061b1c9dca31c04
The ultimate intent is to make these variables final,
which will allow to move the computing function to the
InputAttributes class.
Change-Id: Ifb1fc7321a19b10d60aa63fa0daaa2708deda2cf
...instead of the hard-to-understand mHasUncommittedTypedChars.
This is possible because now the word composer is actually aware
of commits.
Change-Id: I36b664ce8402a280f801e87b9ebe161f416b0853
Also rename the function to reflect better the behavior.
An upcoming change will clean up the remnants
Change-Id: I19bdf0d9e95f62ee749e1f64fe17132c4a5ef0bc
Upon autocorrection, there is visual feedback in the text
view that quickly flashes the background of the text that
just changed. This fixes a race condition that happens
upon autocorrection when typing fast, and that results in
flashing one character too far left (typically, the flashing
area includes the whitespace before the corrected word and
not the last character of the corrected word).
This happens because the call to commitCorrection may
happen before or after the IPC sent by sendKeyChar, but the
arguments are fit only for the case where it arrives first.
Change-Id: I9b5442a665aad5a9bc66cd49228075b9056b37fa
This place is very confusing because a member variable with
a consistent meaning is hijacked for the duration of a function
to mean something else. This is in the way of easy-to-understand
refactoring.
Change-Id: If79bc771950d6bfc0ad5f0e9c51c7ef1dbb45b66
- Stop the word composer from escaping - take a page from the law
of Demeter and only report what is actually needed.
- Fix typos in comments.
- Add a comment for a fishy processing.
- Remove a useless local variable.
Change-Id: I5fa78901cbb5483fc9683bfb7094f47244b85df6
mBestWord has a confusing name - it's actually an auto-correction.
It's cleaner if it lives in the word composer because an
auto-correction should be tied to a specific user input, and
should be reset each time the user input changes to avoid
race conditions.
Change-Id: I718d29395bc747372067e6440e090c6a181994ae
Both tests have the same meaning. They should be merged.
Also, if "deleteLast()" deletes more than one char (which
never happens in the current implementation, but it's not
guaranteed), the new code is more correct.
Change-Id: I216df7cd45f4a7d76d1d5d6aa7f8d7f9a6e35ea3
If mHasUncommittedTypedChars is true, then
mWordSavedForAutoCorrectCancellation must always be null, and
spaceState must always be SPACE_STATE_NONE.
Hence, this change is supposed to be very no-op.
Change-Id: I2716f7372d996cc4dec40a4b7ac1ee7f5f4afe91
postUpdateShiftKeyState used to be called also when
mEnteredText is not null => this is a bugfix.
The rest does not change the logic, as posting a message can
be done anywhere within the function with no impact.
Change-Id: I7888797c0778702d64f96701e35b611a55a6a259
If there are no uncommitted chars, we shouldn't enter any of
the tests that follow. We didn't use to, but a change today
made it possible - it should not happen.
There is no point in doing the rest of the tests, they are
sure to fail.
Change-Id: I580dd104aff3585de72a93b38989bfd9713f615b
This also includes a new memorized string with simpler
logic that will allow to remove other members
Change-Id: I0b97243084902e68fcb835b6163c86fef8190ebc
The ultimate intent is to close it up in the settings, as it does not
change while typing, only when the keyboard is open again.
Change-Id: I12ff56e7482c1584877fe5531473bf03e95a60f6
These calls, setAlphabetKeyboard, setSymbolsKeyboard, and
setSymbolsShiftedKeyboard have to be call backed from KeyboardState.
Bug: 5708602
Change-Id: Ibbe1a21bd10bf942e17886869c0ab0fa1735b87e
I14dd3815 special-cased single quotes at the start of a word, but
did not do so correctly - it would kill a composing word if entered
just after some punctuations.
The right test was not isCursorTouchingWord() but
mHasUncommittedTypedChars, which actually makes for a simpler
implementation.
Bug: 5648032
Change-Id: Icd21d213e0cad6da68cacfeb921502cd8dcfac95
Single quote at start of word is not considered a part of a
word any more.
Single quote at the end of a word now behave like capitalization:
lookup in the dictionary is done *disregarding* a final quote,
and it is forcefully added back into the suggestions afterwards.
Bug: 5566368
Change-Id: I14dd3815f4b743edba56d64a3abdf4b73d863a6a
This introduces an elementary undo facility that accounts
for magic space, strong space, double space and its cancelling,
and swapped punctuation and its cancelling.
The former three were existing behavior ; this change adds
the swapped punctuation cancelling behavior.
Bug: 5454442
Change-Id: I87af633f30caa2788e9af725e556a7f0746d9a14
Remove a state that can never be reached, and ajust all the
callers that would always have received false.
Change-Id: Iac025568be11743428419e0772da306a4f0a0bf1
On space swap or space removal in some occasions there would be
a small blink on the screen. This change fixes that.
Change-Id: I486cbcc5dfcafd531b3fa92c4f9a3255832f22cc
This bug would kill the case where the whitelist contains
a word to be autocorrected to an uppercased version of
itself, and the user would enter the uppercase version.
In this case, this bug would cause the typed word to be
killed off the list of candidates, and possibly autocorrected
to the *next* candidate.
When the whitelist checks whether this the typed word is
a candidate for whitelisting, this change has it check whether
the whitelisting results in the typed word before returning.
Hence, it can keep the case-insensitive behavior of the
whitelist.
Coincidentally, this change renames the method used to do
this, because it does not comply with the general contract
of Dictionary. This happens to be in the way of another
upcoming change.
Bug: 5420371
Change-Id: Ifb305271acc5f171adf9b18c762ae7975b14be0a
When long press triggers caps lock, the keyboard also triggers haptic
feedback.
This change also fixes trivial harmless bug in KeyboardSwitcher.
Bug: 5424681
Change-Id: I62706b49abd7be1dcebc3c5166ea03f426fc8c86
This removes the calls, but another change will be needed to remove
the messages LatinIME used to send itself to update the suggestion
strip.
Bug: 5402537
Change-Id: I5d1aa63a892516f339f3ceac21f43771b5ffda34
This change updates suggestions when the cursor is moved.
It is now reasonable to remove the explicit test for
TextEntryState.isAcceptedDefault because it is now shielded
by mExpectingUpdateSelection : actually, this probably fixes
a long-standing bug.
Bug: 5337309
Change-Id: Iee4046420c6a88d1a07d428230f93c3ebef25c39
IME is called back four methods for each input field as a IME life
cycle. The four methods are onStartInput, onStartInputView,
onFinishInputView and onFinishInput.
After orientation changed, Those quartet methods will be called back
twice. This behavior of the framework might be a bug.
In order to restore the previous keyboard layout, we should skip
onFinishInputView and onFinishInput of the first quartet and
onStartInput and onStartInputView of the second quartet.
Bug: 4311428
Change-Id: I450ddc0cce5d00abc971ffd42a507a8a86682548
CL https://android-git.corp.google.com/g/#/c/136474 refactored
the fullscreen test, but ithe IME_FLAG_NO_EXTRACT_UI test was
lost in the process.
Note that there is still a problem (orthogonal to that change
with key_preview_backing, which appears opaque and black sometimes.
I'll re-open 5315001.
Change-Id: If3a73179d21eaca10bdc948db7bac4b4f7a88d34
This change also separates controlling visibility of "key preview
backing view" from suggestions strip visibility.
Bug: 5315001
Change-Id: I190a71f7956c804e5d89d2d5bacecc62d565ac2c
The locale is specified by KeyboardLocale extra key in method.xml,
LatinIME will use the specified locale for keyboard layout.
Bug: 5238658
Change-Id: I8e6cb66c73a7ac1bf611d9910b42fa9cff38eba0
This change also introduces "AsciiCapable" extra value for subtype
that indicates the subtype can input any ASCII code point from its
keyboard layout.
Only if the input field has "forceAscii" private IME option and the
current subtype doesn't have "AsciiCapable" extra value, the en_US
keyboard layout will be used for the input field.
Bug: 3384942
Change-Id: I25e2553e37ecb5002df1164e45f6273845fe463b
A recent change had the contacts reloaded every time a new field
is touched. This change not only fixes the problem, but also removes
reloading contacts when changing language, which should make language
switch within LatinIME lighter.
Bug: 5125034
Change-Id: Ia61c4f75a8617113cdce88a2e2c6fdf073146a2d
This does not really fix the underlying bug, but it does fix
the apparent symptoms.
When the user presses space and a letter quick, the
onUpdateSelection handler may be called after the letter has been
actually committed. The keyboard then happily proceeds to clearing
the composition because it thinks space was pressed (or the user
moved the cursor, since it can't guess which happened).
This change removes this behavior when we are expecting an update
event from a keypress. This means the bug still exists if the user
presses space twice and a letter, and all events come after the
letter, but it is very very hard to reproduce this. There may be
other collateral damage when the user moves the cursor in the form
of race conditions, but likewise, they should be really hard to
reproduce.
Bug: 5100521
Change-Id: Ib05328c9b451bf6fe288ae00296fd283a9a4e863
The "deleteChar" argument of this method is acutally always true in the current code path.
Also, in this method, textToTheLeft virtually never has a punctuation letter as its initial
character. This change is one of preparatory changes for bug:4983945.
Change-Id: I531a32570a35634c21c1d74b2b461e40a1b7f660
This change removes everything related to the quick fixes
Latin IME option item.
Note that Autotext is still used if the current subtype language
is the same as the system language.
Bug: 4985058
Change-Id: I51728a2190543ffb9e004470674ef6257b14f6c2
This allows the user to enter a period via double-space after quotes,
currency symbols, brackets and other non-sentence-finishing
punctuation marks.
Bug: 3430389
Change-Id: Ibe40b3902861207eb918e7be6113e8be12216f53
Before starting input on new TextView, we must clear the CandidateView
because it may hold the suggestion of previous TextView or even worse
the suggestions pane has been expanded and keyboard has been hidden.
Bug: 4995414
Change-Id: If848320c1a510e7018d36ed8ac61291be2fc6ce5
This change also rename static inner class to more readable name and
get rid of unnecessary object reference from PointerTracker.
Bug: 4768084
Change-Id: Ie4e2b940d66b47d41efcae7eeac853cdae2e4d38
To sort out the issue, main keyboard and mini keyboard have to share
the pointer trackers.
In order to prepare for that, KeyboardView needs to be refactored as
two separate classes. KeyboardView is responsible for drawing keyboard
visual. And LatinKeyboardBaseView is responsible for handling key
event and mini keyboard as well.
Bug: 4768084
Change-Id: I5643e333b9bdfde0c939a0693cea76bd22f38897
I left TODOs in Suggest.java because we must pay attention to locale
when changing character's case. Filed another Bug: 4769095 to track
that.
Bug: 4768050
Change-Id: I1ae2c4ffd2208403a8c2a25dd3a56b71dcefc826
When using the sliding spacebar language switch on ICS, both
LatinIME.toggleLanguage() and
InputMethodService.onCurrentInputMethodSubtypeChanged() invoke
LatinIME.onRefreshKeyboard(). This change eliminates the first one if
it isn't necessary.
This change also cleans up the followings.
* reuse theme Context when the keyboard theme hasn't been changed.
* clear the Keyboard cache when theme has been switched.
* eliminates unnecessary Context reference from LatinKeyboard and
SlidingLocaleDrawable.
* recycle Bitmap and reuse Canvas in KeyboardView.
Bug: 4725930
Change-Id: I87366e9304879d94d12b7345adea768d86d43519
This change removes horizontal scroll from candidates strip. Instead
of that this change introduces "fixed 3 items candidates strip" and
"expandable candidates pane".
Bug: 4175031
Change-Id: Ia367d9074436fdea76d3b653d81798ce2749170e
This change fixes a bug that prevented to choose a prediction
several times in a row because the predictions would be replaced
right away by punctuations.
Please note several things about this change:
- Recorrection is pretty much in the middle of being refactored.
This change has no effect on recorrection itself, but may make
existing strange behavior more obvious when moving the cursor
for example.
- The part of this change in Recorrection.java is not used in
master at the moment because ongoing changes on recorrection
result in the control never landing there, but would have been
needed in the past and may be needed in the future.
- This change may have adverse effects on performance which need
to be evaluated. A comment in the code has also been written
to this effect.
- This does not fix bug 4466199, only addresses a pinpoint case
of it to help evaluating the bigram predictions feature.
Bug: 4466199
Change-Id: I7219e5aeb74dff9251d12b2a72f94448dbb3e63f
When keyboard theme has been switched, input view will be replaced
with new theme one and current CandidateView will get stale. The
CandidateView must be reseted in setInputView.
Change-Id: I36fd14280572d2d367cfef549d7705b3b321ba3e
Also add an option for popup dismissal delay so as to inaugurate the
new screen. Besides, remove a path for options to escape from
LatinIME and replace with a direct read from the settings.
Change-Id: I7ec6e724262871fa6523506ecc39f65c5fbe34da
Fix a bug where the "Touch again to save" message would not stay
on screen, following a wrong fix for a problem where Gingerbread-
would not display punctuation in the suggestion strip in
WebTextView.
Change-Id: I3556f83f867240ed7f16753450e6c975853208e5
Split symbols into:
- Symbols that should swap themselves with a magic space.
- Symbols that should remove the magic space.
- Symbols that should transform the magic space into a real space.
Also, have symbols inserted from the suggestion strip always consider
the space before them to be magic.
Also, do minor refactoring to remove useless variables or make clearer
how to carry some symbol-related information.
Bug: 4391347
Change-Id: Ie2308a62c8fef55e3610897c0f58943acb7aa8c9
Picking a suggestion inserts a space after the word. This change makes
this space a magic space.
Incidentally, do some minor cleanup: add CODE_DASH, CODE_SINGLE_QUOTE
and CODE_DOUBLE_QUOTE to Keyboard and use them throughout the code,
and remove a useless import directive in some unrelated file.
Bug: 4319740
Change-Id: I245f396c34dd0af820bca91edc4ec363238a4ae4
Add a setLocale method to Utils that returns the previous locale.
Also unify all calls through the code.
Change-Id: Ic850dc5df19fba00ed3601835652859b4321b544
This change also rename methods that should have been renamed in a
previous commit (namely, the
*SetBigramSuggestions family -> *UpdateBigramSuggestions)
Change-Id: I18cac17ba2b93fcc011ea133324f2c7f3532946c
This change adds the option for bigram prediction under the option
for bigram suggestion. The "prediction" option depends on the
"suggestion" option.
This change also reorders a tad bit the settings screen. Namely, it
sticks both bigram options under a "bigram" category, and groups the
options that did not have a group under a "other options", or misc,
category.
Finally this change also renames the internal name of the "text
corrections" option category to "correction_category" instead of
"prediction_category" which was misleading.
Change-Id: I2d8787c8a391fd8202ed3a686c613494b7260a1e
This also fixes a small inconsistency upon clicking on whitespace
twice in a row.
Also add some unit tests for an introduced and an existing method.
Change-Id: I1be2fb53c9624f4d0f5299009632cb4384fdfc15
Previously the key preview was implemented by PopupWindow. The key
preview popup window would be dismissed and shown each time the key
was released and pressed. It turned out that it was taking several
milliseconds.
This change implements the key preview by a simple TextView which will
be layout-ed at absolute coordinates within the screen FrameLayout.
And dismissing and showing the key preview is implemented by the
TextView's visibility.
This implementation needs careful coordination of candidates.xml
layout and LatinIME.onComputeInsets to control suggestion strip
visibility.
Bug: 4179964
Change-Id: Id6347cb35b91eb14ab20dd2f312e58b54b6625a7
- VoiceConnector to VoiceProxy
- VoiceInputConnector to VoiceInputWrapper
- VoiceLoggerConnector to VoiceLoggerWrapper
Change-Id: I908ddc590c8846cf5cbd80b9c0257cb65c638bde
This change adds basic support for an external dictionary provider.
It adds methods for reading the dictionary itself from an asset in
the dictionary provider package directly, obtaining the file name
through the ContentProvider interface; it also adds a way of getting
the data through an InputStream and copying the file locally.
Incidentally this change also adds the code needed to listen for
updating the dictionary provider package and reloading it in time.
This change also goes hand-in-hand with Iab31db6e, which implements
the small closed part of this.
Issue: 3414944
Change-Id: I5e4fff99a59bb99dbdb002102db6c90e6cb41c8a
This changes:
* Flag initialization code in BinaryDictionary to be more unit test friendly.
* Removing unnecessary class hierarchy of LatinIME inner class WordAlternatives.
* Formatting normalized score neatly.
Change-Id: I9f10c093d4f36258fe883cf3fb10cbbda2770497
This change removes the boolean flag mJustReverted. Because we
preserve separator after canceling auto-correction according to
bug#3230708, there is no need for this flag now.
Bug: 3193810
Change-Id: Icea06ece569774b494ffa4ca4a899c898661cc19
At the moment, if there is no binary dictionary, even when pressing the
word in the suggestion strip the option to save in the user dictionary
is not displayed. This change addresses that.
Bug: 3363756
Change-Id: I4993a7f81ed15ab948a3098cdc49663e0f109e4a
This change deprecates "nm" private IME options and introduces new
private option, <package name>.noMicrophone, instead.
Change-Id: I9d5e3daaead2cdd42e017cd29f5f786ef3ba3649
This change also introduces number password (a.k.a. PIN) layout. The
text password layout will follow.
Bug: 3384942
Change-Id: I50b5e413e47a28d5285fd0468115e11ce46c7f18
It appears it is not useful to listen to this change, because in any
case, settings will be reloaded when the view is shown again or when
IME is changed.
Change-Id: I08dddccc630b01718da7fab011ce14f189dd31c3
Also change the name of the default value for re-correction for
consistency with other constant names.
Bug: 3426884
Change-Id: I615ba640fb17e6d7514b8a0e4f52028eb0e23908
Move and rename KeyboardView.computeProximityThreshold to
KeyDetector.getMostCommonKeyWidth. And make it public for unit test
use.
This is a part of multi-project change (If751659a, Idb18f362)
Bug: 3414081
Change-Id: If751659a53c7412f836d6d28866760ffe84b179b
Change the default value when retrieving the PREF_SOUND_ON property
from the Settings from false to true.
Change-Id: I871cfaaf1f33b5e0301c84ee9c94f1c429901021
If the configuration says the device should not display the "Pop up
on key press" setting, then do not read the preference and always
use the default setting.
bug: 3406181
Change-Id: Ice2989760cda1d40387ed88311144cbf2c114b93
This reverts commit de59a84029 (Ie8d4469b).
The requested feature has been implemented by I92d98bed.
Bug: 3238092
Change-Id: I9d53030b3d5c9a0f24883292a93576a3231813aa
This change aslo eliminates duplicate suggestion from past
suggestions. And call setTypedWordVaild to past suggestions.
Bug: 3367722
Change-Id: I7ffaa2f7e4e30b3951b6c2df002d269671c9d654
Conditionally remove the "Quick fixes", "Bigram suggestions" and
"Usability study mode" options, depending on configuration.
When disabled, have the quick fixes and bigram option become
false if autocorrect is off, and true otherwise.
Also reorder options to bring "Auto correction" above "Show
suggestions".
bug: 3282448
Change-Id: Ib7fd928be417a816ef9e21423a531773069b7468
There has been a bit of refactoring in RecognitionView in particular to fix the portrait layout.
The main issues found were:
- the size of the keyboard is specified in inches, and
(cm)(inches + inches) != ((cm) inches) + ((cm) inches))
- the height of keyboard background is high as the landscape keyboard, but it higher than
the portrait keyboard. This is not an issue on LatinKeyboard, as it overwrite the
onMeasure method. However, if I use the same image background in RelativeLayout
the Relative layout height is set to the height of the background, thus higher than the keyboard
- the change configuration was not propageted correctly
Change-Id: Id5dca425826997c573ccae7a085d5ddc9719733b
Do not show the recorrection option on xlarge terminals,
and make it true by default. Also, bring the Auto-capitalization
at the top of the settings page.
Issue: 3282448
Change-Id: I51a9ae6c7e496be2970107277f0a4ac65b12821e
This change also draws the language name in light gray on spacebar
without fading out even when the keyboard locale has not been changed.
Bug: 3362369
Bug: 3361915
Change-Id: I66538b03ce2e48c3441091319d0377176f8118ec
This change reverts removing SubtypeSwitcher.onConfigurationChanged by careless in I432be8f7.
Bug: 3290290
Change-Id: I796ea01877d61eb750dabdeb3fdbf87666646c56
This change also introduces the following.
* space bar language switcher is enabled for phone device.
* get rid of spcae key icon from number keyboard of tablet.
* slightly lower the position of language name on space bar of tablet.
Bug: 3290290
Change-Id: I432be8f757bcc84c257770112ff1f6fa7970c584
This change is a preparation for upcoming optimizations on dictionary file loading.
* We can consolidate dictionary files because we are no longer relying on Asset Manager.
* Stopping compressing dictionary files as planning to use mmap() on the region in the apk file.
* Probably we won't rely on Asset Manager. Instead we'll probably use offset and size obtained from AssetFileDescriptor.
Change-Id: Id57dce512fd3d2397a58628f8264bd824194da76
This change also fixes auto snap back behavior of key which has output
text, such as smiley key.
Bug: 3297825
Change-Id: Ia06e1abc0fbdff2a26504ddcce1dc7f933b45453
This change
- introduces the popupKeyboardTemplate attribute of Keyboard to
specify XML Keyboard file for popup mini keyboard.
- introduces the maxPopupKeyboardColumn attribute of Keyboard to
specify the maximum column of popup mini keyboard.
- changes the content format of the popupCharacters attribute of Key.
It now represents keyLabel, codes and keyTextOutput of each key of
popup mini keyboard using CSV format.
Bug: 2214959
Change-Id: I539e310f7e38a049ee193de0b4ad5d7afdce37b1
This change re-implements CandidateView using HorizontalScrollView and
customized Button, so that the candidate strip can be flingable.
This change also introduces the following features.
- Highlighting candidate strip and space bar is configurable by
@bool/config_candidate_highlight_enabled.
- Candidate strip can be centered with left/right padding if
@dimen/candidate_strip_padding size is greater than 0.
- Candidate text size is configurable by @dimen/candidate_text_size.
Bug: 1575885
Bug: 3230726
Change-Id: Iedf78ff31bc9f2f6291a8e8fb7faa0e6b961dd6d
This change,
- changes voice key code back to -102
- renames some key code names and method names
- adds mic_slash_holo to drawable-hdpi
Change-Id: I8be3a20921f472ece4298edad2d275f29a7e4955
This change also moves KeyboardSwitcher and related classes to
com.android.inputmethod.keyboard package.
Multi project change with Ib23017b2
Change-Id: Id7d54b24615fe22ebb540ca847549909e346ee24
This change introduces new package com.android.inputmethod.keyboard
which hosts keyboard related classes.
Also adds missing @Override and @SuppressWarning("unused") annotation
Change-Id: I0317f5cfa317e13f3c77815f48ffc69b5d1ade05
With this change,
- Shift and Shift lock state of keyboard is maintained by
LatinKeyboard.ShiftState.
- Shift key state is maintained by ShiftKeyState object in
KeyboardSwitcher.
- LatinIME informs KeyboardSwitcher that shift key press, release and
long press and KeyboardSwitcher determines which state LatinKeyboard
and ShiftLeyState should be.
Bug: 3193390
Change-Id: I948ef26fda512eb1cb0ebddc89d322c4f4f4d670
This change also eliminates KeyboardSwitcher.refreshKeyboardCache,
LatinIME.reloadKeyboards() and LanguageSwicther.getLocales().
Change-Id: I5fd4914660ea1c955ddfa0ca62b920f9bcd53e1b
This change also fixes that the popup preview of ALT on symbol
keyboard is not showing.
Bug: 3122877
Bug: 3127255
Change-Id: I978cb30a0d05298274d8ab6541b91323a0fef211
Merge commit '938c0a3722a9c597931e6f75408dc7ab636d7052'
* commit '938c0a3722a9c597931e6f75408dc7ab636d7052':
Fix - "Touch again to save" not working for manually picked suggestion when re-correction is enabled.
Merge commit '644445868f1023b3263a149f2faf617b88341d20'
* commit '644445868f1023b3263a149f2faf617b88341d20':
Addressed bug: 3058217 "-" key not working at beginning of line
To avoid a corner case of bug#3070963, in toggleShift() method of
KeyboardSwitcher, the shifted symbol keyboard will be set if current
keyboard is symbol keyboard or is not shifted symbol keyboard.
This change also implements mini keyboard cache with WeakHashMap.
Bug: 3070963
Change-Id: I868fc072e2f21bddded1622b800a53b9a6a43e91
Also fixed related issues below:
* Punc suggestions list was sometimes not displayed after cursor move which follows re-correction
* Punc suggestions list was disappearing with words which contains certain punc chars (but not word separator) such as ' and -
Change-Id: I36faf679321782fa8eaf318411308a4a6b89cc25
Merge commit '4d158dc2779ffff8c92a41f32e6885bd0f155fc3'
* commit '4d158dc2779ffff8c92a41f32e6885bd0f155fc3':
Check recorrection on focusing into a text field that has text already.
Merge commit '7f2a6a056b67efa2a1fb623ca4cf73f7fb6c7d8c'
* commit '7f2a6a056b67efa2a1fb623ca4cf73f7fb6c7d8c':
Capitalize the displayed text in the suggestion bar when all of the user typed chars are upper case
Merge commit '27bddbe67f00953dc82a8543fe610c9010f7077c'
* commit '27bddbe67f00953dc82a8543fe610c9010f7077c':
Move RingCharBuffer as a singleton in Util
Merge commit '300362f20982974d07876dee01b4550b8e54d449'
* commit '300362f20982974d07876dee01b4550b8e54d449':
Use the phone keyboard for NUMBER and DATETIME until we get a dedicated number entry keypad.
Merge commit '13a6c8c1f8691b753cd1a6b7a77d99af4f7d78ac'
* commit '13a6c8c1f8691b753cd1a6b7a77d99af4f7d78ac':
Add a new preference item to show/hide the settings key.
Bug: 2996887
Override the methods in InputMethodService that hide the candidates view, since
it was just an optimization to show more lines of text when editing, which
conflicts with the re-correct feature.
Change-Id: Ibfed5ccd9efa048d0b69297a5cf8a638a0d00c72
The newly added SharedPreferencesCompat adapter class does apply() when available (Gingerbread+), else do commit().
This change incorporates I4eca20fb and I39f6aa04.
bug: 2983837
Change-Id: Iec4e8b69840ad71dbbd6098eeba349934d8248ff
On a device that has distinct multi-touch panel, pressing '123?' key
will change keyboard layout to symbol mode. While pressing '123?'
key, you can press other symbol key to input. Then releasing '123?'
key will change keyboard layout back to alphabet mode.
Bug: 2973383
Change-Id: I3b069fb19141820def8060db4766a08c7c0a6ff0
Merge commit 'dacc927a57b0c7adfbdf244441b9b2495c959980'
* commit 'dacc927a57b0c7adfbdf244441b9b2495c959980':
Update strings for the settings access - based on the latest GB IME spec (ver 03).
Merge commit 'e5abf25d4b57ecdfc01ca3ddf94753d5bcb07fea'
* commit 'e5abf25d4b57ecdfc01ca3ddf94753d5bcb07fea':
Dismiss mini keyboard when finger is released outside mini keyboard
Merge commit 'd5bcbf8156fdba8199452b8f95ed1940b7e96d31'
* commit 'd5bcbf8156fdba8199452b8f95ed1940b7e96d31':
Support multi-touch only when device has distinct multi-touch panel
Merge commit '6654653562d0ec5d46a74f8c49eab2488e273cf2'
* commit '6654653562d0ec5d46a74f8c49eab2488e273cf2':
Change symbol on space bar when autocompletion is activated
Merge commit 'd0457eae17d10535023a02579d16ede7bfcc6bec'
* commit 'd0457eae17d10535023a02579d16ede7bfcc6bec':
Queuing PointerTracker to support n-key roll-over and shift modifier.
Merge commit 'c354167c84b06b572067efaddfbd3667ffdadb98'
* commit 'c354167c84b06b572067efaddfbd3667ffdadb98':
Correction improvements - use the new InputConnection APIs for underlining and