Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand All @@ -21,19 +23,23 @@ import com.example.tudee.R
import com.example.tudee.designsystem.theme.TudeeTheme
import com.example.tudee.domain.AppEntry
import com.example.tudee.naviagtion.Destination
import com.example.tudee.presentation.themeViewModel.ThemeViewModel
import kotlinx.coroutines.delay
import org.koin.androidx.compose.koinViewModel
import org.koin.compose.getKoin

@Composable
fun SplashScreen(
modifier: Modifier = Modifier,
themeViewModel: ThemeViewModel = koinViewModel(),
navController: NavController = rememberNavController(),
backgroundColor: Color = TudeeTheme.color.surface,
overlayColor: Color = TudeeTheme.color.statusColors.overlay,
backgroundPainter: Painter = painterResource(R.drawable.background_ellipse),
iconPainter: Painter = painterResource(R.drawable.tudee_logo),
appEntry: AppEntry = getKoin().get()
) {
val isDark by themeViewModel.isDarkMode.collectAsState()
LaunchedEffect(Unit) {
delay(3000)
if (appEntry.isFirstEntry()) {
Expand All @@ -60,7 +66,7 @@ fun SplashScreen(
) {
Image(
modifier = Modifier.fillMaxSize(),
painter = backgroundPainter,
painter = if (isDark) painterResource(R.drawable.background_ellipse_dark) else backgroundPainter,
contentDescription = null,
contentScale = ContentScale.Crop
)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.