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
b26af7ea
Commit
b26af7ea
authored
13 years ago
by
Jean Chalard
Committed by
Android (Google) Code Review
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Kill methods with side-effects"
This reverts commit
ca0e0486
parent
ca0e0486
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/SettingsValues.java
+7
-14
7 additions, 14 deletions
java/src/com/android/inputmethod/latin/SettingsValues.java
java/src/com/android/inputmethod/latin/SuggestedWords.java
+11
-0
11 additions, 0 deletions
java/src/com/android/inputmethod/latin/SuggestedWords.java
with
18 additions
and
14 deletions
java/src/com/android/inputmethod/latin/SettingsValues.java
+
7
−
14
View file @
b26af7ea
...
...
@@ -28,7 +28,6 @@ import com.android.inputmethod.compat.InputTypeCompatUtils;
import
com.android.inputmethod.compat.VibratorCompatWrapper
;
import
com.android.inputmethod.keyboard.internal.KeySpecParser
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -175,34 +174,28 @@ public class SettingsValues {
}
private
static
SuggestedWords
createSuggestPuncList
(
final
String
[]
puncs
)
{
final
ArrayList
<
CharSequence
>
puncList
=
new
ArrayList
<
CharSequence
>
();
final
SuggestedWords
.
Builder
builder
=
new
SuggestedWords
.
Builder
();
if
(
puncs
!=
null
)
{
for
(
final
String
puncSpec
:
puncs
)
{
puncList
.
ad
d
(
KeySpecParser
.
getLabel
(
puncSpec
));
builder
.
addWor
d
(
KeySpecParser
.
getLabel
(
puncSpec
));
}
}
final
SuggestedWords
.
Builder
builder
=
new
SuggestedWords
.
Builder
()
.
addWords
(
puncList
,
null
)
.
setIsPunctuationSuggestions
();
return
builder
.
build
();
return
builder
.
setIsPunctuationSuggestions
().
build
();
}
private
static
SuggestedWords
createSuggestPuncOutputTextList
(
final
String
[]
puncs
)
{
final
ArrayList
<
CharSequence
>
puncOutputTextList
=
new
ArrayList
<
CharSequence
>
();
final
SuggestedWords
.
Builder
builder
=
new
SuggestedWords
.
Builder
();
if
(
puncs
!=
null
)
{
for
(
final
String
puncSpec
:
puncs
)
{
final
String
outputText
=
KeySpecParser
.
getOutputText
(
puncSpec
);
if
(
outputText
!=
null
)
{
puncOutputTextList
.
ad
d
(
outputText
);
builder
.
addWor
d
(
outputText
);
}
else
{
puncOutputTextList
.
ad
d
(
KeySpecParser
.
getLabel
(
puncSpec
));
builder
.
addWor
d
(
KeySpecParser
.
getLabel
(
puncSpec
));
}
}
}
final
SuggestedWords
.
Builder
builder
=
new
SuggestedWords
.
Builder
()
.
addWords
(
puncOutputTextList
,
null
)
.
setIsPunctuationSuggestions
();
return
builder
.
build
();
return
builder
.
setIsPunctuationSuggestions
().
build
();
}
private
static
String
createWordSeparators
(
final
String
weakSpaceStrippers
,
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/SuggestedWords.java
+
11
−
0
View file @
b26af7ea
...
...
@@ -104,6 +104,17 @@ public class SuggestedWords {
return
this
;
}
public
Builder
addWord
(
CharSequence
word
)
{
return
addWord
(
word
,
null
,
false
);
}
public
Builder
addWord
(
CharSequence
word
,
CharSequence
debugString
,
boolean
isPreviousSuggestedWord
)
{
SuggestedWordInfo
info
=
new
SuggestedWordInfo
(
word
,
debugString
,
isPreviousSuggestedWord
);
return
addWord
(
word
,
info
);
}
/* package for tests */
Builder
addWord
(
CharSequence
word
,
SuggestedWordInfo
suggestedWordInfo
)
{
if
(!
TextUtils
.
isEmpty
(
suggestedWordInfo
.
mWord
))
{
...
...
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