Skip to content
Snippets Groups Projects
Unverified Commit 557b88b2 authored by Mohamed's avatar Mohamed Committed by GitHub
Browse files

Hide uploading progress (#2416)


Co-authored-by: default avatarRalf Gehrer <ralfgehrer@users.noreply.github.com>
Co-authored-by: default avatarharambasicluka <64483219+harambasicluka@users.noreply.github.com>
parent 71f68119
Branches master
No related tags found
No related merge requests found
package de.rki.coronawarnapp.ui.submission.symptoms.calendar
import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
import androidx.lifecycle.asLiveData
import androidx.navigation.NavDirections
import dagger.assisted.Assisted
......@@ -29,8 +31,17 @@ class SubmissionSymptomCalendarViewModel @AssistedInject constructor(
val routeToScreen = SingleLiveEvent<NavDirections>()
val showCancelDialog = SingleLiveEvent<Unit>()
val showUploadDialog = autoSubmission.isSubmissionRunning
.asLiveData(context = dispatcherProvider.Default)
private val mediatorShowUploadDialog = MediatorLiveData<Boolean>()
init {
mediatorShowUploadDialog.addSource(
autoSubmission.isSubmissionRunning.asLiveData(context = dispatcherProvider.Default)
) { show ->
mediatorShowUploadDialog.postValue(show)
}
}
val showUploadDialog: LiveData<Boolean> = mediatorShowUploadDialog
fun onLastSevenDaysStart() {
updateSymptomStart(Symptoms.StartOf.LastSevenDays)
......@@ -88,6 +99,8 @@ class SubmissionSymptomCalendarViewModel @AssistedInject constructor(
} catch (e: Exception) {
Timber.tag(TAG).e(e, "performSubmission() failed.")
} finally {
Timber.i("Hide uploading progress and navigate to HomeFragment")
mediatorShowUploadDialog.postValue(false)
routeToScreen.postValue(
SubmissionSymptomCalendarFragmentDirections.actionSubmissionSymptomCalendarFragmentToMainFragment()
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment