From 1a3bb54bb495f88f0741af9e81c374305c2f1c28 Mon Sep 17 00:00:00 2001 From: satok Date: Sat, 9 Jul 2011 08:15:06 +0900 Subject: [PATCH] Use InputMethodSettingsFragment Bug: 4979539 Change-Id: I4f2010f785eb29ccd42b488c402ef9957633e0c2 --- java/Android.mk | 1 + java/res/values/strings.xml | 3 +++ java/src/com/android/inputmethod/latin/Settings.java | 5 ++++- .../android/inputmethod/latin/SettingsActivity.java | 12 +++++++++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/java/Android.mk b/java/Android.mk index 60c321ab2..43168e563 100644 --- a/java/Android.mk +++ b/java/Android.mk @@ -12,6 +12,7 @@ LOCAL_CERTIFICATE := shared LOCAL_JNI_SHARED_LIBRARIES := libjni_latinime LOCAL_STATIC_JAVA_LIBRARIES := android-common +LOCAL_STATIC_JAVA_LIBRARIES += inputmethod-common # Do not compress dictionary files to mmap dict data runtime LOCAL_AAPT_FLAGS := -0 .dict diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index f7d43f24a..739f72f36 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -304,6 +304,9 @@ Input languages + + Select input languages + \u2190 Touch again to save diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 185197328..9b8199723 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -21,6 +21,7 @@ import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; import com.android.inputmethod.compat.InputMethodServiceCompatWrapper; import com.android.inputmethod.deprecated.VoiceProxy; import com.android.inputmethod.compat.VibratorCompatWrapper; +import com.android.inputmethodcommon.InputMethodSettingsFragment; import android.app.Activity; import android.app.AlertDialog; @@ -49,7 +50,7 @@ import android.widget.TextView; import java.util.Arrays; import java.util.Locale; -public class Settings extends PreferenceActivity +public class Settings extends InputMethodSettingsFragment implements SharedPreferences.OnSharedPreferenceChangeListener, DialogInterface.OnDismissListener, OnPreferenceClickListener { private static final String TAG = "Settings"; @@ -331,6 +332,8 @@ public class Settings extends PreferenceActivity @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); + setInputMethodSettingsCategoryTitle(R.string.language_selection_title); + setSubtypeEnablerTitle(R.string.select_language); final Resources res = getResources(); final Context context = getActivityInternal(); diff --git a/java/src/com/android/inputmethod/latin/SettingsActivity.java b/java/src/com/android/inputmethod/latin/SettingsActivity.java index 2da171a63..7a6c2efd0 100644 --- a/java/src/com/android/inputmethod/latin/SettingsActivity.java +++ b/java/src/com/android/inputmethod/latin/SettingsActivity.java @@ -16,5 +16,15 @@ package com.android.inputmethod.latin; -public class SettingsActivity extends Settings { +import android.content.Intent; +import android.preference.PreferenceActivity; + +public class SettingsActivity extends PreferenceActivity { + @Override + public Intent getIntent() { + final Intent modIntent = new Intent(super.getIntent()); + modIntent.putExtra(EXTRA_SHOW_FRAGMENT, Settings.class.getName()); + modIntent.putExtra(EXTRA_NO_HEADERS, true); + return modIntent; + } }