From 94d832eea3595c4ad0792737ab4bd9fc3cd8c4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf=20Montwe=CC=81?= Date: Tue, 4 Apr 2023 17:12:39 +0200 Subject: [PATCH] Add app module to preview features --- app-feature-preview/build.gradle.kts | 19 ++++ .../src/main/AndroidManifest.xml | 23 ++++ .../k9mail/feature/preview/FeatureActivity.kt | 22 ++++ .../preview/navigation/FeatureNavHost.kt | 26 +++++ .../k9mail/feature/preview/ui/FeatureApp.kt | 33 ++++++ .../drawable-v26/ic_launcher_monochrome.xml | 70 +++++++++++++ .../res/drawable/ic_launcher_foreground.xml | 99 ++++++++++++++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 6 ++ .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 5537 bytes .../src/main/res/values/colors.xml | 9 ++ .../src/main/res/values/strings.xml | 3 + .../src/main/res/values/themes.xml | 10 ++ settings.gradle.kts | 1 + 13 files changed, 321 insertions(+) create mode 100644 app-feature-preview/build.gradle.kts create mode 100644 app-feature-preview/src/main/AndroidManifest.xml create mode 100644 app-feature-preview/src/main/java/app/k9mail/feature/preview/FeatureActivity.kt create mode 100644 app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt create mode 100644 app-feature-preview/src/main/java/app/k9mail/feature/preview/ui/FeatureApp.kt create mode 100644 app-feature-preview/src/main/res/drawable-v26/ic_launcher_monochrome.xml create mode 100644 app-feature-preview/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 app-feature-preview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app-feature-preview/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app-feature-preview/src/main/res/values/colors.xml create mode 100644 app-feature-preview/src/main/res/values/strings.xml create mode 100644 app-feature-preview/src/main/res/values/themes.xml diff --git a/app-feature-preview/build.gradle.kts b/app-feature-preview/build.gradle.kts new file mode 100644 index 0000000000..5cd1a2d35f --- /dev/null +++ b/app-feature-preview/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id(ThunderbirdPlugins.App.androidCompose) +} + +android { + namespace = "app.k9mail.feature.preview" + + defaultConfig { + applicationId = "net.thunderbird.feature.preview" + versionCode = 1 + versionName = "1.0" + } +} + +dependencies { + implementation(projects.core.ui.compose.designsystem) + + implementation(projects.feature.onboarding) +} diff --git a/app-feature-preview/src/main/AndroidManifest.xml b/app-feature-preview/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..5312e4e208 --- /dev/null +++ b/app-feature-preview/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/app-feature-preview/src/main/java/app/k9mail/feature/preview/FeatureActivity.kt b/app-feature-preview/src/main/java/app/k9mail/feature/preview/FeatureActivity.kt new file mode 100644 index 0000000000..5963733647 --- /dev/null +++ b/app-feature-preview/src/main/java/app/k9mail/feature/preview/FeatureActivity.kt @@ -0,0 +1,22 @@ +package app.k9mail.feature.preview + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen +import androidx.core.view.WindowCompat +import app.k9mail.feature.preview.ui.FeatureApp + +class FeatureActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + installSplashScreen() + + super.onCreate(savedInstanceState) + + WindowCompat.setDecorFitsSystemWindows(window, false) + + setContent { + FeatureApp() + } + } +} diff --git a/app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt b/app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt new file mode 100644 index 0000000000..515db983c6 --- /dev/null +++ b/app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt @@ -0,0 +1,26 @@ +package app.k9mail.feature.preview.navigation + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.navigation.NavHostController +import androidx.navigation.compose.NavHost +import net.thunderbird.feature.onboarding.navigation.NAVIGATION_ROUTE_ONBOARDING +import net.thunderbird.feature.onboarding.navigation.onboardingScreen + +@Composable +fun FeatureNavHost( + navController: NavHostController, + modifier: Modifier = Modifier, + startDestination: String = NAVIGATION_ROUTE_ONBOARDING, +) { + NavHost( + navController = navController, + startDestination = startDestination, + modifier = modifier, + ) { + onboardingScreen( + onStartClick = { /* TODO */ }, + onImportClick = { /* TODO */ }, + ) + } +} diff --git a/app-feature-preview/src/main/java/app/k9mail/feature/preview/ui/FeatureApp.kt b/app-feature-preview/src/main/java/app/k9mail/feature/preview/ui/FeatureApp.kt new file mode 100644 index 0000000000..baa3ceddb8 --- /dev/null +++ b/app-feature-preview/src/main/java/app/k9mail/feature/preview/ui/FeatureApp.kt @@ -0,0 +1,33 @@ +package app.k9mail.feature.preview.ui + +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.asPaddingValues +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.systemBars +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.navigation.compose.rememberNavController +import app.k9mail.core.ui.compose.designsystem.atom.Background +import app.k9mail.core.ui.compose.theme.K9Theme +import app.k9mail.feature.preview.navigation.FeatureNavHost + +@Composable +fun FeatureApp( + modifier: Modifier = Modifier, +) { + val navController = rememberNavController() + + K9Theme { + val contentPadding = WindowInsets.systemBars.asPaddingValues() + + Background( + modifier = Modifier + .fillMaxSize() + .padding(contentPadding) + .then(modifier), + ) { + FeatureNavHost(navController = navController) + } + } +} diff --git a/app-feature-preview/src/main/res/drawable-v26/ic_launcher_monochrome.xml b/app-feature-preview/src/main/res/drawable-v26/ic_launcher_monochrome.xml new file mode 100644 index 0000000000..7ff75784ea --- /dev/null +++ b/app-feature-preview/src/main/res/drawable-v26/ic_launcher_monochrome.xml @@ -0,0 +1,70 @@ + + + + + + + + + + diff --git a/app-feature-preview/src/main/res/drawable/ic_launcher_foreground.xml b/app-feature-preview/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000000..aefb4a3279 --- /dev/null +++ b/app-feature-preview/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-feature-preview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app-feature-preview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000000..67048fd38a --- /dev/null +++ b/app-feature-preview/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/app-feature-preview/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app-feature-preview/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..ae86b17f7692d62626a91a2da1bd89714f23d423 GIT binary patch literal 5537 zcmb_gc`)4Dv!5|BwoGgxgCLQ_8Zx#)>_Ws&>;!{gFt!my1Y?(2lMq5MObFM`*aizYqUcIXKt@?hyRo$n%Kc~A-pFZb}uC^+Knw1&=06^59C_g3r zoBq6%VAA*LG>QTMU_z=XD;m7C+)AT*!DN`y9zy1XE5t2|h^AN8xzxqY4_5osRSk*a z3crpp@0B1!$O_k>+`(NoWKws(1Hk=7{f#R{;&s^=W7$VF?Ko6YSp2M9CMacGKd0AnViyhO0FOp z%*9TQs8*b~|A<)mdj6f$V6*12;2rWg;n*wf7pXb+g3Hd6bgYhA@`_B``e|)$v2w$Q zM*|QpHK#W%4yn)xE@#C@Nb(d%H4R1jZ4h%(^%K5kPL)M@c)HZzuz4P$-`aNz0WY47 zEVIFc!WP(yWBT?Ql|K)I3=hM-aK{i&C7xss$IBwgXTlm!)aq`O5MOk7wL~d;qoofr zT1*?mlv#2F-Nhw+)|A<|3dW^?Dd-u-@sl>F&-S9m*IysJ;;MCg&7Q>J%Zf08dURO)3M99oV$V3f!;j4%=EoWk zBLa?BrQ~hNs(G-3Z`twOE^mZNQ1#Opl&$Bl^2~xoB%}gH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k6^qKap@ zY`OeKGhC4vbJEH8&3S0jm7xQXSjxf~9=!MZL7#lwha$nN?uv07vbArEtM7Uh%Ndo& zK$?=n`sv@4U+NgD=C2rR_AF%w~`*_;5^ritJ8= z%CKSfSY`mfF_=@egE2*0p+YZj#|QJ7Ec1KqoQ=<3Z>3kulm^apzCv4&_jXbVYf?x> zFgkhbU5nw6KZ77Q->GuckfnH%M1p)xR-KC*nDw#wljAM11B+T6{)HcI= zxlxT|I7w14?j~aPu3MZh5VI)_^NNZA_@nPDhNbh{cN= z#aCpL3ZCtgU+9>guQ zCb|F?-&2y5ikVM9uqHS1svb*8!cal*{Vg{u;d{a5UdmQ3tj_GWAw zeywSNI=E%wbpf+*FL`jg%;o$$^~rCI34@-ZNXx-`|CZSR&ntKkqz3;YO~br0^!2cPGihdt#^7Yr|WBfqq){JZ)hoK%BFJ^E=u0p+p2rzYv9KCfN%j zCjtG`VoQV9#I6V`>Q|Z)+yr5gTb=IXm#F{=ArqEby~oJ#wx4Ol0D=mP{a`V&LIu(OYhu^M7RMe*0Dn4Lw4`KATVIR#GVgTvrN2pe_dD3q zGt%84kfa_NVnO`QZZQ!tQ$bf}W&!aGdQ$Fk`8ZEyQTf!$lujpF3-}Ov63Klsl*z m3;RFVeTGo{FHgkIUSKy;E=aV!h?aEq3Q$wgRxVOP1pgO + + + #81C784 + + #FF388E3C + + #E8F5E9 + diff --git a/app-feature-preview/src/main/res/values/strings.xml b/app-feature-preview/src/main/res/values/strings.xml new file mode 100644 index 0000000000..b40837eae0 --- /dev/null +++ b/app-feature-preview/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Thunderbird Features + diff --git a/app-feature-preview/src/main/res/values/themes.xml b/app-feature-preview/src/main/res/values/themes.xml new file mode 100644 index 0000000000..dbb3e15dc4 --- /dev/null +++ b/app-feature-preview/src/main/res/values/themes.xml @@ -0,0 +1,10 @@ + + + + diff --git a/settings.gradle.kts b/settings.gradle.kts index 571fde3104..f8c7083fe4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,6 +22,7 @@ rootProject.name = "k-9" includeBuild("build-plugin") include( + ":app-feature-preview", ":app-ui-catalog", )