Add display of handle when using multiple accounts (#2697)

- Shown on the main toolbar (subtitle)
- Shown just above the "replying to" message (even if not replying)
This commit is contained in:
Vivianne 2022-09-17 10:05:56 -07:00 committed by GitHub
commit c908ebb3f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 1 deletions

View file

@ -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

View file

@ -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()) {