Skip to content

Commit e88c35b

Browse files
Initial commit
0 parents  commit e88c35b

Some content is hidden

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

52 files changed

+1648
-0
lines changed

.fleet/receipt.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Project generated by Kotlin Multiplatform Wizard
2+
{
3+
"spec": {
4+
"template_id": "kmt",
5+
"targets": {
6+
"android": {
7+
"ui": [
8+
"compose"
9+
]
10+
},
11+
"ios": {
12+
"ui": [
13+
"compose"
14+
]
15+
},
16+
"desktop": {
17+
"ui": [
18+
"compose"
19+
]
20+
}
21+
}
22+
},
23+
"timestamp": "2024-11-05T17:24:59.743052635Z"
24+
}

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.iml
2+
.kotlin
3+
.gradle
4+
**/build/
5+
xcuserdata
6+
!src/**/build/
7+
local.properties
8+
.idea
9+
.DS_Store
10+
captures
11+
.externalNativeBuild
12+
.cxx
13+
*.xcodeproj/*
14+
!*.xcodeproj/project.pbxproj
15+
!*.xcodeproj/xcshareddata/
16+
!*.xcodeproj/project.xcworkspace/
17+
!*.xcworkspace/contents.xcworkspacedata
18+
**/xcshareddata/WorkspaceSettings.xcsettings

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
This is a Kotlin Multiplatform project targeting Android, iOS, Desktop.
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.compose.compiler) apply false
7+
alias(libs.plugins.jetbrainsCompose) apply false
8+
alias(libs.plugins.kotlinMultiplatform) apply false
9+
}

composeApp/build.gradle.kts

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
2+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
5+
plugins {
6+
alias(libs.plugins.kotlinMultiplatform)
7+
alias(libs.plugins.androidApplication)
8+
alias(libs.plugins.jetbrainsCompose)
9+
alias(libs.plugins.compose.compiler)
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+
jvm("desktop")
32+
33+
sourceSets {
34+
val desktopMain by getting
35+
36+
androidMain.dependencies {
37+
implementation(compose.preview)
38+
implementation(libs.androidx.activity.compose)
39+
40+
implementation(libs.koin.android)
41+
implementation(libs.koin.androidx.compose)
42+
implementation(libs.ktor.client.okhttp)
43+
}
44+
commonMain.dependencies {
45+
implementation(compose.runtime)
46+
implementation(compose.foundation)
47+
implementation(compose.material)
48+
implementation(compose.ui)
49+
implementation(compose.components.resources)
50+
implementation(compose.components.uiToolingPreview)
51+
implementation(libs.androidx.lifecycle.viewmodel)
52+
implementation(libs.androidx.lifecycle.runtime.compose)
53+
54+
implementation(libs.androidx.lifecycle.viewmodel)
55+
implementation(libs.androidx.lifecycle.runtime.compose)
56+
implementation(libs.jetbrains.compose.navigation)
57+
implementation(libs.kotlinx.serialization.json)
58+
implementation(libs.androidx.room.runtime)
59+
implementation(libs.sqlite.bundled)
60+
implementation(libs.koin.compose)
61+
implementation(libs.koin.compose.viewmodel)
62+
api(libs.koin.core)
63+
64+
implementation(libs.bundles.ktor)
65+
implementation(libs.bundles.coil)
66+
}
67+
desktopMain.dependencies {
68+
implementation(compose.desktop.currentOs)
69+
implementation(libs.kotlinx.coroutines.swing)
70+
implementation(libs.ktor.client.okhttp)
71+
}
72+
nativeMain.dependencies {
73+
implementation(libs.ktor.client.darwin)
74+
}
75+
}
76+
}
77+
78+
android {
79+
namespace = "com.plcoding.bookpedia"
80+
compileSdk = libs.versions.android.compileSdk.get().toInt()
81+
82+
defaultConfig {
83+
applicationId = "com.plcoding.bookpedia"
84+
minSdk = libs.versions.android.minSdk.get().toInt()
85+
targetSdk = libs.versions.android.targetSdk.get().toInt()
86+
versionCode = 1
87+
versionName = "1.0"
88+
}
89+
packaging {
90+
resources {
91+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
92+
}
93+
}
94+
buildTypes {
95+
getByName("release") {
96+
isMinifyEnabled = false
97+
}
98+
}
99+
compileOptions {
100+
sourceCompatibility = JavaVersion.VERSION_11
101+
targetCompatibility = JavaVersion.VERSION_11
102+
}
103+
}
104+
105+
dependencies {
106+
debugImplementation(compose.uiTooling)
107+
}
108+
109+
compose.desktop {
110+
application {
111+
mainClass = "com.plcoding.bookpedia.MainKt"
112+
113+
nativeDistributions {
114+
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
115+
packageName = "com.plcoding.bookpedia"
116+
packageVersion = "1.0.0"
117+
}
118+
}
119+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:icon="@mipmap/ic_launcher"
7+
android:label="@string/app_name"
8+
android:roundIcon="@mipmap/ic_launcher_round"
9+
android:supportsRtl="true"
10+
android:theme="@android:style/Theme.Material.Light.NoActionBar">
11+
<activity
12+
android:exported="true"
13+
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"
14+
android:name=".MainActivity">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.plcoding.bookpedia
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.plcoding.bookpedia
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,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)