First draft of full custom theme.

ElementTheme everywhere

Create ElementButton
This commit is contained in:
Benoit Marty 2023-01-26 15:15:51 +01:00
parent 78544357e8
commit e4cc733f4a
50 changed files with 1082 additions and 377 deletions

View file

@ -32,6 +32,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import io.element.android.libraries.designsystem.theme.components.ElementButton
@Composable
fun ShowkaseButton(
@ -41,7 +42,7 @@ fun ShowkaseButton(
var isShowkaseButtonVisible by remember { mutableStateOf(BuildConfig.DEBUG) }
if (isShowkaseButtonVisible) {
Button(
ElementButton(
modifier = modifier
.padding(top = 32.dp),
onClick = onClick

View file

@ -24,7 +24,6 @@ import androidx.activity.OnBackPressedDispatcherOwner
import androidx.activity.compose.LocalOnBackPressedDispatcherOwner
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
@ -36,7 +35,7 @@ import app.cash.paparazzi.Paparazzi
import com.airbnb.android.showkase.models.Showkase
import com.google.testing.junit.testparameterinjector.TestParameter
import com.google.testing.junit.testparameterinjector.TestParameterInjector
import io.element.android.libraries.designsystem.ElementXTheme
import io.element.android.libraries.designsystem.theme.ElementTheme
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@ -101,8 +100,8 @@ class ScreenshotTest {
override fun getOnBackPressedDispatcher() = OnBackPressedDispatcher()
}
) {
ElementXTheme(darkTheme = (theme == "dark")) {
Box(modifier = Modifier.background(MaterialTheme.colorScheme.background)) {
ElementTheme(darkTheme = (theme == "dark")) {
Box(modifier = Modifier.background(ElementTheme.colors.background)) {
componentTestPreview.Content()
}
}

View file

@ -19,11 +19,11 @@ package io.element.android.tests.uitests
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.BasicText
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.airbnb.android.showkase.models.ShowkaseBrowserTypography
import com.airbnb.android.showkase.ui.padding4x
import io.element.android.libraries.designsystem.theme.ElementTheme
import java.util.Locale
class TypographyTestPreview(
@ -39,7 +39,7 @@ class TypographyTestPreview(
.fillMaxWidth()
.padding(padding4x),
style = showkaseBrowserTypography.textStyle.copy(
color = MaterialTheme.colorScheme.onBackground
color = ElementTheme.colors.onBackground
)
)
}