Put identities inside category on legacy devices
A PreferenceCategory in settings_headers_legacy.xml was not being rendered, so it is added manually instead.
This commit is contained in:
@@ -183,17 +183,18 @@ public class SettingsActivity extends PreferenceActivity {
|
|||||||
private void buildLegacyHeaders() {
|
private void buildLegacyHeaders() {
|
||||||
// Always add general preferences as first header
|
// Always add general preferences as first header
|
||||||
addPreferencesFromResource(R.xml.settings_headers_legacy);
|
addPreferencesFromResource(R.xml.settings_headers_legacy);
|
||||||
PreferenceScreen ps = getPreferenceScreen();
|
PreferenceCategory ic = new PreferenceCategory(this);
|
||||||
|
ic.setTitle(R.string.pref_title_identities);
|
||||||
|
|
||||||
// Then add zero or more identity headers as necessary
|
// Then add zero or more identity headers as necessary
|
||||||
if (mLegacyIdentityListHeaders != null) {
|
if (mLegacyIdentityListHeaders != null) {
|
||||||
final int headerCount = mLegacyIdentityListHeaders.length;
|
getPreferenceScreen().addPreference(ic);
|
||||||
for (Preference header : mLegacyIdentityListHeaders) {
|
for (Preference header : mLegacyIdentityListHeaders) {
|
||||||
if (header != null) {
|
if (header != null) {
|
||||||
String key = header.getIntent().getExtras().getString(
|
String key = header.getIntent().getExtras().getString(
|
||||||
ViewIdentityFragment.ADDRESS);
|
ViewIdentityFragment.ADDRESS);
|
||||||
if (!key.equals(mDeletingIdentityKey)) {
|
if (!key.equals(mDeletingIdentityKey)) {
|
||||||
ps.addPreference(header);
|
ic.addPreference(header);
|
||||||
if (key.equals(mRequestedIdentityKey)) {
|
if (key.equals(mRequestedIdentityKey)) {
|
||||||
mRequestedIdentityKey = null;
|
mRequestedIdentityKey = null;
|
||||||
}
|
}
|
||||||
@@ -217,7 +218,6 @@ public class SettingsActivity extends PreferenceActivity {
|
|||||||
|
|
||||||
// Then add zero or more identity headers as necessary
|
// Then add zero or more identity headers as necessary
|
||||||
if (mIdentityListHeaders != null) {
|
if (mIdentityListHeaders != null) {
|
||||||
final int headerCount = mIdentityListHeaders.length;
|
|
||||||
for (Header header : mIdentityListHeaders) {
|
for (Header header : mIdentityListHeaders) {
|
||||||
if (header != null && header.id != HEADER_ID_UNDEFINED) {
|
if (header != null && header.id != HEADER_ID_UNDEFINED) {
|
||||||
String key = header.extras.getString(
|
String key = header.extras.getString(
|
||||||
|
|||||||
Reference in New Issue
Block a user