Merge "[IL15] Some small refactoring"

This commit is contained in:
Jean Chalard 2013-12-20 02:42:09 +00:00 committed by Android (Google) Code Review
commit 30e3b66fa3
5 changed files with 6 additions and 7 deletions

View file

@ -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

View file

@ -999,7 +999,7 @@ public final class InputLogic {
* Handle a press on the settings key.
*/
private void onSettingsKeyPressed() {
mLatinIME.onSettingsKeyPressed();
mLatinIME.displaySettingsDialog();
}
/**

View file

@ -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();

View file

@ -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));
}
}

View file

@ -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<? extends Activity> cls) {
final ComponentName cn = new ComponentName(context, cls);
try {