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 0000000000..ae86b17f76 Binary files /dev/null and b/app-feature-preview/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app-feature-preview/src/main/res/values/colors.xml b/app-feature-preview/src/main/res/values/colors.xml new file mode 100644 index 0000000000..fa266431f9 --- /dev/null +++ b/app-feature-preview/src/main/res/values/colors.xml @@ -0,0 +1,9 @@ + + + + #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", )