Preference to disable multiple-login usernames (#2718)
* Preference to disable multiple-login usernames (with problems) * Fix problem where 'show self username disambiguation' does not take effect immediately because MainActivity needed to be restarted * Make 'show username in toolbars' a 3-option selector, default when multiple accounts logged in * Move SHOW_SELF_USERNAME higher in preference fragment
This commit is contained in:
parent
05f9a17e7a
commit
85a6b2d96b
9 changed files with 48 additions and 3 deletions
|
|
@ -244,7 +244,7 @@ class ComposeActivity :
|
|||
|
||||
viewModel.setup(composeOptions)
|
||||
|
||||
if (accountManager.accounts.size > 1) {
|
||||
if (accountManager.shouldDisplaySelfUsername(this)) {
|
||||
binding.composeUsernameView.text = getString(
|
||||
R.string.compose_active_account_description,
|
||||
activeAccount.fullName
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class PreferencesActivity :
|
|||
this.restartCurrentActivity()
|
||||
}
|
||||
"statusTextSize", "absoluteTimeView", "showBotOverlay", "animateGifAvatars", "useBlurhash",
|
||||
"showCardsInTimelines", "confirmReblogs", "confirmFavourites",
|
||||
"showSelfUsername", "showCardsInTimelines", "confirmReblogs", "confirmFavourites",
|
||||
"enableSwipeForTabs", "mainNavPosition", PrefKeys.HIDE_TOP_TOOLBAR -> {
|
||||
restartActivitiesOnExit = true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,16 @@ class PreferencesFragment : PreferenceFragmentCompat(), Injectable {
|
|||
setTitle(R.string.pref_main_nav_position)
|
||||
}
|
||||
|
||||
listPreference {
|
||||
setDefaultValue("disambiguate")
|
||||
setEntries(R.array.pref_show_self_username_names)
|
||||
setEntryValues(R.array.pref_show_self_username_values)
|
||||
key = PrefKeys.SHOW_SELF_USERNAME
|
||||
setSummaryProvider { entry }
|
||||
setTitle(R.string.pref_title_show_self_username)
|
||||
isSingleLineTitle = false
|
||||
}
|
||||
|
||||
switchPreference {
|
||||
setDefaultValue(false)
|
||||
key = PrefKeys.HIDE_TOP_TOOLBAR
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue