Fix issue when preference screen title won't change depending on the device..

previously it defaults to just "Search your phone"
Now it correctly displays Phone/Tablet

Before: https://screenshot.googleplex.com/3PJrsP9mGvwMr98
After: https://screenshot.googleplex.com/B2nnUQHeHmEXXPd

Bug: 231611501
Change-Id: I49eab7e827ce4bb31a2722fbf21c244f98145907
This commit is contained in:
Brandon Dayauon
2022-05-09 14:37:31 -07:00
parent bd4d551a96
commit 303b4e8aae
2 changed files with 12 additions and 0 deletions

View File

@@ -213,6 +213,14 @@ public class SettingsActivity extends FragmentActivity
}
if (getActivity() != null && !TextUtils.isEmpty(getPreferenceScreen().getTitle())) {
if (getPreferenceScreen().getTitle().equals(
getResources().getString(R.string.search_pref_screen_title))){
DeviceProfile mDeviceProfile = InvariantDeviceProfile.INSTANCE.get(
getContext()).getDeviceProfile(getContext());
getPreferenceScreen().setTitle(mDeviceProfile.isTablet ?
R.string.search_pref_screen_title_tablet
: R.string.search_pref_screen_title);
}
getActivity().setTitle(getPreferenceScreen().getTitle());
}
}