feat(ui): initial channel browser and some ui groundwork
This commit is contained in:
parent
41f2b9782a
commit
c5cf0b5aa7
11 changed files with 358 additions and 3 deletions
|
|
@ -0,0 +1,25 @@
|
|||
package moe.lava.neon.ui
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.expressiveLightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
@Composable
|
||||
actual fun getColorScheme(): ColorScheme {
|
||||
val dynamicColor = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
val darkTheme = isSystemInDarkTheme()
|
||||
return when {
|
||||
dynamicColor && darkTheme -> dynamicDarkColorScheme(LocalContext.current)
|
||||
dynamicColor && !darkTheme -> dynamicLightColorScheme(LocalContext.current)
|
||||
darkTheme -> darkColorScheme()
|
||||
else -> expressiveLightColorScheme()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue