Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package app.k9mail.provider

import androidx.compose.runtime.Composable
import net.thunderbird.core.ui.compose.theme2.k9mail.K9MailTheme2
import net.thunderbird.components.ui.bolt.theme.k9mail.K9MailBoltTheme
import net.thunderbird.core.ui.theme.api.FeatureThemeProvider

internal class K9FeatureThemeProvider : FeatureThemeProvider {
@Composable
override fun WithTheme(content: @Composable () -> Unit) {
K9MailTheme2 {
K9MailBoltTheme {
content()
}
}

@Composable
override fun WithTheme(darkTheme: Boolean, content: @Composable () -> Unit) {
K9MailTheme2(darkTheme = darkTheme) {
K9MailBoltTheme(darkTheme = darkTheme) {
content()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package net.thunderbird.android.provider

import androidx.compose.runtime.Composable
import net.thunderbird.core.ui.compose.theme2.thunderbird.ThunderbirdTheme2
import net.thunderbird.components.ui.bolt.theme.thunderbird.ThunderbirdBoltTheme
import net.thunderbird.core.ui.theme.api.FeatureThemeProvider

internal class TbFeatureThemeProvider : FeatureThemeProvider {
@Composable
override fun WithTheme(content: @Composable () -> Unit) {
ThunderbirdTheme2 {
ThunderbirdBoltTheme {
content()
}
}

@Composable
override fun WithTheme(darkTheme: Boolean, content: @Composable () -> Unit) {
ThunderbirdTheme2(darkTheme = darkTheme) {
ThunderbirdBoltTheme(darkTheme = darkTheme) {
content()
}
}
Expand Down
29 changes: 29 additions & 0 deletions components/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
ij_continuation_indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
max_line_length = 120

[*.{kt,kts}]
ij_kotlin_imports_layout = *,^
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_indent_before_arrow_on_new_line = false

[*.{yml,yaml,json,toml}]
indent_size = 2
tab_width = 2
ij_continuation_indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.sh]
indent_size = 2
5 changes: 2 additions & 3 deletions components/ui/bolt/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Core - UI - Compose - Design system
## Bolt

Uses [`:core:ui:compose:theme`](../theme/README.md)
[Bolt](https://bolt.thunderbird.net/) is the Thunderbird Compose design system.

## Background

Expand Down Expand Up @@ -36,4 +36,3 @@ This can save time and improve the overall quality, as well as facilitate collab

- [Atomic Design Methodology | Atomic Design by Brad Frost](https://atomicdesign.bradfrost.com/chapter-2/)
- [Atomic Design: Getting Started | Blog | We Are Mobile First](https://www.wearemobilefirst.com/blog/atomic-design)

2 changes: 1 addition & 1 deletion components/ui/bolt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version = libs.versions.tbMobileComponents.get()

kotlin {
android {
namespace = "app.k9mail.core.ui.compose.designsystem"
namespace = "net.thunderbird.components.ui.bolt"
androidResources.enable = true
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.thunderbird.core.ui.compose.designsystem.atom.textfield
package net.thunderbird.components.ui.bolt.atom.textfield

import android.os.Build
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package app.k9mail.core.ui.compose.theme2
package net.thunderbird.components.ui.bolt.theme

import android.content.Context
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import com.google.android.material.color.MaterialColors
import net.thunderbird.core.ui.compose.theme2.ColorRoles
import net.thunderbird.components.ui.bolt.theme.ColorRoles

/**
* Returns a harmonized color that is derived from the given color and the target color.
Expand All @@ -17,12 +17,12 @@ import net.thunderbird.core.ui.compose.theme2.ColorRoles
fun Color.toHarmonizedColor(target: Color) = Color(MaterialColors.harmonize(toArgb(), target.toArgb()))

/**
* Returns a [net.thunderbird.core.ui.compose.theme2.ColorRoles] object that contains the accent colors derived from the given color.
* Returns a [net.thunderbird.components.ui.bolt.theme.ColorRoles] object that contains the accent colors derived from the given color.
*
* This function uses Material Colors to retrieve the accent colors based on the provided color.
*
* @param context The context to use for retrieving the color roles.
* @return A [net.thunderbird.core.ui.compose.theme2.ColorRoles] object containing the accent colors.
* @return A [net.thunderbird.components.ui.bolt.theme.ColorRoles] object containing the accent colors.
*/
fun Color.toColorRoles(context: Context): ColorRoles {
val colorRoles = MaterialColors.getColorRoles(context, this.toArgb())
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading