From 124f01999c7c8640786ceeee5967fc69fe0eed98 Mon Sep 17 00:00:00 2001 From: Mill Chen Date: Thu, 7 Jan 2021 00:14:50 +0800 Subject: [PATCH] Set a title for personal dictionary After the collapsing toolbar layout is applied to subsetting pages, the title of the personal dictionary page won't be shown. This CL is to set a title for the personal dictionary page. Bug: 176897229 Test: manual test and visual verified 1) Navigate to Settings -> System -> Languages & input -> Personal dictionary 2) Enable collapsing toolbar feature 3) Observe and check if the title is shown as normal Change-Id: I0b6488bc2c8040b275ba0d5348d09aa4bad905d1 --- .../settings/inputmethod/UserDictionarySettings.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/settings/inputmethod/UserDictionarySettings.java b/src/com/android/settings/inputmethod/UserDictionarySettings.java index 67420a2c5df..5e3e7495359 100644 --- a/src/com/android/settings/inputmethod/UserDictionarySettings.java +++ b/src/com/android/settings/inputmethod/UserDictionarySettings.java @@ -26,6 +26,7 @@ import android.database.Cursor; import android.os.Bundle; import android.provider.UserDictionary; import android.text.TextUtils; +import android.util.FeatureFlagUtils; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -44,6 +45,7 @@ import androidx.loader.app.LoaderManager; import androidx.loader.content.Loader; import com.android.settings.R; +import com.android.settings.core.FeatureFlags; import com.android.settings.core.SubSettingLauncher; import com.android.settings.overlay.FeatureFactory; import com.android.settingslib.core.instrumentation.Instrumentable; @@ -104,6 +106,10 @@ public class UserDictionarySettings extends ListFragment implements Instrumentab @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + // TODO(b/176883483): Remove the title after material component updated + if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) { + getActivity().setTitle(R.string.user_dict_settings_title); + } // Show the language as a subtitle of the action bar final ActionBar actionBar = getActivity().getActionBar(); if (actionBar != null) {