forked from thunderbird/thunderbird-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request thunderbird#8117 from wmontwe/move-theme-to-core
Move theme to `:core:ui:theme:api` module
- Loading branch information
Showing
21 changed files
with
85 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app-k9mail/src/main/kotlin/com/fsck/k9/provider/K9ThemeProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/TbThemeProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Theme | ||
|
||
The app theme is provided by the `ThemeProvider` found in the `api` module and should be implemented in the app modules with the required app themes from the `core:compose` and `core:legacy` modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
id(ThunderbirdPlugins.Library.androidCompose) | ||
} | ||
|
||
android { | ||
namespace = "app.k9mail.core.ui.theme.api" | ||
} |
13 changes: 13 additions & 0 deletions
13
core/ui/theme/api/src/main/kotlin/app/k9mail/core/ui/theme/api/FeatureThemeProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package app.k9mail.core.ui.theme.api | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
/** | ||
* Provides the compose theme for a feature. | ||
*/ | ||
fun interface FeatureThemeProvider { | ||
@Composable | ||
fun WithTheme( | ||
content: @Composable () -> Unit, | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
core/ui/theme/api/src/main/kotlin/app/k9mail/core/ui/theme/api/Theme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package app.k9mail.core.ui.theme.api | ||
|
||
enum class Theme { | ||
LIGHT, | ||
DARK, | ||
} |
25 changes: 25 additions & 0 deletions
25
core/ui/theme/api/src/main/kotlin/app/k9mail/core/ui/theme/api/ThemeManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package app.k9mail.core.ui.theme.api | ||
|
||
import androidx.annotation.StyleRes | ||
|
||
interface ThemeManager { | ||
|
||
val appTheme: Theme | ||
val messageViewTheme: Theme | ||
val messageComposeTheme: Theme | ||
|
||
@get:StyleRes | ||
val appThemeResourceId: Int | ||
|
||
@get:StyleRes | ||
val messageViewThemeResourceId: Int | ||
|
||
@get:StyleRes | ||
val messageComposeThemeResourceId: Int | ||
|
||
@get:StyleRes | ||
val dialogThemeResourceId: Int | ||
|
||
@get:StyleRes | ||
val translucentDialogThemeResourceId: Int | ||
} |
2 changes: 1 addition & 1 deletion
2
...p/k9mail/legacy/ui/theme/ThemeProvider.kt → ...k9mail/core/ui/theme/api/ThemeProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package app.k9mail.legacy.ui.theme | ||
package app.k9mail.core.ui.theme.api | ||
|
||
import androidx.annotation.StyleRes | ||
|
||
|
12 changes: 0 additions & 12 deletions
12
...e/launcher/src/main/kotlin/app/k9mail/feature/launcher/FeatureLauncherExternalContract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
legacy/ui/legacy/src/main/java/com/fsck/k9/ui/helper/HtmlSettingsProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
legacy/ui/legacy/src/main/java/com/fsck/k9/view/WebViewConfigProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters