Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Mar 18, 2024
1 parent 7d7c176 commit 4435ec4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ class AchievementsFragment : Fragment(R.layout.fragment_achievements) {

observe(viewModel.isSynchronizingStatistics) { isSynchronizingStatistics ->
binding.emptyText.setText(
if (isSynchronizingStatistics)
if (isSynchronizingStatistics) {
R.string.stats_are_syncing
else
} else {
R.string.links_empty
}
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ import kotlinx.coroutines.flow.MutableStateFlow
class AchievementsViewModelImpl(
private val achievementsSource: AchievementsSource,
private val statisticsSource: StatisticsSource,
): AchievementsViewModel() {
) : AchievementsViewModel() {
override val isSynchronizingStatistics = MutableStateFlow(statisticsSource.isSynchronizing)
override val achievements = MutableStateFlow<List<Pair<Achievement, Int>>?>(null)


init {
launch(Dispatchers.IO) {
achievements.value = achievementsSource.getAchievements()
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import de.westnordost.streetcomplete.util.ktx.awaitLayout
import de.westnordost.streetcomplete.util.ktx.dpToPx
import de.westnordost.streetcomplete.util.ktx.observe
import de.westnordost.streetcomplete.util.ktx.openUri
import de.westnordost.streetcomplete.util.ktx.pxToDp
import de.westnordost.streetcomplete.util.viewBinding
import de.westnordost.streetcomplete.view.GridLayoutSpacingItemDecoration
import kotlinx.coroutines.launch
Expand All @@ -32,10 +31,11 @@ class LinksFragment : Fragment(R.layout.fragment_links) {

observe(viewModel.isSynchronizingStatistics) { isSynchronizingStatistics ->
binding.emptyText.setText(
if (isSynchronizingStatistics)
if (isSynchronizingStatistics) {
R.string.stats_are_syncing
else
} else {
R.string.links_empty
}
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
class LinksViewModelImpl(
private val achievementsSource: AchievementsSource,
private val statisticsSource: StatisticsSource,
): LinksViewModel() {
) : LinksViewModel() {
override val isSynchronizingStatistics = MutableStateFlow(statisticsSource.isSynchronizing)
override val links = MutableStateFlow<List<Link>?>(null)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ enum class LoginError : LoginState {
CommunicationError
}
data object LoggedIn : LoginState

0 comments on commit 4435ec4

Please sign in to comment.