diff --git a/.gitignore b/.gitignore index d5cf5977..306b1c32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .gradle/ .idea/ -build/ \ No newline at end of file +build/ +local.properties \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 5cd85a6f..45751e12 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,8 @@ plugins { kotlin("multiplatform") version "1.7.20" apply false id("org.jetbrains.compose") version "1.3.0-beta04-dev873" apply false + id("com.android.library") version "7.3.1" apply false + id("org.jetbrains.kotlin.android") version "1.7.20" apply false } group = "com.konyaco.fluent" diff --git a/example/android/.gitignore b/example/android/.gitignore new file mode 100644 index 00000000..0e855460 --- /dev/null +++ b/example/android/.gitignore @@ -0,0 +1,12 @@ +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/example/android/build.gradle.kts b/example/android/build.gradle.kts new file mode 100644 index 00000000..55793ff0 --- /dev/null +++ b/example/android/build.gradle.kts @@ -0,0 +1,52 @@ +plugins { + id("org.jetbrains.compose") + id("com.android.application") + kotlin("android") +} + +repositories { + google() + mavenCentral() +} + +android { + namespace = "com.konyaco.fluent.example" + compileSdk = 33 + defaultConfig { + applicationId = "com.konyaco.fluent.example" + minSdk = 24 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + + vectorDrawables { + useSupportLibrary = true + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + buildTypes { + getByName("release") { + isMinifyEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + /*buildFeatures { + compose = true + }*/ + packagingOptions { + resources { + excludes.add("/META-INF/{AL2.0,LGPL2.1}") + } + } +} + +dependencies { + implementation(compose.foundation) + implementation(compose.ui) + implementation(compose.uiTooling) + implementation(project(":example:common")) + implementation("androidx.activity:activity-compose:1.6.1") +} \ No newline at end of file diff --git a/example/android/proguard-rules.pro b/example/android/proguard-rules.pro new file mode 100644 index 00000000..a2d2effd --- /dev/null +++ b/example/android/proguard-rules.pro @@ -0,0 +1,20 @@ +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle.bak. +# +# 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 \ No newline at end of file diff --git a/example/android/src/androidTest/kotlin/com/konyaco/fluent/example/ExampleInstrumentedTest.kt b/example/android/src/androidTest/kotlin/com/konyaco/fluent/example/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..9b3f49f2 --- /dev/null +++ b/example/android/src/androidTest/kotlin/com/konyaco/fluent/example/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.konyaco.fluent.example + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.konyaco.fluent.example", appContext.packageName) + } +} \ No newline at end of file diff --git a/example/android/src/main/AndroidManifest.xml b/example/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..7d53be23 --- /dev/null +++ b/example/android/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/src/main/kotlin/com/konyaco/fluent/example/MainActivity.kt b/example/android/src/main/kotlin/com/konyaco/fluent/example/MainActivity.kt new file mode 100644 index 00000000..1f70d8ba --- /dev/null +++ b/example/android/src/main/kotlin/com/konyaco/fluent/example/MainActivity.kt @@ -0,0 +1,14 @@ +package com.konyaco.fluent.example + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + App() + } + } +} \ No newline at end of file diff --git a/example/android/src/main/res/drawable-v24/ic_launcher_foreground.xml b/example/android/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 00000000..2b068d11 --- /dev/null +++ b/example/android/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/src/main/res/drawable/ic_launcher_background.xml b/example/android/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..07d5da9c --- /dev/null +++ b/example/android/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/example/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/example/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/example/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/example/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/example/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/example/android/src/main/res/mipmap-hdpi/ic_launcher.webp b/example/android/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000..c209e78e Binary files /dev/null and b/example/android/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/example/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/example/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000..b2dfe3d1 Binary files /dev/null and b/example/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/example/android/src/main/res/mipmap-mdpi/ic_launcher.webp b/example/android/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000..4f0f1d64 Binary files /dev/null and b/example/android/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/example/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/example/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000..62b611da Binary files /dev/null and b/example/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/example/android/src/main/res/mipmap-xhdpi/ic_launcher.webp b/example/android/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000..948a3070 Binary files /dev/null and b/example/android/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/example/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/example/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..1b9a6956 Binary files /dev/null and b/example/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/example/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/example/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000..28d4b77f Binary files /dev/null and b/example/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/example/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/example/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..9287f508 Binary files /dev/null and b/example/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/example/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/example/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000..aa7d6427 Binary files /dev/null and b/example/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/example/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/example/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..9126ae37 Binary files /dev/null and b/example/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/example/android/src/main/res/values/colors.xml b/example/android/src/main/res/values/colors.xml new file mode 100644 index 00000000..f8c6127d --- /dev/null +++ b/example/android/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/example/android/src/main/res/values/strings.xml b/example/android/src/main/res/values/strings.xml new file mode 100644 index 00000000..6da25345 --- /dev/null +++ b/example/android/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + ComposeFluentExample + \ No newline at end of file diff --git a/example/android/src/main/res/values/themes.xml b/example/android/src/main/res/values/themes.xml new file mode 100644 index 00000000..c29ff5cc --- /dev/null +++ b/example/android/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + +