Properly display registration status in top bar when it's refreshing
This commit is contained in:
parent
1f5e3ba646
commit
ee13e451d7
2 changed files with 4 additions and 4 deletions
|
@ -472,12 +472,12 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
|||
iconResource.value = when (account.state) {
|
||||
RegistrationState.Ok -> R.drawable.led_registered
|
||||
RegistrationState.Failed -> R.drawable.led_error
|
||||
RegistrationState.Progress -> R.drawable.led_registration_in_progress
|
||||
RegistrationState.Progress, RegistrationState.Refreshing -> R.drawable.led_registration_in_progress
|
||||
else -> R.drawable.led_not_registered
|
||||
}
|
||||
iconContentDescription.value = when (account.state) {
|
||||
RegistrationState.Ok -> R.string.status_connected
|
||||
RegistrationState.Progress -> R.string.status_in_progress
|
||||
RegistrationState.Progress, RegistrationState.Refreshing -> R.string.status_in_progress
|
||||
RegistrationState.Failed -> R.string.status_error
|
||||
else -> R.string.status_not_connected
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ open class StatusViewModel : ViewModel() {
|
|||
private fun getStatusIconText(state: RegistrationState): Int {
|
||||
return when (state) {
|
||||
RegistrationState.Ok -> R.string.status_connected
|
||||
RegistrationState.Progress -> R.string.status_in_progress
|
||||
RegistrationState.Progress, RegistrationState.Refreshing -> R.string.status_in_progress
|
||||
RegistrationState.Failed -> R.string.status_error
|
||||
else -> R.string.status_not_connected
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ open class StatusViewModel : ViewModel() {
|
|||
private fun getStatusIconResource(state: RegistrationState): Int {
|
||||
return when (state) {
|
||||
RegistrationState.Ok -> R.drawable.led_registered
|
||||
RegistrationState.Progress -> R.drawable.led_registration_in_progress
|
||||
RegistrationState.Progress, RegistrationState.Refreshing -> R.drawable.led_registration_in_progress
|
||||
RegistrationState.Failed -> R.drawable.led_error
|
||||
else -> R.drawable.led_not_registered
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue