diff --git a/app/src/main/kotlin/net/primal/android/core/compose/PrimalLoadingSpinner.kt b/app/src/main/kotlin/net/primal/android/core/compose/PrimalLoadingSpinner.kt index fdb6f1a3..eff4e59c 100644 --- a/app/src/main/kotlin/net/primal/android/core/compose/PrimalLoadingSpinner.kt +++ b/app/src/main/kotlin/net/primal/android/core/compose/PrimalLoadingSpinner.kt @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp @@ -13,14 +14,23 @@ import com.airbnb.lottie.compose.LottieAnimation import com.airbnb.lottie.compose.LottieCompositionSpec import com.airbnb.lottie.compose.animateLottieCompositionAsState import com.airbnb.lottie.compose.rememberLottieComposition +import net.primal.android.LocalPrimalTheme import net.primal.android.R +import net.primal.android.theme.domain.PrimalAccent @Composable fun PrimalLoadingSpinner( size: Dp = 96.dp, ) { + val primalTheme = LocalPrimalTheme.current + val animationRawResId = remember(primalTheme) { + when (primalTheme.accent) { + PrimalAccent.Summer -> R.raw.primal_loading_spinner_summer + PrimalAccent.Winter -> R.raw.primal_loading_spinner_winter + } + } val composition by rememberLottieComposition( - spec = LottieCompositionSpec.RawRes(R.raw.primal_loading_spinner_sunset) + spec = LottieCompositionSpec.RawRes(animationRawResId) ) val progress by animateLottieCompositionAsState( composition = composition,