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
3033cc51
Commit
3033cc51
authored
11 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Refactor logic to retrieve relevant suggestions a bit
Change-Id: Ic7d2cbb2c1b2deaa4e735484bdc7413c0b3b1939
parent
3f3b0af5
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/LatinIME.java
+16
-22
16 additions, 22 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+2
-1
2 additions, 1 deletion
.../com/android/inputmethod/latin/inputlogic/InputLogic.java
with
18 additions
and
23 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
+
16
−
22
View file @
3033cc51
...
@@ -1407,7 +1407,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -1407,7 +1407,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO[IL]: Move this to InputLogic
// TODO[IL]: Move this to InputLogic
public
SuggestedWords
maybeRetrieveOlderSuggestions
(
final
String
typedWord
,
public
SuggestedWords
maybeRetrieveOlderSuggestions
(
final
String
typedWord
,
final
SuggestedWords
suggestedWords
)
{
final
SuggestedWords
suggestedWords
,
final
SuggestedWords
previousSuggestedWords
)
{
// TODO: consolidate this into getSuggestedWords
// TODO: consolidate this into getSuggestedWords
// We update the suggestion strip only when we have some suggestions to show, i.e. when
// We update the suggestion strip only when we have some suggestions to show, i.e. when
// the suggestion count is > 1; else, we leave the old suggestions, with the typed word
// the suggestion count is > 1; else, we leave the old suggestions, with the typed word
...
@@ -1420,28 +1420,22 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -1420,28 +1420,22 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
||
mSuggestionStripView
.
isShowingAddToDictionaryHint
())
{
||
mSuggestionStripView
.
isShowingAddToDictionaryHint
())
{
return
suggestedWords
;
return
suggestedWords
;
}
else
{
}
else
{
return
getOlderSuggestions
(
typedWord
);
final
SuggestedWords
punctuationList
=
}
mSettings
.
getCurrent
().
mSpacingAndPunctuations
.
mSuggestPuncList
;
}
final
SuggestedWords
oldSuggestedWords
=
previousSuggestedWords
==
punctuationList
?
SuggestedWords
.
EMPTY
:
previousSuggestedWords
;
private
SuggestedWords
getOlderSuggestions
(
final
String
typedWord
)
{
if
(
TextUtils
.
isEmpty
(
typedWord
))
{
SuggestedWords
previousSuggestedWords
=
mInputLogic
.
mSuggestedWords
;
return
oldSuggestedWords
;
if
(
previousSuggestedWords
}
==
mSettings
.
getCurrent
().
mSpacingAndPunctuations
.
mSuggestPuncList
)
{
final
ArrayList
<
SuggestedWords
.
SuggestedWordInfo
>
typedWordAndPreviousSuggestions
=
previousSuggestedWords
=
SuggestedWords
.
EMPTY
;
SuggestedWords
.
getTypedWordAndPreviousSuggestions
(
typedWord
,
oldSuggestedWords
);
}
return
new
SuggestedWords
(
typedWordAndPreviousSuggestions
,
if
(
typedWord
==
null
)
{
false
/* typedWordValid */
,
return
previousSuggestedWords
;
false
/* hasAutoCorrectionCandidate */
,
false
/* isPunctuationSuggestions */
,
true
/* isObsoleteSuggestions */
,
false
/* isPrediction */
);
}
}
final
ArrayList
<
SuggestedWords
.
SuggestedWordInfo
>
typedWordAndPreviousSuggestions
=
SuggestedWords
.
getTypedWordAndPreviousSuggestions
(
typedWord
,
previousSuggestedWords
);
return
new
SuggestedWords
(
typedWordAndPreviousSuggestions
,
false
/* typedWordValid */
,
false
/* hasAutoCorrectionCandidate */
,
false
/* isPunctuationSuggestions */
,
true
/* isObsoleteSuggestions */
,
false
/* isPrediction */
);
}
}
private
void
showSuggestionStripWithTypedWord
(
final
SuggestedWords
suggestedWords
,
private
void
showSuggestionStripWithTypedWord
(
final
SuggestedWords
suggestedWords
,
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+
2
−
1
View file @
3033cc51
...
@@ -1031,7 +1031,8 @@ public final class InputLogic {
...
@@ -1031,7 +1031,8 @@ public final class InputLogic {
public
void
onGetSuggestedWords
(
final
SuggestedWords
suggestedWords
)
{
public
void
onGetSuggestedWords
(
final
SuggestedWords
suggestedWords
)
{
final
SuggestedWords
suggestedWordsWithMaybeOlderSuggestions
=
final
SuggestedWords
suggestedWordsWithMaybeOlderSuggestions
=
mLatinIME
.
maybeRetrieveOlderSuggestions
(
mLatinIME
.
maybeRetrieveOlderSuggestions
(
mWordComposer
.
getTypedWord
(),
suggestedWords
);
mWordComposer
.
getTypedWord
(),
suggestedWords
,
mSuggestedWords
);
holder
.
set
(
suggestedWordsWithMaybeOlderSuggestions
);
holder
.
set
(
suggestedWordsWithMaybeOlderSuggestions
);
}
}
}
}
...
...
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