From 5c9e677c2abc6529c19fcc858ef987756d4341ef Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 19 Dec 2013 20:56:37 +0900 Subject: [PATCH] [IL15] Some small refactoring Bug: 8636060 Change-Id: I4bfdf1628c9b55a79bd2d88ee30bf10b08a49232 --- java/src/com/android/inputmethod/latin/LatinIME.java | 5 ++--- .../com/android/inputmethod/latin/inputlogic/InputLogic.java | 2 +- .../android/inputmethod/latin/settings/SettingsFragment.java | 2 +- .../latin/spellcheck/SpellCheckerSettingsFragment.java | 2 +- .../android/inputmethod/latin/utils/ApplicationUtils.java | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e03687668..e9988bf5b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1299,8 +1299,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mUserDictionary.addWordToUserDictionary(wordToEdit); } - // TODO[IL]: Rework the route through which this is called. - public void onSettingsKeyPressed() { + public void displaySettingsDialog() { if (isShowingOptionDialog()) return; showSubtypeSelectorAndSettings(); } @@ -2375,7 +2374,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final CharSequence[] items = new CharSequence[] { // TODO: Should use new string "Select active input modes". getString(R.string.language_selection_title), - getString(ApplicationUtils.getAcitivityTitleResId(this, SettingsActivity.class)), + getString(ApplicationUtils.getActivityTitleResId(this, SettingsActivity.class)), }; final DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { @Override diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 54d789859..5a70d6428 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -999,7 +999,7 @@ public final class InputLogic { * Handle a press on the settings key. */ private void onSettingsKeyPressed() { - mLatinIME.onSettingsKeyPressed(); + mLatinIME.displaySettingsDialog(); } /** diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java index d7a3e95b3..e1182e4ff 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java @@ -98,7 +98,7 @@ public final class SettingsFragment extends InputMethodSettingsFragment final PreferenceScreen preferenceScreen = getPreferenceScreen(); if (preferenceScreen != null) { preferenceScreen.setTitle( - ApplicationUtils.getAcitivityTitleResId(getActivity(), SettingsActivity.class)); + ApplicationUtils.getActivityTitleResId(getActivity(), SettingsActivity.class)); } final Resources res = getResources(); diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java index 999ca775b..186dafd29 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java @@ -39,7 +39,7 @@ public final class SpellCheckerSettingsFragment extends PreferenceFragment { addPreferencesFromResource(R.xml.spell_checker_settings); final PreferenceScreen preferenceScreen = getPreferenceScreen(); if (preferenceScreen != null) { - preferenceScreen.setTitle(ApplicationUtils.getAcitivityTitleResId( + preferenceScreen.setTitle(ApplicationUtils.getActivityTitleResId( getActivity(), SpellCheckerSettingsActivity.class)); } } diff --git a/java/src/com/android/inputmethod/latin/utils/ApplicationUtils.java b/java/src/com/android/inputmethod/latin/utils/ApplicationUtils.java index e521ec807..7a4150def 100644 --- a/java/src/com/android/inputmethod/latin/utils/ApplicationUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ApplicationUtils.java @@ -31,7 +31,7 @@ public final class ApplicationUtils { // This utility class is not publicly instantiable. } - public static int getAcitivityTitleResId(final Context context, + public static int getActivityTitleResId(final Context context, final Class cls) { final ComponentName cn = new ComponentName(context, cls); try {