Misc fixes for account/users fragments

- Hide add user button when it's not functional
- Display "No accounts added" under accounts setting when there is no account.

Change-Id: Iefede9939d206eb3064fa22bdcfbcb1e826f29ab
Fixes: 72643060
Test: robotest
Test: 72713118
This commit is contained in:
Fan Zhang
2018-01-30 17:04:46 -08:00
parent 07c2cdee1f
commit dc2a3528d5
4 changed files with 55 additions and 12 deletions

View File

@@ -91,17 +91,20 @@ public class AccountDashboardFragment extends DashboardFragment {
final BidiFormatter bidiFormatter = BidiFormatter.getInstance();
CharSequence summary = null;
if (types == null || types.length == 0) {
summary = mContext.getString(R.string.account_dashboard_default_summary);
} else {
// Show up to 3 account types
final int size = Math.min(3, types.length);
// Show up to 3 account types
final int size = Math.min(3, types.length);
for (int i = 0; i < size; i++) {
final CharSequence label = authHelper.getLabelForType(mContext, types[i]);
if (summary == null) {
summary = bidiFormatter.unicodeWrap(label);
} else {
summary = mContext.getString(R.string.join_many_items_middle, summary,
bidiFormatter.unicodeWrap(label));
for (int i = 0; i < size; i++) {
final CharSequence label = authHelper.getLabelForType(mContext, types[i]);
if (summary == null) {
summary = bidiFormatter.unicodeWrap(label);
} else {
summary = mContext.getString(R.string.join_many_items_middle, summary,
bidiFormatter.unicodeWrap(label));
}
}
}
mSummaryLoader.setSummary(this, summary);