Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gino-m committed Sep 8, 2023
1 parent e157b29 commit a70528e
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,16 @@ internal constructor(
onLargeAreaSelected()
return
}
sizeOnDisk.value = resources.getString(R.string.offline_area_size_loading_symbol)
visibleBottomTextViewId.value = R.id.size_on_disk_text_view
viewModelScope.launch(ioDispatcher) { updateDownloadSize(bounds) }

viewModelScope.launch(ioDispatcher) {
onStartEstimatingDownloadSize()
updateDownloadSize(bounds)
}
}

private fun onStartEstimatingDownloadSize() {
sizeOnDisk.postValue(resources.getString(R.string.offline_area_size_loading_symbol))
visibleBottomTextViewId.postValue(R.id.size_on_disk_text_view)
}

private suspend fun updateDownloadSize(bounds: Bounds) {
Expand Down

0 comments on commit a70528e

Please sign in to comment.