diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt index 8958feb0..f097f0e6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt @@ -834,6 +834,9 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje header.clear() header.profiles = profiles header.setActiveProfile(accountManager.activeAccount!!.id) + binding.mainToolbar.subtitle = if (accountManager.accounts.size > 1) { + accountManager.activeAccount!!.fullName + } else null } override fun getActionButton() = binding.composeButton diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt index c2e3eba3..6a194968 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt @@ -236,6 +236,17 @@ class ComposeActivity : val composeOptions: ComposeOptions? = intent.getParcelableExtra(COMPOSE_OPTIONS_EXTRA) viewModel.setup(composeOptions) + + if (accountManager.accounts.size > 1) { + binding.composeUsernameView.text = getString( + R.string.compose_active_account_description, + activeAccount.fullName + ) + binding.composeUsernameView.show() + } else { + binding.composeUsernameView.hide() + } + setupReplyViews(composeOptions?.replyingStatusAuthor, composeOptions?.replyingStatusContent) val statusContent = composeOptions?.content if (!statusContent.isNullOrEmpty()) { diff --git a/app/src/main/res/layout/activity_compose.xml b/app/src/main/res/layout/activity_compose.xml index b2d734ea..902bae40 100644 --- a/app/src/main/res/layout/activity_compose.xml +++ b/app/src/main/res/layout/activity_compose.xml @@ -71,6 +71,19 @@ android:layout_height="wrap_content" android:orientation="vertical"> + <TextView + android:id="@+id/composeUsernameView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="0dp" + android:textSize="?attr/status_text_small" + android:textStyle="bold" + android:visibility="gone" + tools:text="Posting as @username@domain" + tools:visibility="visible" /> + <TextView android:id="@+id/composeReplyView" android:layout_width="wrap_content" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7b8ada04..66f5a9b6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -401,7 +401,7 @@ <string name="action_add_to_list">Add account to the list</string> <string name="action_remove_from_list">Remove account from the list</string> - <string name="compose_active_account_description">Posting with account %1$s</string> + <string name="compose_active_account_description">Posting as %1$s</string> <string name="error_failed_set_caption">Failed to set caption</string> <plurals name="hint_describe_for_visually_impaired">