mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Setup Showkase and add some Preview. WIP
This commit is contained in:
committed by
Benoit Marty
parent
073cd7fd03
commit
6392c57fce
@@ -1,5 +1,7 @@
|
||||
plugins {
|
||||
id("io.element.android-compose")
|
||||
// TODO Move to common config
|
||||
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -9,5 +11,7 @@ android {
|
||||
// Should not be there, but this is a POC
|
||||
implementation("io.coil-kt:coil-compose:2.2.1")
|
||||
implementation(libs.accompanist.systemui)
|
||||
// TODO Move to common config
|
||||
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package io.element.android.x.designsystem
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import com.airbnb.android.showkase.annotation.ShowkaseColor
|
||||
|
||||
@ShowkaseColor(name = "LightGrey", group = "Material Design")
|
||||
val LightGrey = Color(0x993C3C43)
|
||||
@ShowkaseColor(name = "DarkGrey", group = "Material Design")
|
||||
val DarkGrey = Color(0x99EBEBF5)
|
||||
|
||||
val AvatarGradientStart = Color(0xFF4CA1AF)
|
||||
|
||||
@@ -7,24 +7,31 @@ import androidx.compose.ui.text.font.FontStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.airbnb.android.showkase.annotation.ShowkaseTypography
|
||||
|
||||
|
||||
@ShowkaseTypography(name = "Body Large", group = "Element")
|
||||
val bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
|
||||
@ShowkaseTypography(name = "Headline Small", group = "Element")
|
||||
val headlineSmall = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 32.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
|
||||
// Set of Material typography styles to start with
|
||||
val Typography = Typography(
|
||||
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
),
|
||||
headlineSmall = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 32.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
),
|
||||
bodyLarge = bodyLarge,
|
||||
headlineSmall = headlineSmall,
|
||||
/* Other default text styles to override
|
||||
titleLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
|
||||
+1
-1
@@ -51,6 +51,6 @@ fun ProgressDialog(text: String? = null, onDismiss: () -> Unit = {}) {
|
||||
|
||||
@Composable
|
||||
@Preview
|
||||
private fun ProgressDialogPreview() {
|
||||
fun ProgressDialogPreview() {
|
||||
ProgressDialog("test dialog content")
|
||||
}
|
||||
+1
-1
@@ -71,7 +71,7 @@ fun ConfirmationDialog(
|
||||
|
||||
@Composable
|
||||
@Preview
|
||||
private fun ConfirmationDialogPreview() {
|
||||
fun ConfirmationDialogPreview() {
|
||||
ConfirmationDialog(
|
||||
isDisplayed = remember { mutableStateOf(true) },
|
||||
title = "Title",
|
||||
|
||||
Reference in New Issue
Block a user