Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
26baa759
Commit
26baa759
authored
11 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Revert "[CB16] Remove unused stuff"
This reverts commit
05c46f59
. Change-Id: Ica0feea10fff1b2a9ef42bc55cb7c1892b3a3f58
parent
05c46f59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/LastComposedWord.java
+16
-3
16 additions, 3 deletions
java/src/com/android/inputmethod/latin/LastComposedWord.java
java/src/com/android/inputmethod/latin/WordComposer.java
+21
-2
21 additions, 2 deletions
java/src/com/android/inputmethod/latin/WordComposer.java
with
37 additions
and
5 deletions
java/src/com/android/inputmethod/latin/LastComposedWord.java
+
16
−
3
View file @
26baa759
...
...
@@ -38,25 +38,38 @@ public final class LastComposedWord {
// or it may be exactly what the user typed if it's in the dictionary or the IME does not have
// enough confidence in any suggestion to auto-correct (auto-correct to typed word).
public
static
final
int
COMMIT_TYPE_DECIDED_WORD
=
2
;
// COMMIT_TYPE_CANCEL_AUTO_CORRECT is used upon committing back the old word upon cancelling
// an auto-correction.
public
static
final
int
COMMIT_TYPE_CANCEL_AUTO_CORRECT
=
3
;
public
static
final
String
NOT_A_SEPARATOR
=
""
;
public
final
ArrayList
<
Event
>
mEvents
;
public
final
String
mTypedWord
;
public
final
CharSequence
mCommittedWord
;
public
final
String
mSeparatorString
;
public
final
String
mPrevWord
;
public
final
int
mCapitalizedMode
;
public
final
InputPointers
mInputPointers
=
new
InputPointers
(
Constants
.
DICTIONARY_MAX_WORD_LENGTH
);
private
boolean
mActive
;
public
static
final
LastComposedWord
NOT_A_COMPOSED_WORD
=
new
LastComposedWord
(
""
,
""
,
NOT_A_SEPARATOR
,
null
,
WordComposer
.
CAPS_MODE_OFF
);
new
LastComposedWord
(
new
ArrayList
<
Event
>(),
null
,
""
,
""
,
NOT_A_SEPARATOR
,
null
,
WordComposer
.
CAPS_MODE_OFF
);
// Warning: this is using the passed objects as is and fully expects them to be
// immutable. Do not fiddle with their contents after you passed them to this constructor.
public
LastComposedWord
(
final
String
typedWord
,
final
CharSequence
committedWord
,
final
String
separatorString
,
final
String
prevWord
,
final
int
capitalizedMode
)
{
public
LastComposedWord
(
final
ArrayList
<
Event
>
events
,
final
InputPointers
inputPointers
,
final
String
typedWord
,
final
CharSequence
committedWord
,
final
String
separatorString
,
final
String
prevWord
,
final
int
capitalizedMode
)
{
if
(
inputPointers
!=
null
)
{
mInputPointers
.
copy
(
inputPointers
);
}
mTypedWord
=
typedWord
;
mEvents
=
new
ArrayList
<
Event
>(
events
);
mCommittedWord
=
committedWord
;
mSeparatorString
=
separatorString
;
mActive
=
true
;
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/WordComposer.java
+
21
−
2
View file @
26baa759
...
...
@@ -426,8 +426,9 @@ public final class WordComposer {
// Note: currently, we come here whenever we commit a word. If it's a MANUAL_PICK
// or a DECIDED_WORD we may cancel the commit later; otherwise, we should deactivate
// the last composed word to ensure this does not happen.
final
LastComposedWord
lastComposedWord
=
new
LastComposedWord
(
mTypedWord
.
toString
(),
committedWord
,
separatorString
,
prevWord
,
mCapitalizedMode
);
final
LastComposedWord
lastComposedWord
=
new
LastComposedWord
(
mEvents
,
mInputPointers
,
mTypedWord
.
toString
(),
committedWord
,
separatorString
,
prevWord
,
mCapitalizedMode
);
mInputPointers
.
reset
();
if
(
type
!=
LastComposedWord
.
COMMIT_TYPE_DECIDED_WORD
&&
type
!=
LastComposedWord
.
COMMIT_TYPE_MANUAL_PICK
)
{
...
...
@@ -458,6 +459,24 @@ public final class WordComposer {
public
void
discardPreviousWordForSuggestion
()
{
mPreviousWordForSuggestion
=
null
;
}
public
void
resumeSuggestionOnLastComposedWord
(
final
LastComposedWord
lastComposedWord
,
final
String
previousWord
)
{
mEvents
.
clear
();
Collections
.
copy
(
mEvents
,
lastComposedWord
.
mEvents
);
mInputPointers
.
set
(
lastComposedWord
.
mInputPointers
);
mTypedWord
.
setLength
(
0
);
mCombinerChain
.
reset
();
mTypedWord
.
append
(
lastComposedWord
.
mTypedWord
);
refreshSize
();
mCapitalizedMode
=
lastComposedWord
.
mCapitalizedMode
;
mAutoCorrection
=
null
;
// This will be filled by the next call to updateSuggestion.
mCursorPositionWithinWord
=
mCodePointSize
;
mRejectedBatchModeSuggestion
=
null
;
mIsResumed
=
true
;
mPreviousWordForSuggestion
=
previousWord
;
}
public
boolean
isBatchMode
()
{
return
mIsBatchMode
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment