summaryrefslogtreecommitdiffstats
path: root/Theme.kt
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2023-04-21 23:50:38 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2023-04-21 23:50:38 +0100
commit16a36c812fabda812ecf3aaa7f12fa6f44c66b2e (patch)
treeccae60abf8301ae451cfa1f21c33b8a62d5306cf /Theme.kt
parentdb091bfd1db36ab66340ccad2eb7b6393a0aa3da (diff)
downloadandroid-jetpack-compose-redo-master.tar.gz
android-jetpack-compose-redo-master.tar.xz
android-jetpack-compose-redo-master.zip
Jetpack Compose and materialHEADmaster
Diffstat (limited to 'Theme.kt')
-rw-r--r--Theme.kt67
1 files changed, 67 insertions, 0 deletions
diff --git a/Theme.kt b/Theme.kt
new file mode 100644
index 0000000..3097658
--- /dev/null
+++ b/Theme.kt
@@ -0,0 +1,67 @@
+package ski.kramkow.paste
+
+import androidx.compose.foundation.isSystemInDarkTheme
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.Shapes
+import androidx.compose.material.Typography
+import androidx.compose.material.darkColors
+import androidx.compose.material.lightColors
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.text.font.FontFamily
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+
+val Typography = Typography(
+ body1 = TextStyle(
+ fontFamily = FontFamily.Default,
+ fontWeight = FontWeight.Normal,
+ fontSize = 16.sp
+ )
+)
+
+val Shapes = Shapes(
+ small = RoundedCornerShape(4.dp),
+ medium = RoundedCornerShape(4.dp),
+ large = RoundedCornerShape(0.dp)
+)
+
+val Purple200 = Color(0xFFBB86FC)
+val Purple500 = Color(0xFF6200EE)
+val Purple700 = Color(0xFF3700B3)
+val Teal200 = Color(0xFF03DAC5)
+
+private val DarkColorPalette = darkColors(
+ primary = Purple200,
+ primaryVariant = Purple700,
+ secondary = Teal200
+)
+
+private val LightColorPalette = lightColors(
+ primary = Purple500,
+ primaryVariant = Purple700,
+ secondary = Teal200
+)
+
+@Composable
+fun PasteTheme(
+ darkTheme: Boolean = isSystemInDarkTheme(),
+ content: @Composable () -> Unit
+) {
+ val colors = if (darkTheme) {
+ DarkColorPalette
+ } else {
+ LightColorPalette
+ }
+
+ MaterialTheme(
+ colors = colors,
+ typography = Typography,
+ shapes = Shapes,
+ content = content
+ )
+}
+