Load account type icons in a background thread before scrolling down
This reduces the jank when scrolling down in top-level Settings if you happen to have several account types like Google, Twitter, Facebook, etc. In the process of doing this, discovered that headers get built even when they're not showing (SubSettings). Skip setting up the headers, which can be expensive when there are several accounts. Bug: 11006601 Change-Id: I8b4eafdcc2fc2beecac01317c3c8f07a82febcc0
This commit is contained in:
@@ -516,8 +516,10 @@ public class Settings extends PreferenceActivity
|
||||
*/
|
||||
@Override
|
||||
public void onBuildHeaders(List<Header> headers) {
|
||||
loadHeadersFromResource(R.xml.settings_headers, headers);
|
||||
updateHeaderList(headers);
|
||||
if (!onIsHidingHeaders()) {
|
||||
loadHeadersFromResource(R.xml.settings_headers, headers);
|
||||
updateHeaderList(headers);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateHeaderList(List<Header> target) {
|
||||
@@ -655,6 +657,7 @@ public class Settings extends PreferenceActivity
|
||||
}
|
||||
}
|
||||
accountHeaders.add(accHeader);
|
||||
mAuthenticatorHelper.preloadDrawableForType(this, accountType);
|
||||
}
|
||||
|
||||
// Sort by label
|
||||
|
Reference in New Issue
Block a user