thunderbird-android/core/ui/compose/theme
2023-03-23 13:34:18 +01:00
..
src/main Change theme to use custom colors instead of the material ones to allow usage without material dependency 2023-03-23 13:34:18 +01:00
build.gradle.kts Add :core:ui:compose:common module to host commonly shared functionality and add DevicePreviews 2023-03-14 14:50:39 +01:00
README.md Add design system README 2023-03-01 13:46:25 +01:00

Core - UI - Compose - Theme

This provides the MainTheme with dark/light variation, a wrapper for the Compose Material2 theme. It supports CompositionLocal changes to colors, typography, shapes and adds additionally elevations, sizes, spacings and images.

To change Material2 related properties use MainTheme instead of MaterialTheme:

  • MainTheme.colors: Material2 colors
  • MainTheme.typography: Material 2 typography
  • MainTheme.shapes: Material2 shapes
  • MainTheme.spacings: Spacings (quarter, half, default, oneHalf, double, triple, quadruple) while default is 8 dp.
  • MainTheme.sizes: Sizes (smaller, small, medium, large, larger, huge, huger)
  • MainTheme.elevations: Elevation, e.g. card
  • MainTheme.images: Images used across the theme, e.g. logo

Included are two derived themes for K-9 and Thunderbird look: K9Theme and ThunderbirdTheme.

To render previews for both themes use PreviewWithThemes. This also includes a dark/light variation:

@Preview(showBackground = true)
@Composable
fun MyViewPreview() {
    PreviewWithThemes {
        MyView()
    }
}