From 8befd36c6528bc4264c8a1a322673c307cf40cd1 Mon Sep 17 00:00:00 2001 From: Satoshi Kataoka Date: Tue, 30 Jul 2013 15:39:41 +0900 Subject: [PATCH] Fix the title of the personal dictionary settings Bug: 8976598 Change-Id: I9e07ff9e06449e2093b9ba8d6f28a030c69756bc --- .../latin/userdictionary/UserDictionaryAddWordContents.java | 4 ++++ .../latin/userdictionary/UserDictionaryAddWordFragment.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java index ba5a68460..21426d1eb 100644 --- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java +++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java @@ -274,4 +274,8 @@ public class UserDictionaryAddWordContents { localesList.add(new LocaleRenderer(activity, null)); // meaning: select another locale return localesList; } + + public String getCurrentUserDictionaryLocale() { + return mLocale; + } } diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordFragment.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordFragment.java index 8b8bd5e03..30466bbe5 100644 --- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordFragment.java +++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordFragment.java @@ -60,6 +60,7 @@ public class UserDictionaryAddWordFragment extends Fragment public void onActivityCreated(final Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setHasOptionsMenu(true); + getActivity().getActionBar().setTitle(R.string.edit_personal_dictionary); // Keep the instance so that we remember mContents when configuration changes (eg rotation) setRetainInstance(true); } @@ -82,6 +83,8 @@ public class UserDictionaryAddWordFragment extends Fragment mContents = new UserDictionaryAddWordContents(mRootView, mContents /* oldInstanceToBeEdited */); } + getActivity().getActionBar().setSubtitle(UserDictionarySettingsUtils.getLocaleDisplayName( + getActivity(), mContents.getCurrentUserDictionaryLocale())); return mRootView; }