1
0
mirror of https://github.com/etesync/android synced 2024-11-15 20:38:58 +00:00

Account Settings: add a flag to check if legacy (and use in account page).

This commit is contained in:
Tom Hacohen 2020-08-25 16:18:15 +03:00
parent 90cc39deeb
commit 09c932c02c
2 changed files with 8 additions and 2 deletions

View File

@ -77,6 +77,9 @@ constructor(internal val context: Context, internal val account: Account) {
get() = accountManager.getUserData(account, KEY_ETEBASE_SESSION)
set(value) = accountManager.setUserData(account, KEY_ETEBASE_SESSION, value)
val isLegacy: Boolean
get() = authToken != null
// CalDAV settings
var manageCalendarColors: Boolean

View File

@ -87,6 +87,7 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe
account = intent.getParcelableExtra(EXTRA_ACCOUNT)
title = account.name
val settings = AccountSettings(this, account)
setContentView(R.layout.activity_account)
@ -131,8 +132,10 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe
HintManager.setHintSeen(this, HINT_VIEW_COLLECTION, true)
}
if (!SetupUserInfoFragment.hasUserInfo(this, account)) {
SetupUserInfoFragment.newInstance(account).show(supportFragmentManager, null)
if (settings.isLegacy) {
if (!SetupUserInfoFragment.hasUserInfo(this, account)) {
SetupUserInfoFragment.newInstance(account).show(supportFragmentManager, null)
}
}
}