Merge branch 'connyduck-fix-collapsing-toolbar-bug'
This commit is contained in:
commit
f88b88c73a
1 changed files with 15 additions and 11 deletions
|
@ -20,6 +20,7 @@ import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -136,23 +137,17 @@ public class AccountActivity extends BaseActivity implements SFragment.OnUserRem
|
||||||
@AttrRes int attribute;
|
@AttrRes int attribute;
|
||||||
if (collapsingToolbar.getHeight() + verticalOffset
|
if (collapsingToolbar.getHeight() + verticalOffset
|
||||||
< 2 * ViewCompat.getMinimumHeight(collapsingToolbar)) {
|
< 2 * ViewCompat.getMinimumHeight(collapsingToolbar)) {
|
||||||
if (getSupportActionBar() != null && loadedAccount != null) {
|
|
||||||
getSupportActionBar().setTitle(loadedAccount.getDisplayName());
|
|
||||||
toolbar.setTitleTextColor(ThemeUtils.getColor(AccountActivity.this,
|
toolbar.setTitleTextColor(ThemeUtils.getColor(AccountActivity.this,
|
||||||
android.R.attr.textColorPrimary));
|
android.R.attr.textColorPrimary));
|
||||||
|
|
||||||
String subtitle = String.format(getString(R.string.status_username_format),
|
|
||||||
loadedAccount.username);
|
|
||||||
getSupportActionBar().setSubtitle(subtitle);
|
|
||||||
toolbar.setSubtitleTextColor(ThemeUtils.getColor(AccountActivity.this,
|
toolbar.setSubtitleTextColor(ThemeUtils.getColor(AccountActivity.this,
|
||||||
android.R.attr.textColorSecondary));
|
android.R.attr.textColorSecondary));
|
||||||
}
|
|
||||||
attribute = R.attr.account_toolbar_icon_tint_collapsed;
|
attribute = R.attr.account_toolbar_icon_tint_collapsed;
|
||||||
} else {
|
} else {
|
||||||
if (getSupportActionBar() != null) {
|
toolbar.setTitleTextColor(Color.TRANSPARENT);
|
||||||
getSupportActionBar().setTitle("");
|
toolbar.setSubtitleTextColor(Color.TRANSPARENT);
|
||||||
getSupportActionBar().setSubtitle("");
|
|
||||||
}
|
|
||||||
attribute = R.attr.account_toolbar_icon_tint_uncollapsed;
|
attribute = R.attr.account_toolbar_icon_tint_uncollapsed;
|
||||||
}
|
}
|
||||||
if (attribute != priorAttribute) {
|
if (attribute != priorAttribute) {
|
||||||
|
@ -245,6 +240,15 @@ public class AccountActivity extends BaseActivity implements SFragment.OnUserRem
|
||||||
|
|
||||||
displayName.setText(account.getDisplayName());
|
displayName.setText(account.getDisplayName());
|
||||||
|
|
||||||
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().setTitle(account.getDisplayName());
|
||||||
|
|
||||||
|
String subtitle = String.format(getString(R.string.status_username_format),
|
||||||
|
account.username);
|
||||||
|
getSupportActionBar().setSubtitle(subtitle);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
boolean useCustomTabs = PreferenceManager.getDefaultSharedPreferences(this)
|
boolean useCustomTabs = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
.getBoolean("customTabs", true);
|
.getBoolean("customTabs", true);
|
||||||
LinkHelper.setClickableText(note, account.note, null, useCustomTabs, new LinkListener() {
|
LinkHelper.setClickableText(note, account.note, null, useCustomTabs, new LinkListener() {
|
||||||
|
|
Loading…
Reference in a new issue