Useful title for AccountActivity

This commit is contained in:
Raphael Michel 2017-04-15 20:49:31 +02:00
parent 69c1b88ff4
commit c7772d0f56
1 changed files with 10 additions and 0 deletions

View File

@ -107,8 +107,18 @@ public class AccountActivity extends BaseActivity {
@AttrRes int attribute;
if (collapsingToolbar.getHeight() + verticalOffset
< 2 * ViewCompat.getMinimumHeight(collapsingToolbar)) {
if (getSupportActionBar() != null && loadedAccount != null) {
getSupportActionBar().setTitle(loadedAccount.getDisplayName());
getSupportActionBar().setSubtitle(
String.format(getString(R.string.status_username_format),
loadedAccount.username));
}
attribute = R.attr.account_toolbar_icon_tint_collapsed;
} else {
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle("");
getSupportActionBar().setSubtitle("");
}
attribute = R.attr.account_toolbar_icon_tint_uncollapsed;
}
if (attribute != priorAttribute) {