mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Should speed up a little the first display when app starts
This commit is contained in:
parent
f9667ff2e4
commit
aa36235ab1
1 changed files with 19 additions and 14 deletions
|
|
@ -145,13 +145,12 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
|||
}
|
||||
|
||||
init {
|
||||
searchBarVisible.value = false
|
||||
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.addListener(coreListener)
|
||||
configure()
|
||||
}
|
||||
|
||||
update()
|
||||
searchBarVisible.value = false
|
||||
}
|
||||
|
||||
@UiThread
|
||||
|
|
@ -201,17 +200,6 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
|||
@UiThread
|
||||
fun update() {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
if (core.accountList.isNotEmpty()) {
|
||||
Log.i("$TAG Updating displayed default account")
|
||||
val defaultAccount = core.defaultAccount ?: core.accountList.first()
|
||||
|
||||
account.value?.destroy()
|
||||
account.postValue(AccountModel(defaultAccount))
|
||||
|
||||
updateUnreadMessagesCount()
|
||||
updateMissedCallsCount()
|
||||
updateAvailableMenus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -276,4 +264,21 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
|||
)
|
||||
hideMeetings.postValue(hideGroupCall)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun configure() {
|
||||
val core = coreContext.core
|
||||
val defaultAccount = core.defaultAccount
|
||||
if (defaultAccount != null || core.accountList.isNotEmpty()) {
|
||||
Log.i("$TAG Updating displayed default account")
|
||||
account.value?.destroy()
|
||||
account.postValue(AccountModel(defaultAccount ?: core.accountList.first()))
|
||||
|
||||
updateUnreadMessagesCount()
|
||||
updateMissedCallsCount()
|
||||
updateAvailableMenus()
|
||||
} else {
|
||||
Log.e("$TAG Accounts list no supposed to be empty!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue