From 010474f42b9b60af32f3f7ca0d34d34642f10f60 Mon Sep 17 00:00:00 2001 From: satok Date: Thu, 21 Jul 2011 15:34:18 +0900 Subject: Allow applications to set the title of the subtype enabler Bug: 5058105 Change-Id: Ie2a476dfcfc9e4849c098d6126e0b2dd98db03df --- .../android/inputmethodcommon/InputMethodSettingsImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'java/com/android') diff --git a/java/com/android/inputmethodcommon/InputMethodSettingsImpl.java b/java/com/android/inputmethodcommon/InputMethodSettingsImpl.java index bdd21cf..5e7decc 100644 --- a/java/com/android/inputmethodcommon/InputMethodSettingsImpl.java +++ b/java/com/android/inputmethodcommon/InputMethodSettingsImpl.java @@ -61,9 +61,13 @@ import java.util.List; .setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { + final CharSequence title = getSubtypeEnablerTitle(context); final Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS); intent.putExtra(Settings.EXTRA_INPUT_METHOD_ID, imi.getId()); + if (!TextUtils.isEmpty(title)) { + intent.putExtra(Intent.EXTRA_TITLE, title); + } intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_CLEAR_TOP); @@ -164,6 +168,14 @@ import java.util.List; updateSubtypeEnabler(); } + private CharSequence getSubtypeEnablerTitle(Context context) { + if (mSubtypeEnablerTitleRes != 0) { + return context.getString(mSubtypeEnablerTitleRes); + } else { + return mSubtypeEnablerTitle; + } + } + private void updateSubtypeEnabler() { if (mSubtypeEnablerPreference != null) { if (mSubtypeEnablerTitleRes != 0) { -- cgit v1.2.3