Fix preferences ordering issue in AccountSyncSettings

In Pie, it's alphabetical ordering in Accounts > Account sync detail page.
But Q doesn't follow it, intend to keep the same behavior.

Fixes:124382857
Test: visual, robotests
Change-Id: I593a4cc919daa0018d3874d84978e876198aae23
This commit is contained in:
Yanting Yang
2019-02-20 20:26:51 +08:00
parent e67344a5c5
commit 11a157a8e7

View File

@@ -97,6 +97,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.account_sync_settings);
getPreferenceScreen().setOrderingAsAdded(false);
setAccessibilityTitle();
}
@@ -127,6 +128,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
.setLabel(mAccount.name)
.setSummary(getLabelForType(mAccount.type))
.done(activity, getPrefContext());
pref.setOrder(0);
getPreferenceScreen().addPreference(pref);
}