Skip to content

Commit

Permalink
WTA #82: cleaned up some detekt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob3075 committed Dec 3, 2023
1 parent 3f8f6b6 commit 295ee19
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ data class DailyStats(
val mostUsedEditor: String,
val mostUsedOs: String,
val date: LocalDate,
) {
}
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("unused")

package com.jacob.wakatimeapp.core.ui.theme.assets

import androidx.annotation.RawRes
Expand Down Expand Up @@ -180,10 +182,10 @@ object Animations {
)

private val dataAnimations = listOf(
// cloudFileAccess,
// cloudReporting,
// dataCenter,
// networkFolder,
// cloudFileAccess,
// cloudReporting,
// dataCenter,
// networkFolder,
transferFiles,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.jacob.wakatimeapp.login.data.dtos


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -48,14 +47,12 @@ import timber.log.Timber
@Destination
fun ExtractUserDataPage(
navigator: ExtractUserDataNavigator,
snackbarHostState: SnackbarHostState,
modifier: Modifier = Modifier,
) = ExtractUserDataScreen(navigator, snackbarHostState, modifier, hiltViewModel())
) = ExtractUserDataScreen(navigator, modifier, hiltViewModel())

@Composable
private fun ExtractUserDataScreen(
navigator: ExtractUserDataNavigator,
snackbarHostState: SnackbarHostState,
modifier: Modifier = Modifier,
viewModel: ExtractUseDataViewModel = hiltViewModel(),
) {
Expand All @@ -82,22 +79,7 @@ private fun ExtractUserDataScreen(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
AnimatedContent(
targetState = viewState,
label = "",
transitionSpec = { createContentTransform() },
modifier = Modifier,
contentKey = { it is Error },
) {
when (it) {
is Error -> ExtractStateAnimation(
Animations.randomErrorAnimation,
it.error.errorDisplayMessage(),
)

else -> ExtractStateAnimation(Animations.randomDataTransferAnimations, "")
}
}
ExtractCreationAnimation(viewState)

AnimatedContent(
targetState = viewState,
Expand Down Expand Up @@ -128,6 +110,26 @@ private fun ExtractUserDataScreen(
}
}

@Composable
private fun ExtractCreationAnimation(viewState: ViewState) {
AnimatedContent(
targetState = viewState,
label = "",
transitionSpec = { createContentTransform() },
modifier = Modifier,
contentKey = { it is Error },
) {
when (it) {
is Error -> ExtractStateAnimation(
Animations.randomErrorAnimation,
it.error.errorDisplayMessage(),
)

else -> ExtractStateAnimation(Animations.randomDataTransferAnimations, "")
}
}
}

@Composable
private fun IdleContent(
createExtract: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private fun LoadingPageContent(
is LoadingPageViewState.Error -> viewStateInstance.error.errorDisplayMessage()
else -> "Loading..."
}
WtaAnimation(animation = Animations.randomLoadingAnimation, text = text, modifier = modifier)
WtaAnimation(animation = Animations.randomLoadingAnimation, text = text)
}
}

Expand Down

0 comments on commit 295ee19

Please sign in to comment.