From 2b60d23a1fb49863a7cdf9b38f910d30803e3a27 Mon Sep 17 00:00:00 2001 From: neelratanguria Date: Sat, 17 Feb 2024 15:32:51 +0530 Subject: [PATCH 1/2] CMP project setup --- .../ComposeMultiplatform-Example/.gitignore | 11 + .../build.gradle.kts | 50 +++ .../src/main/AndroidManifest.xml | 17 + .../android/MainActivity.kt | 22 + .../src/main/res/values/styles.xml | 3 + .../build.gradle.kts | 17 + .../gradle.properties | 20 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + examples/ComposeMultiplatform-Example/gradlew | 185 ++++++++ .../ComposeMultiplatform-Example/gradlew.bat | 89 ++++ .../project.pbxproj | 395 ++++++++++++++++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../iosBlueFalconExampleMP/ComposeView.swift | 20 + .../iosBlueFalconExampleMP/ContentView.swift | 14 + .../iosBlueFalconExampleMP/Info.plist | 50 +++ .../Preview Assets.xcassets/Contents.json | 6 + .../iosBlueFalconExampleMP/iOSApp.swift | 10 + .../settings.gradle.kts | 35 ++ .../shared/build.gradle.kts | 105 +++++ .../presentation/BlueFalconTheme.android.kt | 50 +++ .../di/AppModule.android.kt | 12 + .../bluefalconcomposemultiplatform/App.kt | 43 ++ .../ble/BluetoothDeviceViewModel.kt | 9 + .../core/presentation/BlueFalconTheme.kt | 10 + .../di/AppModule.kt | 7 + .../ui/theme/Color.kt | 65 +++ .../ui/theme/Theme.kt | 68 +++ .../ui/theme/Type.kt | 34 ++ .../MainViewController.kt | 19 + .../core/presentation/BlueFalconTheme.ios.kt | 20 + .../di/AppModule.ios.kt | 9 + 35 files changed, 1524 insertions(+) create mode 100644 examples/ComposeMultiplatform-Example/.gitignore create mode 100644 examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/build.gradle.kts create mode 100644 examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/AndroidManifest.xml create mode 100644 examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/java/com/example/bluefalconcomposemultiplatform/android/MainActivity.kt create mode 100644 examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/res/values/styles.xml create mode 100644 examples/ComposeMultiplatform-Example/build.gradle.kts create mode 100644 examples/ComposeMultiplatform-Example/gradle.properties create mode 100644 examples/ComposeMultiplatform-Example/gradle/wrapper/gradle-wrapper.jar create mode 100644 examples/ComposeMultiplatform-Example/gradle/wrapper/gradle-wrapper.properties create mode 100755 examples/ComposeMultiplatform-Example/gradlew create mode 100644 examples/ComposeMultiplatform-Example/gradlew.bat create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP.xcodeproj/project.pbxproj create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/Assets.xcassets/Contents.json create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/ComposeView.swift create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/ContentView.swift create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/Info.plist create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 examples/ComposeMultiplatform-Example/iosBlueFalconExampleMP/iosBlueFalconExampleMP/iOSApp.swift create mode 100644 examples/ComposeMultiplatform-Example/settings.gradle.kts create mode 100644 examples/ComposeMultiplatform-Example/shared/build.gradle.kts create mode 100644 examples/ComposeMultiplatform-Example/shared/src/androidMain/kotlin/com/example/bluefalconcomposemultiplatform/core/presentation/BlueFalconTheme.android.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/androidMain/kotlin/com/example/bluefalconcomposemultiplatform/di/AppModule.android.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/commonMain/kotlin/com/example/bluefalconcomposemultiplatform/App.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/commonMain/kotlin/com/example/bluefalconcomposemultiplatform/ble/BluetoothDeviceViewModel.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/commonMain/kotlin/com/example/bluefalconcomposemultiplatform/core/presentation/BlueFalconTheme.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/commonMain/kotlin/com/example/bluefalconcomposemultiplatform/di/AppModule.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/commonMain/kotlin/com/example/bluefalconcomposemultiplatform/ui/theme/Color.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/commonMain/kotlin/com/example/bluefalconcomposemultiplatform/ui/theme/Theme.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/commonMain/kotlin/com/example/bluefalconcomposemultiplatform/ui/theme/Type.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/iosMain/kotlin/com/example/bluefalconcomposemultiplatform/MainViewController.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/iosMain/kotlin/com/example/bluefalconcomposemultiplatform/core/presentation/BlueFalconTheme.ios.kt create mode 100644 examples/ComposeMultiplatform-Example/shared/src/iosMain/kotlin/com/example/bluefalconcomposemultiplatform/di/AppModule.ios.kt diff --git a/examples/ComposeMultiplatform-Example/.gitignore b/examples/ComposeMultiplatform-Example/.gitignore new file mode 100644 index 0000000..6dddb68 --- /dev/null +++ b/examples/ComposeMultiplatform-Example/.gitignore @@ -0,0 +1,11 @@ +*.iml +.gradle +.idea +.DS_Store +build +captures +.externalNativeBuild +.cxx +local.properties +xcuserdata +iosBlueFalconExampleMP/iosBlueFalconExampleMP.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ No newline at end of file diff --git a/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/build.gradle.kts b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/build.gradle.kts new file mode 100644 index 0000000..59dea0c --- /dev/null +++ b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/build.gradle.kts @@ -0,0 +1,50 @@ +plugins { + id("com.android.application") + kotlin("android") + id("org.jetbrains.compose") +} + +android { + namespace = "com.example.bluefalconcomposemultiplatform.android" + compileSdk = 34 + defaultConfig { + applicationId = "com.example.bluefalconcomposemultiplatform.android" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.3" + } + packagingOptions { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = "17" + } +} + +dependencies { + implementation(project(":shared")) + implementation("androidx.compose.ui:ui:1.4.0") + implementation("androidx.compose.ui:ui-tooling:1.4.0") + implementation("androidx.compose.ui:ui-tooling-preview:1.4.0") + implementation("androidx.compose.foundation:foundation:1.4.0") + implementation("androidx.compose.material:material:1.4.0") + implementation("androidx.activity:activity-compose:1.7.0") +} \ No newline at end of file diff --git a/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/AndroidManifest.xml b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/AndroidManifest.xml new file mode 100644 index 0000000..22d1fac --- /dev/null +++ b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/AndroidManifest.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/java/com/example/bluefalconcomposemultiplatform/android/MainActivity.kt b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/java/com/example/bluefalconcomposemultiplatform/android/MainActivity.kt new file mode 100644 index 0000000..56b46e1 --- /dev/null +++ b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/java/com/example/bluefalconcomposemultiplatform/android/MainActivity.kt @@ -0,0 +1,22 @@ +package com.example.bluefalconcomposemultiplatform.android + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.ui.platform.LocalContext +import com.example.bluefalconcomposemultiplatform.App +import com.example.bluefalconcomposemultiplatform.di.AppModule + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + App( + darkTheme = isSystemInDarkTheme(), + dynamicColor = false, + appModule = AppModule(LocalContext.current.applicationContext) + ) + } + } +} \ No newline at end of file diff --git a/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/res/values/styles.xml b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/res/values/styles.xml new file mode 100644 index 0000000..6b4fa3d --- /dev/null +++ b/examples/ComposeMultiplatform-Example/androidBlueFalconExampleMP/src/main/res/values/styles.xml @@ -0,0 +1,3 @@ + +