Update preference screen title.
- Add missing title to preference screen xml so that they will be used to set the activity title when the fragment is launched. - Also updated some incorrect preference screen titles. - Overrides getTitle() in preference fragments that do not use the preference screen xml. Bug: 64564191 Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
This commit is contained in:
@@ -17,9 +17,6 @@
|
||||
package com.android.settings.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
@@ -70,7 +67,12 @@ public abstract class RadioButtonPickerFragment extends InstrumentedPreferenceFr
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
super.onCreatePreferences(savedInstanceState, rootKey);
|
||||
addPreferencesFromResource(R.xml.placeholder_prefs);
|
||||
final int resId = getPreferenceScreenResId();
|
||||
if (usePreferenceScreenTitle() && resId > 0) {
|
||||
addPreferencesFromResource(resId);
|
||||
} else {
|
||||
addPreferencesFromResource(R.xml.placeholder_prefs);
|
||||
}
|
||||
updateCandidates();
|
||||
}
|
||||
|
||||
@@ -113,6 +115,13 @@ public abstract class RadioButtonPickerFragment extends InstrumentedPreferenceFr
|
||||
onSelectionPerformed(success);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the res id for static preference xml for this fragment.
|
||||
*/
|
||||
protected int getPreferenceScreenResId() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* A chance for subclasses to bind additional things to the preference.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user