diff --git a/build-plugin/src/main/kotlin/thunderbird.app.android.compose.gradle.kts b/build-plugin/src/main/kotlin/thunderbird.app.android.compose.gradle.kts index 1d2f167a4..166de9e23 100644 --- a/build-plugin/src/main/kotlin/thunderbird.app.android.compose.gradle.kts +++ b/build-plugin/src/main/kotlin/thunderbird.app.android.compose.gradle.kts @@ -48,6 +48,6 @@ dependencies { debugImplementation("androidx.compose.ui:ui-test-manifest") androidTestImplementation("androidx.compose.ui:ui-test-junit4") - implementation("androidx.activity:activity-compose:1.6.1") - implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1") + implementation(libs.androidx.compose.activity) + implementation(libs.androidx.compose.lifecycle.viewmodel) } diff --git a/core/ui/compose/demo/build.gradle.kts b/core/ui/compose/demo/build.gradle.kts new file mode 100644 index 000000000..2bfcbb981 --- /dev/null +++ b/core/ui/compose/demo/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id(ThunderbirdPlugins.App.androidCompose) +} + +android { + namespace = "app.k9mail.core.ui.compose.demo" + + defaultConfig { + applicationId = "app.k9mail.core.ui.compose.demo" + versionCode = 1 + versionName = "1.0" + } +} + +dependencies { + androidTestImplementation(libs.androidx.test.ext.junit.ktx) + androidTestImplementation(libs.androidx.test.espresso.core) +} diff --git a/core/ui/compose/demo/proguard-rules.pro b/core/ui/compose/demo/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/core/ui/compose/demo/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/core/ui/compose/demo/src/main/AndroidManifest.xml b/core/ui/compose/demo/src/main/AndroidManifest.xml new file mode 100644 index 000000000..e5489c868 --- /dev/null +++ b/core/ui/compose/demo/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/core/ui/compose/demo/src/main/java/app/k9mail/core/ui/compose/demo/MainActivity.kt b/core/ui/compose/demo/src/main/java/app/k9mail/core/ui/compose/demo/MainActivity.kt new file mode 100644 index 000000000..c7397fd41 --- /dev/null +++ b/core/ui/compose/demo/src/main/java/app/k9mail/core/ui/compose/demo/MainActivity.kt @@ -0,0 +1,30 @@ +package app.k9mail.core.ui.compose.demo + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + setContent { + Greeting(name = stringResource(id = R.string.app_name)) + } + } +} + +@Composable +fun Greeting(name: String) { + Text(text = "Hello $name!") +} + +@Preview(showBackground = true) +@Composable +fun Preview() { + Greeting("Android") +} diff --git a/core/ui/compose/demo/src/main/res/drawable-v24/ic_launcher_foreground.xml b/core/ui/compose/demo/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 000000000..02f9cf0af --- /dev/null +++ b/core/ui/compose/demo/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/ui/compose/demo/src/main/res/drawable/ic_launcher_foreground.xml b/core/ui/compose/demo/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 000000000..587ad8708 --- /dev/null +++ b/core/ui/compose/demo/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/ui/compose/demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/core/ui/compose/demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 000000000..515b77ec1 --- /dev/null +++ b/core/ui/compose/demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/ui/compose/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/core/ui/compose/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 000000000..515b77ec1 --- /dev/null +++ b/core/ui/compose/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/ui/compose/demo/src/main/res/mipmap-hdpi/ic_launcher.png b/core/ui/compose/demo/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..924281162 Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png b/core/ui/compose/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 000000000..fc1923f21 Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-mdpi/ic_launcher.png b/core/ui/compose/demo/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..1d71edf96 Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png b/core/ui/compose/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 000000000..b56dad758 Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-xhdpi/ic_launcher.png b/core/ui/compose/demo/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..791d73e5e Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/core/ui/compose/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 000000000..8b202416d Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png b/core/ui/compose/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d337db093 Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/core/ui/compose/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 000000000..3fc5fd2ee Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/core/ui/compose/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..556153a4b Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/core/ui/compose/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/core/ui/compose/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 000000000..d65ef78d0 Binary files /dev/null and b/core/ui/compose/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/core/ui/compose/demo/src/main/res/values/colors.xml b/core/ui/compose/demo/src/main/res/values/colors.xml new file mode 100644 index 000000000..1e7f3d9fa --- /dev/null +++ b/core/ui/compose/demo/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #FCE8DC + diff --git a/core/ui/compose/demo/src/main/res/values/strings.xml b/core/ui/compose/demo/src/main/res/values/strings.xml new file mode 100644 index 000000000..bba4303e1 --- /dev/null +++ b/core/ui/compose/demo/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + K-9 Compose Demo + diff --git a/core/ui/compose/demo/src/main/res/values/themes.xml b/core/ui/compose/demo/src/main/res/values/themes.xml new file mode 100644 index 000000000..e49a72c03 --- /dev/null +++ b/core/ui/compose/demo/src/main/res/values/themes.xml @@ -0,0 +1,4 @@ + + +