Commit Graph

1276 Commits (a690f3bc40268ccee20c44c7e359890b34eb2a8a)

Author SHA1 Message Date
Jean Chalard fb72890ac6 Readability improvement
Change-Id: I2f350145f333ba1fa4eb20027b0f41107c2df02c
2013-06-26 16:03:40 +09:00
Jean Chalard 7fcf304c97 Fixing follow-up to I548d899b
I548d899b introduced a new method to fix a sync miss between
the cursor position and the cached cursor position, but did not
take into account that it should also update the cached text
before and after the cursor in this case and that there was
already a method for doing this.

Change-Id: I31bd741893207c822827304e77791b1159774e1a
2013-06-26 15:28:42 +09:00
Ken Wakasa 9419e02fd9 Make UserLogRingCharBuffer an external class
Change-Id: I9d506995337d64ec11c72939a8d739423ee46efa
2013-06-25 18:38:13 +09:00
Jean Chalard 10585620bd Merge "Fix a bug in the cached cursor pos, and simplify selection handling" 2013-06-25 05:00:11 +00:00
Jean Chalard cdf774122d Merge "Fix a small bug" 2013-06-24 10:00:05 +00:00
Ken Wakasa bfaf349c35 Load the native lib eagerly
in the hope of avoiding UnsatisfiedLinkError. This is definitely not a
confident fix as we still don't know the root cause of the issue.

bug: 9325110
Change-Id: I1abf8031b98509f63fce6a2d069d497895ea712c
2013-06-24 18:12:04 +09:00
Ken Wakasa bc1813186d Merge "Move util classes to the latin/utils directory" 2013-06-24 08:49:06 +00:00
Jean Chalard ca52e1ca5a Fix a small bug
SpannableStrings are not the only type of Spanned, they are
only the mutable kind. SpannedString is the immutable one.
Spanned is the correct class to use there.

Bug: 8839763
Bug: 8862327
Change-Id: Ic5e6199a51f22368914f2748ac2d0d1ca6a33f78
2013-06-24 17:39:17 +09:00
Ken Wakasa e28eba5074 Move util classes to the latin/utils directory
Change-Id: I1c5b27c8edf231680edb8d96f63b9d04cfc6a6fa
2013-06-24 17:04:40 +09:00
Jean Chalard e8c4b99e56 Refactor text range to be able to get spans larger than the word
This changes how the Range class stores its data, but not its
functionality. It also improves encapsulation a bit.

Bug: 8839763
Bug: 8862327
Change-Id: I5bd583b3fc96a99b93a2632882d8fd587c03ab76
2013-06-24 12:31:14 +09:00
Jean Chalard 673c727b7a Defer disk-intensive tasks until after the keyboard is shown
Bug: 8689779
Change-Id: Ia78d3540f44ec0028c3246a8e0163e9ecf061ecf
2013-06-21 19:41:45 +09:00
Jean Chalard e5dee0af4a Fix a bug in the cached cursor pos, and simplify selection handling
The documentation for setComposingRegion states explicitly
that it does not move the cursor. This is just a bug.
This does not have any ill effects right now, but it will have
in later changes if not fixed.

As for the selection handling, the specific test that this code
removes used to serve a purpose, but it does not any more because
the code using the value has been much sanitized. Now the variable
can just take the obvious value, and become so self-explanatory
that the comments are unnecessary.

Change-Id: I548d899b38776bd3ab5f5361aab0d89d98f12e73
2013-06-21 18:15:07 +09:00
Kurt Partridge fc98325c61 Log score, kind, and sourceDict for manual suggestion and gesture
b/9422713

Change-Id: I4880fad6a5b10d09ca11b63311f14862bee724e5
2013-06-13 11:03:49 -07:00
Jean Chalard 27d9c6f795 Merge "Cache subtype lists reasonably." 2013-06-13 01:49:41 +00:00
Jean Chalard ff6445ed0e Cache subtype lists reasonably.
This will spare a lot of IPC for Latin IME at the cost of very little
retained memory.
This improves the loading by potentially a lot - between 15 and 30%
when the layout is cached (which should now be the case almost every
time), and half that if it's not. More importantly, it makes the
load time less sensitive to high device load, which is one of the
sore points.

Bug: 8689779
Change-Id: I2e07736f1a92c38eed0e203bc690761a181da8b9
2013-06-12 18:04:52 +09:00
Kurt Partridge efd26bb319 Allow downloadable dictionaries in development builds
Bug: 9305379

Change-Id: Iab32753070a056d3861a45aa898911b7ab67dfb6
2013-06-05 22:14:54 -07:00
Tadashi G. Takaoka 0bfc2bc419 Merge "Add CODE_CAPSLOCK for long press shift key" 2013-06-05 02:19:02 +00:00
Tadashi G. Takaoka 9552badf3c Add CODE_CAPSLOCK for long press shift key
This change utilizes the no panel auto more key feature to implement
long press shift key for shift lock.

Change-Id: I3995d25dc35aea3c67b5aa29299815462eff9cad
2013-06-04 18:20:06 +09:00
Tadashi G. Takaoka 9ff7354d78 Clear previous suggestions when gesture typing starts
Bug: 8651076
Change-Id: Ic65ed3e3696409edea4e35080c11e4d1869a5a7e
2013-06-03 17:59:26 +09:00
Kurt Partridge 743302888b Merge "Uncommit separator LogUnits" 2013-06-03 03:01:23 +00:00
Kurt Partridge 3d20946272 Merge "Uncommit LogUnits when reverting textInput" 2013-06-03 02:58:20 +00:00
Kurt Partridge bdff287a0d Uncommit separator LogUnits
Now that separators have their own LogUnits, they must be uncommitted
from the LogBuffer when backspacing over them.

Bug: 9088919

Change-Id: Ib36cc94939b93abe18850a06bced17caf8aaa5b9
2013-06-02 19:15:57 -07:00
Kurt Partridge 720840851d Uncommit LogUnits when reverting textInput
Bug: 9088919

Change-Id: I17187aa0afc1c3e9d32269c65f66cfb3a08663cb
2013-06-01 23:42:35 -07:00
Kurt Partridge 4165ef031f Remove uncommit on reverting batch input
Currently when the user reverts a batch input, a LogUnit is uncommitted
from the LogBuffer.  It should not be, because the LogUnit containing the
batch input is never committed in the first place (it is only committed
to the LogBuffer when a key is pressed or a new batch input is entered).

Bug: 9088919

Change-Id: I323af453ce082437a663ccae977b21b775a964bc
2013-06-01 11:15:47 -07:00
Jean Chalard 68d9cb62e2 Tell the text view we reset state on finish input
This should be done in onFinishInput rather than onFinishInputView
but for an unknown reason onFinishInput never comes.

Bug: 9113167
Change-Id: Iafb40846a3ed8fad78bfc160d17cd431f81fe891
2013-05-29 18:44:40 +09:00
Satoshi Kataoka 3d97b95b90 Implement KIND_OOV_CORRECTION
Bug: 9127749
Change-Id: I96db15a3138e6b522c4c6ad16cc7faad577d3772
2013-05-27 18:53:43 -07:00
Tadashi G. Takaoka 618407ab7e Use localized toLowerString in AutoCorrection.isValidWord
Bug: 9112465
Change-Id: I63eb4115f393444560e80220d4c90f0f7101b934
2013-05-24 11:47:36 -07:00
Tadashi G. Takaoka 6f9105383a Remove unnecessary methods of KeyboardSwitcher
Change-Id: Idd3647bb1a1d40df8bb89eda715d45427a58d0cd
2013-05-22 10:49:53 -07:00
Jean Chalard 05ea7c5d02 am 167ba345: am 89fe1f50: Add a method to work around apps broken by recorrection
* commit '167ba3459b0ce02b9add12ade9388bd2b1e6eb62':
  Add a method to work around apps broken by recorrection
2013-05-20 21:10:07 -07:00
Jean Chalard 0013f97ddd am 5906b05b: am 7058b02a: Extract a new class for app-specific workarounds.
* commit '5906b05bb50c0a67bd4f03fcfae41db3daefe0bc':
  Extract a new class for app-specific workarounds.
2013-05-20 19:50:46 -07:00
Jean Chalard 89fe1f5088 Add a method to work around apps broken by recorrection
Bug: 8944307
Change-Id: I8986622554f30aaf4f595099c4ab5652b75c972c
2013-05-21 07:53:31 +09:00
Jean Chalard 7058b02a9c Extract a new class for app-specific workarounds.
Bug: 8944307
Change-Id: Iaff9dd03d3d856a6bdaa2b16c4e71e95cd2b6349
2013-05-21 07:53:28 +09:00
Kurt Partridge 500dea6ad4 Fix punctuation logging
Punctuation is currently put into the same LogUnit as the
following word.  This is counter-intuitive and makes
post-processing more complicated.

This change causes punctuation to be put into its own
LogUnit.

A tricky case is the phantom space.  A phantom space is
inserted right before other text, whose MotionEvents have
already been collected and inserted into mCurrentLogBuffer.
Phantom spaces are handled by creating their own LogUnit and
inserting it into the LogBuffer right before
mCurrentLogBuffer is shifted in.

Change-Id: I102d7cd93982ad37ba0abb6c1ac0f66b85b5f95d
2013-05-17 09:47:40 -07:00
Kurt Partridge 17b63ba588 Merge "Remove unnecessary commit/uncommit" 2013-05-15 23:52:43 +00:00
Jean Chalard b1e37e4a47 am f1dcf725: Merge "Don\'t process recorrection or resets when not shown"
* commit 'f1dcf725061b3e61e40540566a5385cf4934f424':
  Don't process recorrection or resets when not shown
2013-05-15 07:58:27 -07:00
Jean Chalard c9aaba1253 Don't process recorrection or resets when not shown
Bug: 8954116
Change-Id: Ica27dbfc570643bb81e6cdf34cc7c796ea080d71
2013-05-15 20:20:20 +09:00
Kurt Partridge 993acbaaa2 Remove unnecessary commit/uncommit
When the user reverts a commit, this causes the committed
word to be changed. The user usually then goes back to edit
that word.  Going back to edit causes an uncommit, so that
the editing actions are added onto the LogUnit containing
the operations used to construct the word.

But currently, reverting also involves its own
commit/uncommit pair, with the caller performing the
uncommit, and the commit happening inside the revert
command.  This may have been necessary in the past, when
revert was called in different situations, but is
unnecessary now.  Furthermore, the guarding conditions are
currently such that the uncommit doesn't always undo the
effects of the commit, corrupting the log output.

Change-Id: I74af41f4f1db2fcabfa496dcc4a2d7bd0af19b3a
2013-05-14 12:20:27 -07:00
Ken Wakasa d6d70e7325 Merge "Revert "Fix isSuggestionsStripVisible when keyboard hidden"" 2013-05-14 11:46:04 +00:00
Ken Wakasa 3efa36f6aa Revert "Fix isSuggestionsStripVisible when keyboard hidden"
This reverts commit cb0d1c4c58

Change-Id: Ie2c8e01c25bd051b6157e8f32ab84392a0c7252a
bug: 8954116
2013-05-14 11:44:22 +00:00
Tadashi G. Takaoka 41016acacf Back to previous keyboard layout by canceling sliding input
Bug: 8915171
Change-Id: Iabdeb7920f67f89246087c3ee06240406ecfbc3d
2013-05-14 20:28:03 +09:00
Jean Chalard cb0d1c4c58 Fix isSuggestionsStripVisible when keyboard hidden
When the keyboard is hidden, the suggestion strip is
never visible.

Bug: 8954116
Change-Id: I9f242d07b49ad60b625a22429bb013251e814905
2013-05-14 15:19:19 +09:00
Jean Chalard 9f9cc03277 Optimizations and safeguards.
- Don't call finishComposingText when useless.
- Add safeguards against calling setComposingRegion when the
  data returned by the editor is inconsistent.
- Cancel pending recorrection messages when new messages arrive.

Bug: 8842941
Bug: 8845001
Change-Id: I939701033cf5c2bbd85871ecf83e329021ddeb91
2013-05-08 18:47:10 +09:00
Jean Chalard e8b9b35471 Unify space-adding on gestures.
This is much simpler, and more correct.

Bug: 8808497
Change-Id: I7a56bf9d6d9fb481f898b7a9f5898a86c11b34c0
2013-05-07 20:38:09 +09:00
Jean Chalard 2dbb5957e3 Pass blockOffensiveWords as a parameter
Bug: 8773353
Change-Id: Ic1019742ce7ff6e4f7fff4d2729f8ab52d841488
2013-05-01 20:47:35 +09:00
Jean Chalard aa3a96f3a1 Don't do recorrection when suggestions are off.
Bug: 8767981
Change-Id: If5c775e488b91ae03ecce2673c99918ac8134928
2013-05-01 10:17:28 +09:00
Jean Chalard 758c74fe82 Merge "Fix an NPE in recorrection" into jb-mr2-dev 2013-04-19 07:03:19 +00:00
Jean Chalard 77226ed006 Merge "Fix an NPE in recapitalize" into jb-mr2-dev 2013-04-19 07:01:10 +00:00
Jean Chalard ae7d1530b4 Fix an NPE in recorrection
Also, theoretically, we don't want to retrieve older suggestions if
there are no results for a recorrection - that would look random.
This bug addresses this too.

Bug: 8657919
Change-Id: I44f36d34a708a968ab71fa0592da57f4c97d4b7f
2013-04-19 15:53:33 +09:00
Jean Chalard 3bdf341ea0 Fix an NPE in recapitalize
Bug: 8657736
Change-Id: I459d1c200826c1c394f8207475ecf60a4f356793
2013-04-19 15:44:20 +09:00
Jean Chalard d91268ad9f Initialize dictionaries at onStartInputView
Bug: 8344402
Change-Id: I41b8440f0d72a66fde3f6feb0db8239c9bb10ea3
2013-04-18 14:48:42 +09:00