Skip to content

Commit 4722d3f

Browse files
authored
Initial Commit
With this commit: Base project is developed. There might be additional improvements in future.
1 parent 31cae4f commit 4722d3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1926
-2
lines changed

README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
1-
# ComposeStarterKit
2-
This repo can be used as a good start for Compose Multiplatform. Koin added for Dependency Injection, BaseViewModel created for new project, Navigation Compose added for navigation between pages.
1+
This is a Kotlin Multiplatform project targeting Android, iOS.
2+
3+
* `/composeApp` is for code that will be shared across your Compose Multiplatform applications.
4+
It contains several subfolders:
5+
- `commonMain` is for code that’s common for all targets.
6+
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name.
7+
For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app,
8+
`iosMain` would be the right folder for such calls.
9+
10+
* `/iosApp` contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform,
11+
you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.
12+
13+
14+
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)

build.gradle.kts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
// this is necessary to avoid the plugins to be loaded multiple times
3+
// in each subproject's classloader
4+
alias(libs.plugins.androidApplication) apply false
5+
alias(libs.plugins.androidLibrary) apply false
6+
alias(libs.plugins.composeMultiplatform) apply false
7+
alias(libs.plugins.composeCompiler) apply false
8+
alias(libs.plugins.kotlinMultiplatform) apply false
9+
}

composeApp/build.gradle.kts

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
4+
plugins {
5+
alias(libs.plugins.kotlinMultiplatform)
6+
alias(libs.plugins.androidApplication)
7+
alias(libs.plugins.composeMultiplatform)
8+
alias(libs.plugins.composeCompiler)
9+
alias(libs.plugins.googleServices)
10+
}
11+
12+
kotlin {
13+
androidTarget {
14+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
15+
compilerOptions {
16+
jvmTarget.set(JvmTarget.JVM_11)
17+
}
18+
}
19+
20+
listOf(
21+
iosX64(),
22+
iosArm64(),
23+
iosSimulatorArm64()
24+
).forEach { iosTarget ->
25+
iosTarget.binaries.framework {
26+
baseName = "ComposeApp"
27+
isStatic = true
28+
}
29+
}
30+
31+
sourceSets {
32+
33+
androidMain.dependencies {
34+
implementation(compose.preview)
35+
implementation(libs.androidx.activity.compose)
36+
37+
implementation(libs.koin.android)
38+
implementation(libs.koin.androidx.compose)
39+
}
40+
commonMain.dependencies {
41+
implementation(compose.runtime)
42+
implementation(compose.foundation)
43+
implementation(compose.material)
44+
implementation(compose.ui)
45+
implementation(compose.components.resources)
46+
implementation(compose.components.uiToolingPreview)
47+
implementation(libs.androidx.lifecycle.viewmodel)
48+
implementation(libs.androidx.lifecycle.runtime.compose)
49+
50+
api(libs.koin.core)
51+
implementation(libs.koin.compose)
52+
implementation(libs.koin.compose.viewmodel)
53+
implementation(libs.lifecycle.viewmodel)
54+
implementation(libs.navigation.compose)
55+
56+
//firebase
57+
implementation(project.dependencies.platform(libs.firebase.bom.platform))
58+
implementation(libs.firebase.auth.ktx)
59+
implementation(libs.firebase.analytics)
60+
61+
62+
}
63+
}
64+
}
65+
66+
android {
67+
namespace = "com.mrkanet.thebartender"
68+
compileSdk = libs.versions.android.compileSdk.get().toInt()
69+
70+
defaultConfig {
71+
applicationId = "com.mrkanet.thebartender"
72+
minSdk = libs.versions.android.minSdk.get().toInt()
73+
targetSdk = libs.versions.android.targetSdk.get().toInt()
74+
versionCode = 1
75+
versionName = "1.0"
76+
}
77+
packaging {
78+
resources {
79+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
80+
}
81+
}
82+
buildTypes {
83+
getByName("release") {
84+
isMinifyEnabled = false
85+
}
86+
}
87+
compileOptions {
88+
sourceCompatibility = JavaVersion.VERSION_11
89+
targetCompatibility = JavaVersion.VERSION_11
90+
}
91+
}
92+
93+
dependencies {
94+
implementation(libs.firebase.auth.ktx)
95+
debugImplementation(compose.uiTooling)
96+
}
97+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:name=".BartenderAndroidApp"
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@android:style/Theme.Material.Light.NoActionBar">
12+
<activity
13+
android:name=".MainActivity"
14+
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"
15+
android:exported="true">
16+
<intent-filter>
17+
<action android:name="android.intent.action.MAIN" />
18+
19+
<category android:name="android.intent.category.LAUNCHER" />
20+
</intent-filter>
21+
</activity>
22+
</application>
23+
24+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.mrkanet.thebartender
2+
3+
import android.app.Application
4+
import com.mrkanet.thebartender.di.initKoin
5+
import org.koin.android.ext.koin.androidContext
6+
7+
class BartenderAndroidApp : Application() {
8+
override fun onCreate() {
9+
super.onCreate()
10+
initKoin {
11+
androidContext(this@BartenderAndroidApp)
12+
}
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.mrkanet.thebartender
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.compose.runtime.Composable
7+
import androidx.compose.ui.tooling.preview.Preview
8+
9+
class MainActivity : ComponentActivity() {
10+
override fun onCreate(savedInstanceState: Bundle?) {
11+
super.onCreate(savedInstanceState)
12+
13+
setContent {
14+
App()
15+
}
16+
}
17+
}
18+
19+
@Preview
20+
@Composable
21+
fun AppAndroidPreview() {
22+
App()
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.mrkanet.thebartender
2+
3+
import android.os.Build
4+
5+
class AndroidPlatform : Platform {
6+
override val name: String = "Android ${Build.VERSION.SDK_INT}"
7+
}
8+
9+
actual fun getPlatform(): Platform = AndroidPlatform()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.mrkanet.thebartender.dependencies
2+
3+
import android.content.Context
4+
5+
actual class DBClient(
6+
private val context: Context,
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.mrkanet.thebartender.di
2+
3+
import com.mrkanet.thebartender.dependencies.DBClient
4+
import org.koin.core.module.dsl.singleOf
5+
import org.koin.dsl.module
6+
7+
actual val platformModule = module {
8+
singleOf(::DBClient)
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8+
<aapt:attr name="android:fillColor">
9+
<gradient
10+
android:endX="85.84757"
11+
android:endY="92.4963"
12+
android:startX="42.9492"
13+
android:startY="49.59793"
14+
android:type="linear">
15+
<item
16+
android:color="#44000000"
17+
android:offset="0.0" />
18+
<item
19+
android:color="#00000000"
20+
android:offset="1.0" />
21+
</gradient>
22+
</aapt:attr>
23+
</path>
24+
<path
25+
android:fillColor="#FFFFFF"
26+
android:fillType="nonZero"
27+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28+
android:strokeWidth="1"
29+
android:strokeColor="#00000000" />
30+
</vector>

0 commit comments

Comments
 (0)