You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.8 KiB
69 lines
1.8 KiB
package config |
|
|
|
import androidx.compose.foundation.isSystemInDarkTheme |
|
import androidx.compose.foundation.layout.Box |
|
import androidx.compose.foundation.layout.padding |
|
import androidx.compose.material3.* |
|
import androidx.compose.runtime.Composable |
|
import androidx.compose.ui.Modifier |
|
|
|
private val DarkColorScheme = darkColorScheme( |
|
primary = Purple80, |
|
secondary = PurpleGrey80, |
|
tertiary = Pink80 |
|
) |
|
|
|
private val LightColorScheme = lightColorScheme( |
|
primary = Purple40, |
|
secondary = PurpleGrey40, |
|
tertiary = Pink40 |
|
|
|
/* Other default colors to override |
|
background = Color(0xFFFFFBFE), |
|
surface = Color(0xFFFFFBFE), |
|
onPrimary = Color.White, |
|
onSecondary = Color.White, |
|
onTertiary = Color.White, |
|
onBackground = Color(0xFF1C1B1F), |
|
onSurface = Color(0xFF1C1B1F), |
|
*/ |
|
) |
|
|
|
@Composable |
|
fun IIndicatorsTheme( |
|
darkTheme: Boolean = isSystemInDarkTheme(), |
|
content: @Composable () -> Unit |
|
) { |
|
val colorScheme = when { |
|
darkTheme -> DarkColorScheme |
|
else -> LightColorScheme |
|
} |
|
|
|
MaterialTheme( |
|
colorScheme = colorScheme, |
|
typography = Typography, |
|
content = content |
|
) |
|
} |
|
|
|
@OptIn(ExperimentalMaterial3Api::class) |
|
@Composable |
|
fun UIScreen(content: @Composable () -> Unit) { |
|
IIndicatorsTheme { |
|
Scaffold( |
|
topBar = { |
|
TopAppBar( |
|
title = { Text(text = "Indicators Compose Multiplatform") }, |
|
colors = TopAppBarDefaults.centerAlignedTopAppBarColors( |
|
containerColor = MaterialTheme.colorScheme.primary, |
|
titleContentColor = MaterialTheme.colorScheme.surface |
|
) |
|
) |
|
} |
|
) { contentPadding -> |
|
Box(modifier = Modifier.padding(contentPadding)) { |
|
content() |
|
} |
|
} |
|
} |
|
} |