aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2014-08-25 02:08:21 -0700
committerYohei Yukawa <yukawa@google.com>2014-08-25 02:28:01 -0700
commita61b7245b030395451b4c42ec218a946aa95e030 (patch)
tree4363357f57bd63e2936e15a3d21c45fd55ac6885 /java
parent8681287cd65f9d96187aab0703121881c8eba6c6 (diff)
downloadlatinime-a61b7245b030395451b4c42ec218a946aa95e030.tar.gz
latinime-a61b7245b030395451b4c42ec218a946aa95e030.tar.xz
latinime-a61b7245b030395451b4c42ec218a946aa95e030.zip
Use more descriptive names for some internal fields
This CL clarifies that delay parameters are specified with milliseconds. Change-Id: I401a60b8c09c2a04201af5b74babcdb091c07f4a
Diffstat (limited to 'java')
-rw-r--r--java/res/values/config-common.xml6
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java23
-rw-r--r--java/src/com/android/inputmethod/latin/settings/SettingsValues.java9
3 files changed, 20 insertions, 18 deletions
diff --git a/java/res/values/config-common.xml b/java/res/values/config-common.xml
index 063fbfb37..36fd30aef 100644
--- a/java/res/values/config-common.xml
+++ b/java/res/values/config-common.xml
@@ -24,7 +24,7 @@
at input history to suggest a hopefully helpful suggestions for the next word? -->
<bool name="config_default_next_word_prediction">true</bool>
- <integer name="config_delay_update_shift_state">100</integer>
+ <integer name="config_delay_in_milliseconds_to_update_shift_state">100</integer>
<integer name="config_double_space_period_timeout">1100</integer>
<integer name="config_key_repeat_start_timeout">400</integer>
@@ -107,8 +107,8 @@
<!-- Common suggestion strip configuration. -->
<integer name="config_suggestions_count_in_strip">3</integer>
<fraction name="config_center_suggestion_percentile">36%</fraction>
- <integer name="config_delay_update_suggestions">100</integer>
- <integer name="config_delay_update_old_suggestions">300</integer>
+ <integer name="config_delay_in_milliseconds_to_update_suggestions">100</integer>
+ <integer name="config_delay_in_milliseconds_to_update_old_suggestions">300</integer>
<!-- Common more suggestions configuraion. -->
<dimen name="config_more_suggestions_key_horizontal_padding">12dp</dimen>
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 466ac8c69..f9df57cf8 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -192,8 +192,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private static final int ARG1_FALSE = 0;
private static final int ARG1_TRUE = 1;
- private int mDelayUpdateSuggestions;
- private int mDelayUpdateShiftState;
+ private int mDelayInMillisecondsToUpdateSuggestions;
+ private int mDelayInMillisecondsToUpdateShiftState;
public UIHandler(final LatinIME ownerInstance) {
super(ownerInstance);
@@ -205,8 +205,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
final Resources res = latinIme.getResources();
- mDelayUpdateSuggestions = res.getInteger(R.integer.config_delay_update_suggestions);
- mDelayUpdateShiftState = res.getInteger(R.integer.config_delay_update_shift_state);
+ mDelayInMillisecondsToUpdateSuggestions =
+ res.getInteger(R.integer.config_delay_in_milliseconds_to_update_suggestions);
+ mDelayInMillisecondsToUpdateShiftState =
+ res.getInteger(R.integer.config_delay_in_milliseconds_to_update_shift_state);
}
@Override
@@ -272,7 +274,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void postUpdateSuggestionStrip(final int inputStyle) {
sendMessageDelayed(obtainMessage(MSG_UPDATE_SUGGESTION_STRIP, inputStyle,
- 0 /* ignored */), mDelayUpdateSuggestions);
+ 0 /* ignored */), mDelayInMillisecondsToUpdateSuggestions);
}
public void postReopenDictionaries() {
@@ -285,16 +287,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (latinIme == null) {
return;
}
- if (!latinIme.mSettings.getCurrent()
- .isSuggestionsEnabledPerUserSettings()) {
+ if (!latinIme.mSettings.getCurrent().isSuggestionsEnabledPerUserSettings()) {
return;
}
removeMessages(MSG_RESUME_SUGGESTIONS);
if (shouldDelay) {
sendMessageDelayed(obtainMessage(MSG_RESUME_SUGGESTIONS,
- shouldIncludeResumedWordInSuggestions ? ARG1_TRUE : ARG1_FALSE,
- 0 /* ignored */),
- mDelayUpdateSuggestions);
+ shouldIncludeResumedWordInSuggestions ? ARG1_TRUE : ARG1_FALSE,
+ 0 /* ignored */), mDelayInMillisecondsToUpdateSuggestions);
} else {
sendMessage(obtainMessage(MSG_RESUME_SUGGESTIONS,
shouldIncludeResumedWordInSuggestions ? ARG1_TRUE : ARG1_FALSE,
@@ -335,7 +335,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void postUpdateShiftState() {
removeMessages(MSG_UPDATE_SHIFT_STATE);
- sendMessageDelayed(obtainMessage(MSG_UPDATE_SHIFT_STATE), mDelayUpdateShiftState);
+ sendMessageDelayed(obtainMessage(MSG_UPDATE_SHIFT_STATE),
+ mDelayInMillisecondsToUpdateShiftState);
}
@UsedForTesting
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
index cc314ce8d..1cd7b391a 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
@@ -50,7 +50,7 @@ public final class SettingsValues {
// From resources:
public final SpacingAndPunctuations mSpacingAndPunctuations;
- public final int mDelayUpdateOldSuggestions;
+ public final int mDelayInMillisecondsToUpdateOldSuggestions;
public final long mDoubleSpacePeriodTimeout;
// From preferences, in the same order as xml/prefs.xml:
@@ -106,7 +106,8 @@ public final class SettingsValues {
final InputAttributes inputAttributes) {
mLocale = res.getConfiguration().locale;
// Get the resources
- mDelayUpdateOldSuggestions = res.getInteger(R.integer.config_delay_update_old_suggestions);
+ mDelayInMillisecondsToUpdateOldSuggestions =
+ res.getInteger(R.integer.config_delay_in_milliseconds_to_update_old_suggestions);
mSpacingAndPunctuations = new SpacingAndPunctuations(res);
// Store the input attributes
@@ -332,8 +333,8 @@ public final class SettingsValues {
final StringBuilder sb = new StringBuilder("Current settings :");
sb.append("\n mSpacingAndPunctuations = ");
sb.append("" + mSpacingAndPunctuations.dump());
- sb.append("\n mDelayUpdateOldSuggestions = ");
- sb.append("" + mDelayUpdateOldSuggestions);
+ sb.append("\n mDelayInMillisecondsToUpdateOldSuggestions = ");
+ sb.append("" + mDelayInMillisecondsToUpdateOldSuggestions);
sb.append("\n mAutoCap = ");
sb.append("" + mAutoCap);
sb.append("\n mVibrateOn = ");