[Settings] Should create header again when adding it to the listview
Bug: 291545021 Test: manual Flag: EXEMPT bugfix Change-Id: I9d76814d98b67b1eb0078765a2b5bd6949cff446
This commit is contained in:
@@ -33,6 +33,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.internal.app.LocaleHelper;
|
||||
@@ -62,6 +63,7 @@ public class AppLocaleDetails extends SettingsPreferenceFragment {
|
||||
private LayoutPreference mPrefOfDescription;
|
||||
private Preference mPrefOfDisclaimer;
|
||||
private ApplicationInfo mApplicationInfo;
|
||||
@Nullable private String mParentLocale;
|
||||
|
||||
/**
|
||||
* Create a instance of AppLocaleDetails.
|
||||
@@ -111,6 +113,12 @@ public class AppLocaleDetails extends SettingsPreferenceFragment {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
refreshUi();
|
||||
final Activity activity = getActivity();
|
||||
if (mParentLocale != null) {
|
||||
activity.setTitle(mParentLocale);
|
||||
} else {
|
||||
activity.setTitle(R.string.app_locale_picker_title);
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshUi() {
|
||||
@@ -215,4 +223,8 @@ public class AppLocaleDetails extends SettingsPreferenceFragment {
|
||||
return LocaleHelper.getDisplayName(appLocale.stripExtensions(), appLocale, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void setParentLocale(@Nullable String localeName) {
|
||||
mParentLocale = localeName;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user