[IL15] Some small refactoring
Bug: 8636060 Change-Id: I4bfdf1628c9b55a79bd2d88ee30bf10b08a49232
This commit is contained in:
parent
48ba1f25ff
commit
5c9e677c2a
5 changed files with 6 additions and 7 deletions
|
@ -1299,8 +1299,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mUserDictionary.addWordToUserDictionary(wordToEdit);
|
mUserDictionary.addWordToUserDictionary(wordToEdit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO[IL]: Rework the route through which this is called.
|
public void displaySettingsDialog() {
|
||||||
public void onSettingsKeyPressed() {
|
|
||||||
if (isShowingOptionDialog()) return;
|
if (isShowingOptionDialog()) return;
|
||||||
showSubtypeSelectorAndSettings();
|
showSubtypeSelectorAndSettings();
|
||||||
}
|
}
|
||||||
|
@ -2375,7 +2374,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
final CharSequence[] items = new CharSequence[] {
|
final CharSequence[] items = new CharSequence[] {
|
||||||
// TODO: Should use new string "Select active input modes".
|
// TODO: Should use new string "Select active input modes".
|
||||||
getString(R.string.language_selection_title),
|
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() {
|
final DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -999,7 +999,7 @@ public final class InputLogic {
|
||||||
* Handle a press on the settings key.
|
* Handle a press on the settings key.
|
||||||
*/
|
*/
|
||||||
private void onSettingsKeyPressed() {
|
private void onSettingsKeyPressed() {
|
||||||
mLatinIME.onSettingsKeyPressed();
|
mLatinIME.displaySettingsDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -98,7 +98,7 @@ public final class SettingsFragment extends InputMethodSettingsFragment
|
||||||
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
||||||
if (preferenceScreen != null) {
|
if (preferenceScreen != null) {
|
||||||
preferenceScreen.setTitle(
|
preferenceScreen.setTitle(
|
||||||
ApplicationUtils.getAcitivityTitleResId(getActivity(), SettingsActivity.class));
|
ApplicationUtils.getActivityTitleResId(getActivity(), SettingsActivity.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
final Resources res = getResources();
|
final Resources res = getResources();
|
||||||
|
|
|
@ -39,7 +39,7 @@ public final class SpellCheckerSettingsFragment extends PreferenceFragment {
|
||||||
addPreferencesFromResource(R.xml.spell_checker_settings);
|
addPreferencesFromResource(R.xml.spell_checker_settings);
|
||||||
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
||||||
if (preferenceScreen != null) {
|
if (preferenceScreen != null) {
|
||||||
preferenceScreen.setTitle(ApplicationUtils.getAcitivityTitleResId(
|
preferenceScreen.setTitle(ApplicationUtils.getActivityTitleResId(
|
||||||
getActivity(), SpellCheckerSettingsActivity.class));
|
getActivity(), SpellCheckerSettingsActivity.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public final class ApplicationUtils {
|
||||||
// This utility class is not publicly instantiable.
|
// 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 Class<? extends Activity> cls) {
|
||||||
final ComponentName cn = new ComponentName(context, cls);
|
final ComponentName cn = new ComponentName(context, cls);
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue