From c7772d0f56e4cbe22b95f59f8abd258c2377546c Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 15 Apr 2017 20:49:31 +0200 Subject: [PATCH 1/2] Useful title for AccountActivity --- .../java/com/keylesspalace/tusky/AccountActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java index ebf1ebd9..9ca85300 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java @@ -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) { From 07f22b2560981fa681b7999c6888b83b7ed7a45a Mon Sep 17 00:00:00 2001 From: Vavassor Date: Mon, 1 May 2017 23:31:31 -0400 Subject: [PATCH 2/2] Fixes the text colour in the light theme for the collapsed toolbar in the account page. --- .../java/com/keylesspalace/tusky/AccountActivity.java | 11 ++++++++--- app/src/main/res/layout/activity_account.xml | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java index 9ca85300..6daeb26c 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java @@ -109,9 +109,14 @@ public class AccountActivity extends BaseActivity { < 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)); + toolbar.setTitleTextColor(ThemeUtils.getColor(toolbar.getContext(), + android.R.attr.textColorPrimary)); + + String subtitle = String.format(getString(R.string.status_username_format), + loadedAccount.username); + getSupportActionBar().setSubtitle(subtitle); + toolbar.setSubtitleTextColor(ThemeUtils.getColor(toolbar.getContext(), + android.R.attr.textColorSecondary)); } attribute = R.attr.account_toolbar_icon_tint_collapsed; } else { diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml index e3504dd6..aa2c996b 100644 --- a/app/src/main/res/layout/activity_account.xml +++ b/app/src/main/res/layout/activity_account.xml @@ -103,7 +103,7 @@ app:srcCompat="@drawable/reblog_disabled_light" android:tint="?android:textColorSecondary" android:layout_toRightOf="@id/account_username" - android:contentDescription="@string/description_account_locked"/> + android:contentDescription="@string/description_account_locked" /> @@ -115,7 +115,7 @@ android:id="@+id/account_note" android:textColor="?android:textColorTertiary" android:padding="16dp" - android:paddingTop="10dp"/> + android:paddingTop="10dp" />