Add app module to preview features

This commit is contained in:
Wolf Montwé 2023-04-04 17:12:39 +02:00
parent efff0f96d6
commit 94d832eea3
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
13 changed files with 321 additions and 0 deletions

View file

@ -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)
}

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Thunderbird.Splashscreen"
>
<activity
android:name=".FeatureActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -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()
}
}
}

View file

@ -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 */ },
)
}
}

View file

@ -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)
}
}
}

View file

@ -0,0 +1,70 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="m33.37,60.39l0,3.87l8.26,12.25c0.67,1.16 1.91,1.93 3.35,1.93l18.05,0c1.44,0 2.68,-0.78 3.35,-1.93l0,0L74.63,64.26l0,-3.87z"
android:strokeLineJoin="miter"
android:strokeWidth="1.2"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:fillType="evenOdd"
android:strokeLineCap="butt"/>
<path
android:pathData="M43.68,32.02l2.58,0l0,5.16l-2.58,0z"
android:strokeLineJoin="miter"
android:strokeWidth="1.46"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:pathData="M61.74,32.02l2.58,0l0,5.16l-2.58,0z"
android:strokeLineJoin="miter"
android:strokeWidth="1.46"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:pathData="M48.84,27.51L48.84,30.09A1.93,1.93 0,0 1,46.91 32.02L39.17,32.02A1.93,1.93 0,0 1,37.24 30.09L37.24,27.51A1.93,1.93 0,0 1,39.17 25.57L46.91,25.57A1.93,1.93 0,0 1,48.84 27.51z"
android:strokeLineJoin="miter"
android:strokeWidth="1.2"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:pathData="M70.76,27.51L70.76,30.09A1.93,1.93 0,0 1,68.83 32.02L61.09,32.02A1.93,1.93 0,0 1,59.16 30.09L59.16,27.51A1.93,1.93 0,0 1,61.09 25.57L68.83,25.57A1.93,1.93 0,0 1,70.76 27.51z"
android:strokeLineJoin="miter"
android:strokeWidth="1.2"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:pathData="M33.37,34.6C31.23,34.6 29.5,36.33 29.5,38.47L29.5,60.39C29.5,62.53 31.23,64.26 33.37,64.26L74.63,64.26C76.77,64.26 78.5,62.53 78.5,60.39L78.5,38.47C78.5,36.33 76.77,34.6 74.63,34.6L33.37,34.6zM34.38,38.83A0.97,0.97 82.66,0 1,35.11 38.91L54,48.98L72.89,38.91A0.97,0.97 124.49,0 1,74.2 39.3A0.97,0.97 60.28,0 1,73.8 40.61L54,51.17L34.2,40.61A0.97,0.97 0,0 1,33.8 39.3A0.97,0.97 65.26,0 1,34.38 38.83z"
android:strokeLineJoin="miter"
android:strokeWidth="0.11"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:pathData="M57.87,73.93L57.87,77.8A1.93,1.93 0,0 1,55.93 79.73L52.07,79.73A1.93,1.93 125.04,0 1,50.13 77.8L50.13,73.93A1.93,1.93 87.01,0 1,52.07 72L55.93,72A1.93,1.93 0,0 1,57.87 73.93z"
android:strokeLineJoin="miter"
android:strokeWidth="0.11"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
<path
android:pathData="M54,78.44m-3.87,0a3.87,3.87 134.88,1 1,7.74 0a3.87,3.87 45.24,1 1,-7.74 0"
android:strokeLineJoin="miter"
android:strokeWidth="2.9"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:strokeLineCap="round"/>
</vector>

View file

@ -0,0 +1,99 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="192"
android:viewportHeight="192">
<group
android:scaleX="0.52411765"
android:scaleY="0.52411765"
android:translateX="45.684708"
android:translateY="44.75294">
<path
android:fillAlpha="0.2"
android:fillColor="#000000"
android:pathData="M50,12C46.68,12 44,14.68 44,18V26C44,29.32 46.68,32 50,32H64V48H72V32H74C77.32,32 80,29.32 80,26V18C80,14.68 77.32,12 74,12H50ZM118,12C114.68,12 112,14.68 112,18V26C112,29.32 114.68,32 118,32H120V48H128V32H142C145.32,32 148,29.32 148,26V18C148,14.68 145.32,12 142,12H118ZM32,120V132L57.61,170C59.68,173.59 63.54,176 68,176H124C128.46,176 132.32,173.59 134.39,170H134.4L160,132V120H32Z"
android:strokeAlpha="0.2" />
<path
android:fillAlpha="0.2"
android:fillColor="#000000"
android:pathData="M50,8C46.68,8 44,10.68 44,14V22C44,25.32 46.68,28 50,28H64V44H72V28H74C77.32,28 80,25.32 80,22V14C80,10.68 77.32,8 74,8H50ZM118,8C114.68,8 112,10.68 112,14V22C112,25.32 114.68,28 118,28H120V44H128V28H142C145.32,28 148,25.32 148,22V14C148,10.68 145.32,8 142,8H118ZM32,116V128L57.61,166C59.68,169.59 63.54,172 68,172H124C128.46,172 132.32,169.59 134.39,166H134.4L160,128V116H32Z"
android:strokeAlpha="0.2" />
<path
android:fillAlpha="0.2"
android:fillColor="#000000"
android:pathData="M24,116L32,128L57.61,166C59.68,169.59 63.54,172 68,172H124C128.46,172 132.32,169.59 134.39,166H134.4L160,128L168,116H24Z"
android:strokeAlpha="0.2" />
<path
android:fillColor="#607D8B"
android:pathData="M32,116V128L57.61,166C59.68,169.59 63.54,172 68,172H124C128.46,172 132.32,169.59 134.39,166H134.4L160.01,128V116H32Z" />
<path
android:fillColor="#263238"
android:pathData="M72,16H64V44H72V16Z" />
<path
android:fillColor="#263238"
android:pathData="M128,16H120V44H128V16Z" />
<path
android:fillColor="#4D6570"
android:pathData="M32,127V128L57.61,166C59.68,169.59 63.54,172 68,172H124C128.46,172 132.32,169.59 134.39,166H134.4L160,128V127L134.4,165H134.39C132.32,168.59 128.46,171 124,171H68C63.54,171 59.68,168.59 57.61,165L32,127Z" />
<path
android:fillColor="#607D8B"
android:pathData="M80,22V14C80,10.69 77.31,8 74,8L50,8C46.69,8 44,10.69 44,14V22C44,25.31 46.69,28 50,28L74,28C77.31,28 80,25.31 80,22Z" />
<path
android:fillColor="#607D8B"
android:pathData="M148,22V14C148,10.69 145.31,8 142,8L118,8C114.69,8 112,10.69 112,14V22C112,25.31 114.69,28 118,28L142,28C145.31,28 148,25.31 148,22Z" />
<path
android:fillColor="#4D6570"
android:pathData="M44,21V22C44,25.32 46.68,28 50,28H74C77.32,28 80,25.32 80,22V21C80,24.32 77.32,27 74,27H50C46.68,27 44,24.32 44,21Z" />
<path
android:fillColor="#4D6570"
android:pathData="M112,21V22C112,25.32 114.68,28 118,28H142C145.32,28 148,25.32 148,22V21C148,24.32 145.32,27 142,27H118C114.68,27 112,24.32 112,21Z" />
<path
android:fillColor="#8097A2"
android:pathData="M50,8C46.68,8 44,10.68 44,14V15C44,11.68 46.68,9 50,9H74C77.32,9 80,11.68 80,15V14C80,10.68 77.32,8 74,8H50Z" />
<path
android:fillColor="#8097A2"
android:pathData="M118,8C114.68,8 112,10.68 112,14V15C112,11.68 114.68,9 118,9H142C145.32,9 148,11.68 148,15V14C148,10.68 145.32,8 142,8H118Z" />
<path
android:fillAlpha="0.2"
android:fillColor="#1A252A"
android:pathData="M171.99,120V52C171.99,45.37 166.62,40 159.99,40L31.99,40C25.37,40 19.99,45.37 19.99,52V120C19.99,126.62 25.37,132 31.99,132H159.99C166.62,132 171.99,126.62 171.99,120Z"
android:strokeAlpha="0.2" />
<path
android:fillColor="@color/ic_launcher_logo_main"
android:pathData="M172,116V48C172,41.37 166.63,36 160,36L32,36C25.37,36 20,41.37 20,48V116C20,122.63 25.37,128 32,128H160C166.63,128 172,122.63 172,116Z" />
<path
android:fillColor="#00000000"
android:pathData="M36,52L96,84L156,52"
android:strokeWidth="6"
android:strokeColor="#FBE9E7"
android:strokeLineCap="round" />
<path
android:fillColor="@color/ic_launcher_logo_main"
android:pathData="M32,36C25.35,36 20,41.35 20,48V49C20,42.35 25.35,37 32,37H160C166.65,37 172,42.35 172,49V48C172,41.35 166.65,36 160,36H32Z" />
<path
android:fillColor="@color/ic_launcher_logo_shadow"
android:pathData="M20,115V116C20,122.65 25.35,128 32,128H160C166.65,128 172,122.65 172,116V115C172,121.65 166.65,127 160,127H32C25.35,127 20,121.65 20,115Z" />
<path
android:fillAlpha="0.2"
android:fillColor="#000000"
android:pathData="M90,156C86.68,156 84,158.68 84,162V174C84,174.27 84.03,174.54 84.06,174.8C84.06,174.8 84.06,174.81 84.06,174.81C84.02,175.2 84,175.6 84,176C84,179.18 85.26,182.23 87.51,184.48C89.77,186.73 92.82,188 96,188C99.18,188 102.24,186.73 104.49,184.48C106.74,182.23 108,179.18 108,176C108,175.61 107.97,175.23 107.93,174.85C107.97,174.57 108,174.29 108,174V162C108,158.67 105.33,156 102,156L90,156Z"
android:strokeAlpha="0.2" />
<path
android:fillAlpha="0.2"
android:fillColor="#000000"
android:pathData="M90,152C86.68,152 84,154.68 84,158V170C84,170.27 84.03,170.54 84.06,170.8C84.06,170.8 84.06,170.81 84.06,170.81C84.02,171.2 84,171.6 84,172C84,175.18 85.26,178.23 87.51,180.48C89.77,182.73 92.82,184 96,184C99.18,184 102.24,182.73 104.49,180.48C106.74,178.23 108,175.18 108,172C108,171.61 107.97,171.23 107.93,170.85C107.97,170.57 108,170.29 108,170V158C108,154.67 105.33,152 102,152L90,152Z"
android:strokeAlpha="0.2" />
<path
android:fillColor="#263238"
android:pathData="M108,170V158C108,154.69 105.31,152 102,152H90C86.69,152 84,154.69 84,158V170C84,173.31 86.69,176 90,176H102C105.31,176 108,173.31 108,170Z" />
<path
android:fillColor="#263238"
android:pathData="M96,184C102.63,184 108,178.63 108,172C108,165.37 102.63,160 96,160C89.37,160 84,165.37 84,172C84,178.63 89.37,184 96,184Z" />
<path
android:fillColor="#37474F"
android:pathData="M90,152C86.68,152 84,154.68 84,158V159C84,155.68 86.68,153 90,153H102C105.32,153 108,155.68 108,159V158C108,154.68 105.32,152 102,152H90Z" />
<path
android:fillColor="#1A252A"
android:pathData="M84.02,171.43C84.01,171.62 84,171.81 84,172C84,175.18 85.26,178.24 87.51,180.49C89.77,182.74 92.82,184 96,184C99.18,184 102.24,182.74 104.49,180.49C106.74,178.24 108,175.18 108,172C108,171.86 107.99,171.73 107.98,171.59C107.83,174.67 106.5,177.57 104.27,179.69C102.04,181.81 99.08,183 96,183C92.89,183 89.91,181.79 87.68,179.63C85.44,177.47 84.13,174.53 84.02,171.43Z" />
</group>
</vector>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Material green 300 -->
<color name="ic_launcher_logo_main">#81C784</color>
<!-- Material green 700 -->
<color name="ic_launcher_logo_shadow">#FF388E3C</color>
<!-- Material green 50 -->
<color name="ic_launcher_background">#E8F5E9</color>
</resources>

View file

@ -0,0 +1,3 @@
<resources>
<string name="app_name">Thunderbird Features</string>
</resources>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Thunderbird" parent="Theme.MaterialComponents.DayNight.NoActionBar" />
<style name="Theme.Thunderbird.Splashscreen" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/Theme.Thunderbird</item>
</style>
</resources>

View file

@ -22,6 +22,7 @@ rootProject.name = "k-9"
includeBuild("build-plugin")
include(
":app-feature-preview",
":app-ui-catalog",
)