├── .editorconfig ├── .github ├── CLEAN_README.md └── workflows │ ├── build-android.yml │ ├── build-ios.yml │ └── template-cleanup.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle.kts ├── composeApp ├── build.gradle.kts └── src │ ├── androidMain │ ├── AndroidManifest.xml │ ├── kotlin │ │ └── com │ │ │ └── jetbrains │ │ │ └── kmpapp │ │ │ ├── MainActivity.kt │ │ │ └── MuseumApp.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ └── strings.xml │ ├── commonMain │ ├── composeResources │ │ └── values │ │ │ └── strings.xml │ └── kotlin │ │ └── com │ │ └── jetbrains │ │ └── kmpapp │ │ ├── App.kt │ │ ├── data │ │ ├── MuseumApi.kt │ │ ├── MuseumObject.kt │ │ ├── MuseumRepository.kt │ │ └── MuseumStorage.kt │ │ ├── di │ │ └── Koin.kt │ │ └── screens │ │ ├── EmptyScreenContent.kt │ │ ├── detail │ │ ├── DetailScreen.kt │ │ └── DetailViewModel.kt │ │ └── list │ │ ├── ListScreen.kt │ │ └── ListViewModel.kt │ └── iosMain │ └── kotlin │ └── com │ └── jetbrains │ └── kmpapp │ └── MainViewController.kt ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images └── screenshots.png ├── iosApp ├── Configuration │ └── Config.xcconfig ├── iosApp.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── iosApp │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ └── app-icon-1024.png │ └── Contents.json │ ├── ContentView.swift │ ├── Info.plist │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ └── iOSApp.swift ├── list.json └── settings.gradle.kts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | ij_kotlin_name_count_to_use_star_import = 2147483647 5 | -------------------------------------------------------------------------------- /.github/CLEAN_README.md: -------------------------------------------------------------------------------- 1 | # Kotlin Multiplatform app template 2 | 3 | This is a basic Kotlin Multiplatform app template for Android and iOS. It includes shared business logic and data handling, and a shared UI implementation using Compose Multiplatform. 4 | -------------------------------------------------------------------------------- /.github/workflows/build-android.yml: -------------------------------------------------------------------------------- 1 | name: Build Android app 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | test: 11 | name: Build 12 | runs-on: macOS-latest 13 | # Only run build in template repo 14 | if: github.event.repository.name == 'KMP-App-Template' && github.repository_owner == 'Kotlin' 15 | steps: 16 | - name: Check out code 17 | uses: actions/checkout@v4 18 | - name: Set up JDK 21 19 | uses: actions/setup-java@v4 20 | with: 21 | distribution: 'zulu' 22 | java-version: 21 23 | - name: Android debug build 24 | run: ./gradlew assembleDebug --stacktrace 25 | -------------------------------------------------------------------------------- /.github/workflows/build-ios.yml: -------------------------------------------------------------------------------- 1 | name: Build iOS app 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | test: 11 | name: Build 12 | runs-on: macOS-latest 13 | # Only run build in template repo 14 | if: github.event.repository.name == 'KMP-App-Template' && github.repository_owner == 'Kotlin' 15 | steps: 16 | - name: Check out code 17 | uses: actions/checkout@v4 18 | - name: Set up JDK 21 19 | uses: actions/setup-java@v4 20 | with: 21 | distribution: 'zulu' 22 | java-version: 21 23 | - name: Set Xcode version 24 | run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer 25 | - name: iOS debug build 26 | run: cd iosApp && xcodebuild -scheme iosApp -configuration Debug -destination 'platform=iOS Simulator,OS=latest,name=iPhone 16' CODE_SIGNING_ALLOWED='NO' 27 | -------------------------------------------------------------------------------- /.github/workflows/template-cleanup.yml: -------------------------------------------------------------------------------- 1 | # GitHub Actions Workflow responsible for cleaning up the template repository from 2 | # template-specific files. This workflow is supposed to be triggered automatically 3 | # when a new template-based repository has been created. 4 | 5 | name: Template Cleanup 6 | on: 7 | push: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | # Run cleaning process only if workflow is triggered by the non-Kotlin/KMP-App-Template repository. 13 | template-cleanup: 14 | name: Template Cleanup 15 | runs-on: ubuntu-latest 16 | if: github.event.repository.name != 'KMP-App-Template' || github.repository_owner != 'Kotlin' 17 | permissions: 18 | contents: write 19 | steps: 20 | - name: Fetch Sources 21 | uses: actions/checkout@v2 22 | 23 | - name: Cleanup 24 | run: | 25 | mv .github/CLEAN_README.md README.md 26 | rm LICENSE 27 | rm -rf .github 28 | 29 | - name: Commit files 30 | run: | 31 | git config --local user.email "action@github.com" 32 | git config --local user.name "GitHub Action" 33 | git add . 34 | git commit -m "Clean up template" 35 | 36 | - name: Push changes 37 | uses: ad-m/github-push-action@master 38 | with: 39 | branch: main 40 | github_token: ${{ secrets.GITHUB_TOKEN }} 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2023 JetBrains s.r.o. and respective authors and developers. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kotlin Multiplatform app template 2 | 3 | [![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) 4 | [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 5 | 6 | This is a basic Kotlin Multiplatform app template for Android and iOS. It includes shared business logic and data handling, and a shared UI implementation using Compose Multiplatform. 7 | 8 | > The template is also available [with native UI written in Jetpack Compose and SwiftUI](https://github.com/kotlin/KMP-App-Template-Native). 9 | > 10 | > The [`amper` branch](https://github.com/Kotlin/KMP-App-Template/tree/amper) showcases the same project configured with [Amper](https://github.com/JetBrains/amper). 11 | 12 | ![Screenshots of the app](images/screenshots.png) 13 | 14 | ### Technologies 15 | 16 | The data displayed by the app is from [The Metropolitan Museum of Art Collection API](https://metmuseum.github.io/). 17 | 18 | The app uses the following multiplatform dependencies in its implementation: 19 | 20 | - [Compose Multiplatform](https://jb.gg/compose) for UI 21 | - [Compose Navigation](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-navigation-routing.html) 22 | - [Ktor](https://ktor.io/) for networking 23 | - [kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) for JSON handling 24 | - [Coil](https://github.com/coil-kt/coil) for image loading 25 | - [Koin](https://github.com/InsertKoinIO/koin) for dependency injection 26 | 27 | > These are just some of the possible libraries to use for these tasks with Kotlin Multiplatform, and their usage here isn't a strong recommendation for these specific libraries over the available alternatives. You can find a wide variety of curated multiplatform libraries in the [kmp-awesome](https://github.com/terrakok/kmp-awesome) repository. 28 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.androidApplication) apply false 3 | alias(libs.plugins.composeCompiler) apply false 4 | alias(libs.plugins.composeMultiplatform) apply false 5 | alias(libs.plugins.kotlinMultiplatform) apply false 6 | alias(libs.plugins.kotlinxSerialization) apply false 7 | } 8 | -------------------------------------------------------------------------------- /composeApp/build.gradle.kts: -------------------------------------------------------------------------------- 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.kotlinxSerialization) 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 | androidMain.dependencies { 33 | implementation(libs.androidx.compose.ui.tooling.preview) 34 | implementation(libs.androidx.activity.compose) 35 | implementation(libs.ktor.client.okhttp) 36 | } 37 | iosMain.dependencies { 38 | implementation(libs.ktor.client.darwin) 39 | } 40 | commonMain.dependencies { 41 | implementation(compose.runtime) 42 | implementation(compose.foundation) 43 | implementation(compose.material3) 44 | implementation(compose.ui) 45 | implementation(compose.components.resources) 46 | implementation(compose.components.uiToolingPreview) 47 | 48 | implementation(libs.navigation.compose) 49 | implementation(libs.lifecycle.runtime.compose) 50 | implementation(libs.material.icons.core) 51 | 52 | implementation(libs.ktor.client.core) 53 | implementation(libs.ktor.client.content.negotiation) 54 | implementation(libs.ktor.serialization.kotlinx.json) 55 | 56 | implementation(libs.coil.compose) 57 | implementation(libs.coil.network.ktor) 58 | implementation(libs.koin.core) 59 | implementation(libs.koin.compose.viewmodel) 60 | } 61 | } 62 | } 63 | 64 | android { 65 | namespace = "com.jetbrains.kmpapp" 66 | compileSdk = 35 67 | 68 | defaultConfig { 69 | applicationId = "com.jetbrains.kmpapp" 70 | minSdk = 24 71 | targetSdk = 35 72 | versionCode = 1 73 | versionName = "1.0" 74 | } 75 | packaging { 76 | resources { 77 | excludes += "/META-INF/{AL2.0,LGPL2.1}" 78 | } 79 | } 80 | buildTypes { 81 | getByName("release") { 82 | isMinifyEnabled = false 83 | } 84 | } 85 | compileOptions { 86 | sourceCompatibility = JavaVersion.VERSION_11 87 | targetCompatibility = JavaVersion.VERSION_11 88 | } 89 | } 90 | 91 | dependencies { 92 | debugImplementation(libs.androidx.compose.ui.tooling) 93 | } 94 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/kotlin/com/jetbrains/kmpapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import androidx.activity.enableEdgeToEdge 7 | import androidx.compose.foundation.isSystemInDarkTheme 8 | import androidx.compose.runtime.LaunchedEffect 9 | 10 | class MainActivity : ComponentActivity() { 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | enableEdgeToEdge() 14 | setContent { 15 | // Remove when https://issuetracker.google.com/issues/364713509 is fixed 16 | LaunchedEffect(isSystemInDarkTheme()) { 17 | enableEdgeToEdge() 18 | } 19 | App() 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/kotlin/com/jetbrains/kmpapp/MuseumApp.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp 2 | 3 | import android.app.Application 4 | import com.jetbrains.kmpapp.di.initKoin 5 | 6 | class MuseumApp : Application() { 7 | override fun onCreate() { 8 | super.onCreate() 9 | initKoin() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /composeApp/src/androidMain/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | KMP App 3 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/composeResources/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Title 4 | Artist 5 | Date 6 | Dimensions 7 | Medium 8 | Department 9 | Repository 10 | Credits 11 | 12 | Back 13 | 14 | No data available 15 | 16 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/App.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp 2 | 3 | import androidx.compose.foundation.isSystemInDarkTheme 4 | import androidx.compose.material3.MaterialTheme 5 | import androidx.compose.material3.Surface 6 | import androidx.compose.material3.darkColorScheme 7 | import androidx.compose.material3.lightColorScheme 8 | import androidx.compose.runtime.Composable 9 | import androidx.navigation.NavHostController 10 | import androidx.navigation.compose.NavHost 11 | import androidx.navigation.compose.composable 12 | import androidx.navigation.compose.rememberNavController 13 | import androidx.navigation.toRoute 14 | import com.jetbrains.kmpapp.screens.detail.DetailScreen 15 | import com.jetbrains.kmpapp.screens.list.ListScreen 16 | import kotlinx.serialization.Serializable 17 | 18 | @Serializable 19 | object ListDestination 20 | 21 | @Serializable 22 | data class DetailDestination(val objectId: Int) 23 | 24 | @Composable 25 | fun App() { 26 | MaterialTheme( 27 | colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme() 28 | ) { 29 | Surface { 30 | val navController: NavHostController = rememberNavController() 31 | NavHost(navController = navController, startDestination = ListDestination) { 32 | composable { 33 | ListScreen(navigateToDetails = { objectId -> 34 | navController.navigate(DetailDestination(objectId)) 35 | }) 36 | } 37 | composable { backStackEntry -> 38 | DetailScreen( 39 | objectId = backStackEntry.toRoute().objectId, 40 | navigateBack = { 41 | navController.popBackStack() 42 | } 43 | ) 44 | } 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/data/MuseumApi.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.data 2 | 3 | import io.ktor.client.HttpClient 4 | import io.ktor.client.call.body 5 | import io.ktor.client.request.get 6 | import io.ktor.utils.io.CancellationException 7 | 8 | interface MuseumApi { 9 | suspend fun getData(): List 10 | } 11 | 12 | class KtorMuseumApi(private val client: HttpClient) : MuseumApi { 13 | companion object { 14 | private const val API_URL = 15 | "https://raw.githubusercontent.com/Kotlin/KMP-App-Template/main/list.json" 16 | } 17 | 18 | override suspend fun getData(): List { 19 | return try { 20 | client.get(API_URL).body() 21 | } catch (e: Exception) { 22 | if (e is CancellationException) throw e 23 | e.printStackTrace() 24 | 25 | emptyList() 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/data/MuseumObject.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.data 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | data class MuseumObject( 7 | val objectID: Int, 8 | val title: String, 9 | val artistDisplayName: String, 10 | val medium: String, 11 | val dimensions: String, 12 | val objectURL: String, 13 | val objectDate: String, 14 | val primaryImage: String, 15 | val primaryImageSmall: String, 16 | val repository: String, 17 | val department: String, 18 | val creditLine: String, 19 | ) 20 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/data/MuseumRepository.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.data 2 | 3 | import kotlinx.coroutines.CoroutineScope 4 | import kotlinx.coroutines.SupervisorJob 5 | import kotlinx.coroutines.flow.Flow 6 | import kotlinx.coroutines.launch 7 | 8 | class MuseumRepository( 9 | private val museumApi: MuseumApi, 10 | private val museumStorage: MuseumStorage, 11 | ) { 12 | private val scope = CoroutineScope(SupervisorJob()) 13 | 14 | fun initialize() { 15 | scope.launch { 16 | refresh() 17 | } 18 | } 19 | 20 | suspend fun refresh() { 21 | museumStorage.saveObjects(museumApi.getData()) 22 | } 23 | 24 | fun getObjects(): Flow> = museumStorage.getObjects() 25 | 26 | fun getObjectById(objectId: Int): Flow = museumStorage.getObjectById(objectId) 27 | } 28 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/data/MuseumStorage.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.data 2 | 3 | import kotlinx.coroutines.flow.Flow 4 | import kotlinx.coroutines.flow.MutableStateFlow 5 | import kotlinx.coroutines.flow.map 6 | 7 | interface MuseumStorage { 8 | suspend fun saveObjects(newObjects: List) 9 | 10 | fun getObjectById(objectId: Int): Flow 11 | 12 | fun getObjects(): Flow> 13 | } 14 | 15 | class InMemoryMuseumStorage : MuseumStorage { 16 | private val storedObjects = MutableStateFlow(emptyList()) 17 | 18 | override suspend fun saveObjects(newObjects: List) { 19 | storedObjects.value = newObjects 20 | } 21 | 22 | override fun getObjectById(objectId: Int): Flow { 23 | return storedObjects.map { objects -> 24 | objects.find { it.objectID == objectId } 25 | } 26 | } 27 | 28 | override fun getObjects(): Flow> = storedObjects 29 | } 30 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/di/Koin.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.di 2 | 3 | import com.jetbrains.kmpapp.data.InMemoryMuseumStorage 4 | import com.jetbrains.kmpapp.data.KtorMuseumApi 5 | import com.jetbrains.kmpapp.data.MuseumApi 6 | import com.jetbrains.kmpapp.data.MuseumRepository 7 | import com.jetbrains.kmpapp.data.MuseumStorage 8 | import com.jetbrains.kmpapp.screens.detail.DetailViewModel 9 | import com.jetbrains.kmpapp.screens.list.ListViewModel 10 | import io.ktor.client.HttpClient 11 | import io.ktor.client.plugins.contentnegotiation.ContentNegotiation 12 | import io.ktor.http.ContentType 13 | import io.ktor.serialization.kotlinx.json.json 14 | import kotlinx.serialization.json.Json 15 | import org.koin.core.context.startKoin 16 | import org.koin.core.module.dsl.factoryOf 17 | import org.koin.dsl.module 18 | 19 | val dataModule = module { 20 | single { 21 | val json = Json { ignoreUnknownKeys = true } 22 | HttpClient { 23 | install(ContentNegotiation) { 24 | // TODO Fix API so it serves application/json 25 | json(json, contentType = ContentType.Any) 26 | } 27 | } 28 | } 29 | 30 | single { KtorMuseumApi(get()) } 31 | single { InMemoryMuseumStorage() } 32 | single { 33 | MuseumRepository(get(), get()).apply { 34 | initialize() 35 | } 36 | } 37 | } 38 | 39 | val viewModelModule = module { 40 | factoryOf(::ListViewModel) 41 | factoryOf(::DetailViewModel) 42 | } 43 | 44 | fun initKoin() { 45 | startKoin { 46 | modules( 47 | dataModule, 48 | viewModelModule, 49 | ) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/EmptyScreenContent.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.screens 2 | 3 | import androidx.compose.foundation.layout.Box 4 | import androidx.compose.material3.Text 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.ui.Alignment 7 | import androidx.compose.ui.Modifier 8 | import kmp_app_template.composeapp.generated.resources.Res 9 | import kmp_app_template.composeapp.generated.resources.no_data_available 10 | import org.jetbrains.compose.resources.ExperimentalResourceApi 11 | import org.jetbrains.compose.resources.stringResource 12 | 13 | @OptIn(ExperimentalResourceApi::class) 14 | @Composable 15 | fun EmptyScreenContent( 16 | modifier: Modifier = Modifier, 17 | ) { 18 | Box( 19 | modifier = modifier, 20 | contentAlignment = Alignment.Center, 21 | ) { 22 | Text(stringResource(Res.string.no_data_available)) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/detail/DetailScreen.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.screens.detail 2 | 3 | import androidx.compose.animation.AnimatedContent 4 | import androidx.compose.foundation.background 5 | import androidx.compose.foundation.layout.Column 6 | import androidx.compose.foundation.layout.Spacer 7 | import androidx.compose.foundation.layout.WindowInsets 8 | import androidx.compose.foundation.layout.fillMaxSize 9 | import androidx.compose.foundation.layout.fillMaxWidth 10 | import androidx.compose.foundation.layout.height 11 | import androidx.compose.foundation.layout.padding 12 | import androidx.compose.foundation.layout.systemBars 13 | import androidx.compose.foundation.layout.windowInsetsPadding 14 | import androidx.compose.foundation.rememberScrollState 15 | import androidx.compose.foundation.text.selection.SelectionContainer 16 | import androidx.compose.foundation.verticalScroll 17 | import androidx.compose.material.icons.Icons 18 | import androidx.compose.material.icons.automirrored.filled.ArrowBack 19 | import androidx.compose.material3.ExperimentalMaterial3Api 20 | import androidx.compose.material3.Icon 21 | import androidx.compose.material3.IconButton 22 | import androidx.compose.material3.MaterialTheme 23 | import androidx.compose.material3.Scaffold 24 | import androidx.compose.material3.Text 25 | import androidx.compose.material3.TopAppBar 26 | import androidx.compose.runtime.Composable 27 | import androidx.compose.runtime.getValue 28 | import androidx.compose.ui.Modifier 29 | import androidx.compose.ui.graphics.Color 30 | import androidx.compose.ui.layout.ContentScale 31 | import androidx.compose.ui.text.SpanStyle 32 | import androidx.compose.ui.text.buildAnnotatedString 33 | import androidx.compose.ui.text.font.FontWeight 34 | import androidx.compose.ui.text.withStyle 35 | import androidx.compose.ui.unit.dp 36 | import androidx.lifecycle.compose.collectAsStateWithLifecycle 37 | import coil3.compose.AsyncImage 38 | import com.jetbrains.kmpapp.data.MuseumObject 39 | import com.jetbrains.kmpapp.screens.EmptyScreenContent 40 | import kmp_app_template.composeapp.generated.resources.Res 41 | import kmp_app_template.composeapp.generated.resources.back 42 | import kmp_app_template.composeapp.generated.resources.label_artist 43 | import kmp_app_template.composeapp.generated.resources.label_credits 44 | import kmp_app_template.composeapp.generated.resources.label_date 45 | import kmp_app_template.composeapp.generated.resources.label_department 46 | import kmp_app_template.composeapp.generated.resources.label_dimensions 47 | import kmp_app_template.composeapp.generated.resources.label_medium 48 | import kmp_app_template.composeapp.generated.resources.label_repository 49 | import kmp_app_template.composeapp.generated.resources.label_title 50 | import org.jetbrains.compose.resources.stringResource 51 | import org.koin.compose.viewmodel.koinViewModel 52 | 53 | @Composable 54 | fun DetailScreen( 55 | objectId: Int, 56 | navigateBack: () -> Unit, 57 | ) { 58 | val viewModel = koinViewModel() 59 | 60 | val obj by viewModel.getObject(objectId).collectAsStateWithLifecycle(initialValue = null) 61 | AnimatedContent(obj != null) { objectAvailable -> 62 | if (objectAvailable) { 63 | ObjectDetails(obj!!, onBackClick = navigateBack) 64 | } else { 65 | EmptyScreenContent(Modifier.fillMaxSize()) 66 | } 67 | } 68 | } 69 | 70 | @Composable 71 | private fun ObjectDetails( 72 | obj: MuseumObject, 73 | onBackClick: () -> Unit, 74 | modifier: Modifier = Modifier, 75 | ) { 76 | Scaffold( 77 | topBar = { 78 | @OptIn(ExperimentalMaterial3Api::class) 79 | TopAppBar( 80 | title = {}, 81 | navigationIcon = { 82 | IconButton(onClick = onBackClick) { 83 | Icon(Icons.AutoMirrored.Filled.ArrowBack, stringResource(Res.string.back)) 84 | } 85 | } 86 | ) 87 | }, 88 | modifier = modifier.windowInsetsPadding(WindowInsets.systemBars), 89 | ) { paddingValues -> 90 | Column( 91 | Modifier 92 | .verticalScroll(rememberScrollState()) 93 | .padding(paddingValues) 94 | ) { 95 | AsyncImage( 96 | model = obj.primaryImageSmall, 97 | contentDescription = obj.title, 98 | contentScale = ContentScale.FillWidth, 99 | modifier = Modifier 100 | .fillMaxWidth() 101 | .background(Color.LightGray) 102 | ) 103 | 104 | SelectionContainer { 105 | Column(Modifier.padding(12.dp)) { 106 | Text(obj.title, style = MaterialTheme.typography.headlineMedium) 107 | Spacer(Modifier.height(6.dp)) 108 | LabeledInfo(stringResource(Res.string.label_title), obj.title) 109 | LabeledInfo(stringResource(Res.string.label_artist), obj.artistDisplayName) 110 | LabeledInfo(stringResource(Res.string.label_date), obj.objectDate) 111 | LabeledInfo(stringResource(Res.string.label_dimensions), obj.dimensions) 112 | LabeledInfo(stringResource(Res.string.label_medium), obj.medium) 113 | LabeledInfo(stringResource(Res.string.label_department), obj.department) 114 | LabeledInfo(stringResource(Res.string.label_repository), obj.repository) 115 | LabeledInfo(stringResource(Res.string.label_credits), obj.creditLine) 116 | } 117 | } 118 | } 119 | } 120 | } 121 | 122 | @Composable 123 | private fun LabeledInfo( 124 | label: String, 125 | data: String, 126 | modifier: Modifier = Modifier, 127 | ) { 128 | Column(modifier.padding(vertical = 4.dp)) { 129 | Spacer(Modifier.height(6.dp)) 130 | Text( 131 | buildAnnotatedString { 132 | withStyle(style = SpanStyle(fontWeight = FontWeight.Bold)) { 133 | append("$label: ") 134 | } 135 | append(data) 136 | } 137 | ) 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/detail/DetailViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.screens.detail 2 | 3 | import androidx.lifecycle.ViewModel 4 | import com.jetbrains.kmpapp.data.MuseumObject 5 | import com.jetbrains.kmpapp.data.MuseumRepository 6 | import kotlinx.coroutines.flow.Flow 7 | 8 | class DetailViewModel(private val museumRepository: MuseumRepository) : ViewModel() { 9 | fun getObject(objectId: Int): Flow = 10 | museumRepository.getObjectById(objectId) 11 | } 12 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/list/ListScreen.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.screens.list 2 | 3 | import androidx.compose.animation.AnimatedContent 4 | import androidx.compose.foundation.background 5 | import androidx.compose.foundation.clickable 6 | import androidx.compose.foundation.layout.Column 7 | import androidx.compose.foundation.layout.Spacer 8 | import androidx.compose.foundation.layout.WindowInsets 9 | import androidx.compose.foundation.layout.asPaddingValues 10 | import androidx.compose.foundation.layout.aspectRatio 11 | import androidx.compose.foundation.layout.fillMaxSize 12 | import androidx.compose.foundation.layout.fillMaxWidth 13 | import androidx.compose.foundation.layout.height 14 | import androidx.compose.foundation.layout.padding 15 | import androidx.compose.foundation.layout.safeDrawing 16 | import androidx.compose.foundation.lazy.grid.GridCells 17 | import androidx.compose.foundation.lazy.grid.LazyVerticalGrid 18 | import androidx.compose.foundation.lazy.grid.items 19 | import androidx.compose.material3.MaterialTheme 20 | import androidx.compose.material3.Text 21 | import androidx.compose.runtime.Composable 22 | import androidx.compose.runtime.getValue 23 | import androidx.compose.ui.Modifier 24 | import androidx.compose.ui.graphics.Color 25 | import androidx.compose.ui.layout.ContentScale 26 | import androidx.compose.ui.unit.dp 27 | import androidx.lifecycle.compose.collectAsStateWithLifecycle 28 | import coil3.compose.AsyncImage 29 | import com.jetbrains.kmpapp.data.MuseumObject 30 | import com.jetbrains.kmpapp.screens.EmptyScreenContent 31 | import org.koin.compose.viewmodel.koinViewModel 32 | 33 | @Composable 34 | fun ListScreen( 35 | navigateToDetails: (objectId: Int) -> Unit 36 | ) { 37 | val viewModel = koinViewModel() 38 | val objects by viewModel.objects.collectAsStateWithLifecycle() 39 | 40 | AnimatedContent(objects.isNotEmpty()) { objectsAvailable -> 41 | if (objectsAvailable) { 42 | ObjectGrid( 43 | objects = objects, 44 | onObjectClick = navigateToDetails, 45 | ) 46 | } else { 47 | EmptyScreenContent(Modifier.fillMaxSize()) 48 | } 49 | } 50 | } 51 | 52 | @Composable 53 | private fun ObjectGrid( 54 | objects: List, 55 | onObjectClick: (Int) -> Unit, 56 | modifier: Modifier = Modifier, 57 | ) { 58 | LazyVerticalGrid( 59 | columns = GridCells.Adaptive(180.dp), 60 | modifier = modifier.fillMaxSize(), 61 | contentPadding = WindowInsets.safeDrawing.asPaddingValues(), 62 | ) { 63 | items(objects, key = { it.objectID }) { obj -> 64 | ObjectFrame( 65 | obj = obj, 66 | onClick = { onObjectClick(obj.objectID) }, 67 | ) 68 | } 69 | } 70 | } 71 | 72 | @Composable 73 | private fun ObjectFrame( 74 | obj: MuseumObject, 75 | onClick: () -> Unit, 76 | modifier: Modifier = Modifier, 77 | ) { 78 | Column( 79 | modifier 80 | .padding(8.dp) 81 | .clickable { onClick() } 82 | ) { 83 | AsyncImage( 84 | model = obj.primaryImageSmall, 85 | contentDescription = obj.title, 86 | contentScale = ContentScale.Crop, 87 | modifier = Modifier 88 | .fillMaxWidth() 89 | .aspectRatio(1f) 90 | .background(Color.LightGray), 91 | ) 92 | 93 | Spacer(Modifier.height(2.dp)) 94 | 95 | Text(obj.title, style = MaterialTheme.typography.titleMedium) 96 | Text(obj.artistDisplayName, style = MaterialTheme.typography.bodyMedium) 97 | Text(obj.objectDate, style = MaterialTheme.typography.bodySmall) 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/list/ListViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp.screens.list 2 | 3 | import androidx.lifecycle.ViewModel 4 | import androidx.lifecycle.viewModelScope 5 | import com.jetbrains.kmpapp.data.MuseumObject 6 | import com.jetbrains.kmpapp.data.MuseumRepository 7 | import kotlinx.coroutines.flow.SharingStarted 8 | import kotlinx.coroutines.flow.StateFlow 9 | import kotlinx.coroutines.flow.stateIn 10 | 11 | class ListViewModel(museumRepository: MuseumRepository) : ViewModel() { 12 | val objects: StateFlow> = 13 | museumRepository.getObjects() 14 | .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), emptyList()) 15 | } 16 | -------------------------------------------------------------------------------- /composeApp/src/iosMain/kotlin/com/jetbrains/kmpapp/MainViewController.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.kmpapp 2 | 3 | import androidx.compose.ui.window.ComposeUIViewController 4 | 5 | fun MainViewController() = ComposeUIViewController { App() } 6 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | kotlin.daemon.jvmargs=-Xmx2048M 3 | 4 | #Gradle 5 | org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 6 | 7 | #Android 8 | android.nonTransitiveRClass=true 9 | android.useAndroidX=true 10 | -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | agp = "8.9.2" 3 | androidx-activityCompose = "1.10.1" 4 | androidx-ui-tooling = "1.7.8" 5 | coil = "3.2.0" 6 | compose-multiplatform = "1.8.0" 7 | koin = "4.1.0-Beta11" 8 | kotlin = "2.1.21" 9 | ktor = "3.1.3" 10 | materialIconsCore = "1.7.3" 11 | navigationCompose = "2.9.0-beta01" 12 | lifecycleCompose = "2.9.0-beta01" 13 | 14 | [libraries] 15 | androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } 16 | androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-ui-tooling" } 17 | androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-ui-tooling" } 18 | coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil" } 19 | coil-network-ktor = { group = "io.coil-kt.coil3", name = "coil-network-ktor3", version.ref = "coil" } 20 | koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koin" } 21 | koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } 22 | ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } 23 | ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } 24 | ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } 25 | ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } 26 | ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } 27 | lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycleCompose" } 28 | material-icons-core = { module = "org.jetbrains.compose.material:material-icons-core", version.ref = "materialIconsCore" } 29 | navigation-compose = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "navigationCompose" } 30 | 31 | [plugins] 32 | androidApplication = { id = "com.android.application", version.ref = "agp" } 33 | composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } 34 | composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" } 35 | kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } 36 | kotlinxSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } 37 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | if ! command -v java >/dev/null 2>&1 137 | then 138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 139 | 140 | Please set the JAVA_HOME variable in your environment to match the 141 | location of your Java installation." 142 | fi 143 | fi 144 | 145 | # Increase the maximum file descriptors if we can. 146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 147 | case $MAX_FD in #( 148 | max*) 149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 150 | # shellcheck disable=SC2039,SC3045 151 | MAX_FD=$( ulimit -H -n ) || 152 | warn "Could not query maximum file descriptor limit" 153 | esac 154 | case $MAX_FD in #( 155 | '' | soft) :;; #( 156 | *) 157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 158 | # shellcheck disable=SC2039,SC3045 159 | ulimit -n "$MAX_FD" || 160 | warn "Could not set maximum file descriptor limit to $MAX_FD" 161 | esac 162 | fi 163 | 164 | # Collect all arguments for the java command, stacking in reverse order: 165 | # * args from the command line 166 | # * the main class name 167 | # * -classpath 168 | # * -D...appname settings 169 | # * --module-path (only if needed) 170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 171 | 172 | # For Cygwin or MSYS, switch paths to Windows format before running java 173 | if "$cygwin" || "$msys" ; then 174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 176 | 177 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 178 | 179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 180 | for arg do 181 | if 182 | case $arg in #( 183 | -*) false ;; # don't mess with options #( 184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 185 | [ -e "$t" ] ;; #( 186 | *) false ;; 187 | esac 188 | then 189 | arg=$( cygpath --path --ignore --mixed "$arg" ) 190 | fi 191 | # Roll the args list around exactly as many times as the number of 192 | # args, so each arg winds up back in the position where it started, but 193 | # possibly modified. 194 | # 195 | # NB: a `for` loop captures its iteration list before it begins, so 196 | # changing the positional parameters here affects neither the number of 197 | # iterations, nor the values presented in `arg`. 198 | shift # remove old arg 199 | set -- "$@" "$arg" # push replacement arg 200 | done 201 | fi 202 | 203 | 204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 206 | 207 | # Collect all arguments for the java command: 208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 209 | # and any embedded shellness will be escaped. 210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 211 | # treated as '${Hostname}' itself on the command line. 212 | 213 | set -- \ 214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 215 | -classpath "$CLASSPATH" \ 216 | org.gradle.wrapper.GradleWrapperMain \ 217 | "$@" 218 | 219 | # Stop when "xargs" is not available. 220 | if ! command -v xargs >/dev/null 2>&1 221 | then 222 | die "xargs is not available" 223 | fi 224 | 225 | # Use "xargs" to parse quoted args. 226 | # 227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 228 | # 229 | # In Bash we could simply go: 230 | # 231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 232 | # set -- "${ARGS[@]}" "$@" 233 | # 234 | # but POSIX shell has neither arrays nor command substitution, so instead we 235 | # post-process each arg (as a line of input to sed) to backslash-escape any 236 | # character that might be a shell metacharacter, then use eval to reverse 237 | # that process (while maintaining the separation between arguments), and wrap 238 | # the whole thing up as a single "set" statement. 239 | # 240 | # This will of course break if any of these variables contains a newline or 241 | # an unmatched quote. 242 | # 243 | 244 | eval "set -- $( 245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 246 | xargs -n1 | 247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 248 | tr '\n' ' ' 249 | )" '"$@"' 250 | 251 | exec "$JAVACMD" "$@" 252 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /images/screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/images/screenshots.png -------------------------------------------------------------------------------- /iosApp/Configuration/Config.xcconfig: -------------------------------------------------------------------------------- 1 | TEAM_ID= 2 | BUNDLE_ID=com.jetbrains.kmpapp.KMP-App-Template 3 | APP_NAME=KMP App -------------------------------------------------------------------------------- /iosApp/iosApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; }; 11 | 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; }; 12 | 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; 13 | 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 18 | 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 19 | 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; 20 | 7555FF7B242A565900829871 /* KMP App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "KMP App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 22 | 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; 24 | /* End PBXFileReference section */ 25 | 26 | /* Begin PBXFrameworksBuildPhase section */ 27 | B92378962B6B1156000C7307 /* Frameworks */ = { 28 | isa = PBXFrameworksBuildPhase; 29 | buildActionMask = 2147483647; 30 | files = ( 31 | ); 32 | runOnlyForDeploymentPostprocessing = 0; 33 | }; 34 | /* End PBXFrameworksBuildPhase section */ 35 | 36 | /* Begin PBXGroup section */ 37 | 058557D7273AAEEB004C7B11 /* Preview Content */ = { 38 | isa = PBXGroup; 39 | children = ( 40 | 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, 41 | ); 42 | path = "Preview Content"; 43 | sourceTree = ""; 44 | }; 45 | 42799AB246E5F90AF97AA0EF /* Frameworks */ = { 46 | isa = PBXGroup; 47 | children = ( 48 | ); 49 | name = Frameworks; 50 | sourceTree = ""; 51 | }; 52 | 7555FF72242A565900829871 = { 53 | isa = PBXGroup; 54 | children = ( 55 | AB1DB47929225F7C00F7AF9C /* Configuration */, 56 | 7555FF7D242A565900829871 /* iosApp */, 57 | 7555FF7C242A565900829871 /* Products */, 58 | 42799AB246E5F90AF97AA0EF /* Frameworks */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | 7555FF7C242A565900829871 /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 7555FF7B242A565900829871 /* KMP App.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | 7555FF7D242A565900829871 /* iosApp */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 058557BA273AAA24004C7B11 /* Assets.xcassets */, 74 | 7555FF82242A565900829871 /* ContentView.swift */, 75 | 7555FF8C242A565B00829871 /* Info.plist */, 76 | 2152FB032600AC8F00CF470E /* iOSApp.swift */, 77 | 058557D7273AAEEB004C7B11 /* Preview Content */, 78 | ); 79 | path = iosApp; 80 | sourceTree = ""; 81 | }; 82 | AB1DB47929225F7C00F7AF9C /* Configuration */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | AB3632DC29227652001CCB65 /* Config.xcconfig */, 86 | ); 87 | path = Configuration; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | 7555FF7A242A565900829871 /* iosApp */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; 96 | buildPhases = ( 97 | F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */, 98 | 7555FF77242A565900829871 /* Sources */, 99 | B92378962B6B1156000C7307 /* Frameworks */, 100 | 7555FF79242A565900829871 /* Resources */, 101 | ); 102 | buildRules = ( 103 | ); 104 | dependencies = ( 105 | ); 106 | name = iosApp; 107 | packageProductDependencies = ( 108 | ); 109 | productName = iosApp; 110 | productReference = 7555FF7B242A565900829871 /* KMP App.app */; 111 | productType = "com.apple.product-type.application"; 112 | }; 113 | /* End PBXNativeTarget section */ 114 | 115 | /* Begin PBXProject section */ 116 | 7555FF73242A565900829871 /* Project object */ = { 117 | isa = PBXProject; 118 | attributes = { 119 | BuildIndependentTargetsInParallel = YES; 120 | LastSwiftUpdateCheck = 1130; 121 | LastUpgradeCheck = 1540; 122 | ORGANIZATIONNAME = orgName; 123 | TargetAttributes = { 124 | 7555FF7A242A565900829871 = { 125 | CreatedOnToolsVersion = 11.3.1; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */; 130 | compatibilityVersion = "Xcode 14.0"; 131 | developmentRegion = en; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | Base, 136 | ); 137 | mainGroup = 7555FF72242A565900829871; 138 | packageReferences = ( 139 | ); 140 | productRefGroup = 7555FF7C242A565900829871 /* Products */; 141 | projectDirPath = ""; 142 | projectRoot = ""; 143 | targets = ( 144 | 7555FF7A242A565900829871 /* iosApp */, 145 | ); 146 | }; 147 | /* End PBXProject section */ 148 | 149 | /* Begin PBXResourcesBuildPhase section */ 150 | 7555FF79242A565900829871 /* Resources */ = { 151 | isa = PBXResourcesBuildPhase; 152 | buildActionMask = 2147483647; 153 | files = ( 154 | 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */, 155 | 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXShellScriptBuildPhase section */ 162 | F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */ = { 163 | isa = PBXShellScriptBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | ); 167 | inputFileListPaths = ( 168 | ); 169 | inputPaths = ( 170 | ); 171 | name = "Compile Kotlin Framework"; 172 | outputFileListPaths = ( 173 | ); 174 | outputPaths = ( 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | shellPath = /bin/sh; 178 | shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n"; 179 | }; 180 | /* End PBXShellScriptBuildPhase section */ 181 | 182 | /* Begin PBXSourcesBuildPhase section */ 183 | 7555FF77242A565900829871 /* Sources */ = { 184 | isa = PBXSourcesBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, 188 | 7555FF83242A565900829871 /* ContentView.swift in Sources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXSourcesBuildPhase section */ 193 | 194 | /* Begin XCBuildConfiguration section */ 195 | 7555FFA3242A565B00829871 /* Debug */ = { 196 | isa = XCBuildConfiguration; 197 | baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; 198 | buildSettings = { 199 | ALWAYS_SEARCH_USER_PATHS = NO; 200 | CLANG_ANALYZER_NONNULL = YES; 201 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 202 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 203 | CLANG_CXX_LIBRARY = "libc++"; 204 | CLANG_ENABLE_MODULES = YES; 205 | CLANG_ENABLE_OBJC_ARC = YES; 206 | CLANG_ENABLE_OBJC_WEAK = YES; 207 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 208 | CLANG_WARN_BOOL_CONVERSION = YES; 209 | CLANG_WARN_COMMA = YES; 210 | CLANG_WARN_CONSTANT_CONVERSION = YES; 211 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 212 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 213 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 214 | CLANG_WARN_EMPTY_BODY = YES; 215 | CLANG_WARN_ENUM_CONVERSION = YES; 216 | CLANG_WARN_INFINITE_RECURSION = YES; 217 | CLANG_WARN_INT_CONVERSION = YES; 218 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 219 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 220 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 221 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 222 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 223 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 224 | CLANG_WARN_STRICT_PROTOTYPES = YES; 225 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 226 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 227 | CLANG_WARN_UNREACHABLE_CODE = YES; 228 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 229 | COPY_PHASE_STRIP = NO; 230 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 231 | ENABLE_STRICT_OBJC_MSGSEND = YES; 232 | ENABLE_TESTABILITY = YES; 233 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 234 | GCC_C_LANGUAGE_STANDARD = gnu11; 235 | GCC_DYNAMIC_NO_PIC = NO; 236 | GCC_NO_COMMON_BLOCKS = YES; 237 | GCC_OPTIMIZATION_LEVEL = 0; 238 | GCC_PREPROCESSOR_DEFINITIONS = ( 239 | "DEBUG=1", 240 | "$(inherited)", 241 | ); 242 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 243 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 244 | GCC_WARN_UNDECLARED_SELECTOR = YES; 245 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 246 | GCC_WARN_UNUSED_FUNCTION = YES; 247 | GCC_WARN_UNUSED_VARIABLE = YES; 248 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 249 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 250 | MTL_FAST_MATH = YES; 251 | ONLY_ACTIVE_ARCH = YES; 252 | SDKROOT = iphoneos; 253 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 254 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 255 | }; 256 | name = Debug; 257 | }; 258 | 7555FFA4242A565B00829871 /* Release */ = { 259 | isa = XCBuildConfiguration; 260 | baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_ANALYZER_NONNULL = YES; 264 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 265 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 266 | CLANG_CXX_LIBRARY = "libc++"; 267 | CLANG_ENABLE_MODULES = YES; 268 | CLANG_ENABLE_OBJC_ARC = YES; 269 | CLANG_ENABLE_OBJC_WEAK = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INFINITE_RECURSION = YES; 280 | CLANG_WARN_INT_CONVERSION = YES; 281 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 282 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 283 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 284 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 285 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 286 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 287 | CLANG_WARN_STRICT_PROTOTYPES = YES; 288 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 289 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 290 | CLANG_WARN_UNREACHABLE_CODE = YES; 291 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 292 | COPY_PHASE_STRIP = NO; 293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 294 | ENABLE_NS_ASSERTIONS = NO; 295 | ENABLE_STRICT_OBJC_MSGSEND = YES; 296 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 297 | GCC_C_LANGUAGE_STANDARD = gnu11; 298 | GCC_NO_COMMON_BLOCKS = YES; 299 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 300 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 301 | GCC_WARN_UNDECLARED_SELECTOR = YES; 302 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 303 | GCC_WARN_UNUSED_FUNCTION = YES; 304 | GCC_WARN_UNUSED_VARIABLE = YES; 305 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 306 | MTL_ENABLE_DEBUG_INFO = NO; 307 | MTL_FAST_MATH = YES; 308 | SDKROOT = iphoneos; 309 | SWIFT_COMPILATION_MODE = wholemodule; 310 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 311 | VALIDATE_PRODUCT = YES; 312 | }; 313 | name = Release; 314 | }; 315 | 7555FFA6242A565B00829871 /* Debug */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 319 | CODE_SIGN_IDENTITY = "Apple Development"; 320 | CODE_SIGN_STYLE = Automatic; 321 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; 322 | DEVELOPMENT_TEAM = "${TEAM_ID}"; 323 | ENABLE_PREVIEWS = YES; 324 | FRAMEWORK_SEARCH_PATHS = ( 325 | "$(inherited)", 326 | "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", 327 | ); 328 | INFOPLIST_FILE = iosApp/Info.plist; 329 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 330 | LD_RUNPATH_SEARCH_PATHS = ( 331 | "$(inherited)", 332 | "@executable_path/Frameworks", 333 | ); 334 | PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; 335 | PRODUCT_NAME = "${APP_NAME}"; 336 | PROVISIONING_PROFILE_SPECIFIER = ""; 337 | SWIFT_VERSION = 5.0; 338 | TARGETED_DEVICE_FAMILY = "1,2"; 339 | }; 340 | name = Debug; 341 | }; 342 | 7555FFA7242A565B00829871 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 346 | CODE_SIGN_IDENTITY = "Apple Development"; 347 | CODE_SIGN_STYLE = Automatic; 348 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; 349 | DEVELOPMENT_TEAM = "${TEAM_ID}"; 350 | ENABLE_PREVIEWS = YES; 351 | FRAMEWORK_SEARCH_PATHS = ( 352 | "$(inherited)", 353 | "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", 354 | ); 355 | INFOPLIST_FILE = iosApp/Info.plist; 356 | IPHONEOS_DEPLOYMENT_TARGET = 15.3; 357 | LD_RUNPATH_SEARCH_PATHS = ( 358 | "$(inherited)", 359 | "@executable_path/Frameworks", 360 | ); 361 | PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; 362 | PRODUCT_NAME = "${APP_NAME}"; 363 | PROVISIONING_PROFILE_SPECIFIER = ""; 364 | SWIFT_VERSION = 5.0; 365 | TARGETED_DEVICE_FAMILY = "1,2"; 366 | }; 367 | name = Release; 368 | }; 369 | /* End XCBuildConfiguration section */ 370 | 371 | /* Begin XCConfigurationList section */ 372 | 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | 7555FFA3242A565B00829871 /* Debug */, 376 | 7555FFA4242A565B00829871 /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = { 382 | isa = XCConfigurationList; 383 | buildConfigurations = ( 384 | 7555FFA6242A565B00829871 /* Debug */, 385 | 7555FFA7242A565B00829871 /* Release */, 386 | ); 387 | defaultConfigurationIsVisible = 0; 388 | defaultConfigurationName = Release; 389 | }; 390 | /* End XCConfigurationList section */ 391 | }; 392 | rootObject = 7555FF73242A565900829871 /* Project object */; 393 | } 394 | -------------------------------------------------------------------------------- /iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "app-icon-1024.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/KMP-App-Template/1dcd4310bdd018a1f8df9dc4b1a2fbd98c7ac42e/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } -------------------------------------------------------------------------------- /iosApp/iosApp/ContentView.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SwiftUI 3 | import ComposeApp 4 | 5 | struct ComposeView: UIViewControllerRepresentable { 6 | func makeUIViewController(context: Context) -> UIViewController { 7 | MainViewControllerKt.MainViewController() 8 | } 9 | 10 | func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} 11 | } 12 | 13 | struct ContentView: View { 14 | var body: some View { 15 | ComposeView() 16 | .ignoresSafeArea() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /iosApp/iosApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | CADisableMinimumFrameDurationOnPhone 24 | 25 | UIApplicationSceneManifest 26 | 27 | UIApplicationSupportsMultipleScenes 28 | 29 | 30 | UILaunchScreen 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } -------------------------------------------------------------------------------- /iosApp/iosApp/iOSApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import ComposeApp 3 | 4 | @main 5 | struct iOSApp: App { 6 | init() { 7 | KoinKt.doInitKoin() 8 | } 9 | 10 | var body: some Scene { 11 | WindowGroup { 12 | ContentView() 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /list.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "objectID": 436535, 4 | "title": "Wheat Field with Cypresses", 5 | "artistDisplayName": "Vincent van Gogh", 6 | "medium": "Oil on canvas", 7 | "dimensions": "28 7/8 × 36 3/4 in. (73.2 × 93.4 cm)", 8 | "objectURL": "https://www.metmuseum.org/art/collection/search/436535", 9 | "objectDate": "1889", 10 | "primaryImage": "https://images.metmuseum.org/CRDImages/ep/original/DT1567.jpg", 11 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ep/web-large/DT1567.jpg", 12 | "repository": "Metropolitan Museum of Art, New York, NY", 13 | "department": "European Paintings", 14 | "creditLine": "Purchase, The Annenberg Foundation Gift, 1993" 15 | }, 16 | { 17 | "objectID": 11207, 18 | "title": "The Flower Girl", 19 | "artistDisplayName": "Charles Cromwell Ingham", 20 | "medium": "Oil on canvas", 21 | "dimensions": "36 x 28 3/8 in. (91.4 x 72.1 cm)", 22 | "objectURL": "https://www.metmuseum.org/art/collection/search/11207", 23 | "objectDate": "1846", 24 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT2784.jpg", 25 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT2784.jpg", 26 | "repository": "Metropolitan Museum of Art, New York, NY", 27 | "department": "The American Wing", 28 | "creditLine": "Gift of William Church Osborn, 1902" 29 | }, 30 | { 31 | "objectID": 202192, 32 | "title": "Potpourri vase (pot-pourri gondole)", 33 | "artistDisplayName": "Sèvres Manufactory", 34 | "medium": "Soft-paste porcelain decorated in polychrome enamels, gold", 35 | "dimensions": "Overall, body with lid (confirmed): 12 3/16 x 14 1/4 x 7 3/4 in. (31 x 36.2 x 19.7 cm); Overall, base (confirmed): 2 5/16 x 9 x 5 1/4 in. (5.9 x 22.9 x 13.3 cm); Height assembled (confirmed): 14 1/8 in. (35.9 cm)", 36 | "objectURL": "https://www.metmuseum.org/art/collection/search/202192", 37 | "objectDate": "1757", 38 | "primaryImage": "https://images.metmuseum.org/CRDImages/es/original/DP149951.jpg", 39 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/es/web-large/DP149951.jpg", 40 | "repository": "Metropolitan Museum of Art, New York, NY", 41 | "department": "European Sculpture and Decorative Arts", 42 | "creditLine": "Gift of Samuel H. Kress Foundation, 1958" 43 | }, 44 | { 45 | "objectID": 11227, 46 | "title": "Autumn Oaks", 47 | "artistDisplayName": "George Inness", 48 | "medium": "Oil on canvas", 49 | "dimensions": "20 3/8 x 30 1/8 in. (54.3 x 76.5 cm)", 50 | "objectURL": "https://www.metmuseum.org/art/collection/search/11227", 51 | "objectDate": "ca. 1878", 52 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT264804.jpg", 53 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT264804.jpg", 54 | "repository": "Metropolitan Museum of Art, New York, NY", 55 | "department": "The American Wing", 56 | "creditLine": "Gift of George I. Seney, 1887" 57 | }, 58 | { 59 | "objectID": 11120, 60 | "title": "Fishing Boats, Key West", 61 | "artistDisplayName": "Winslow Homer", 62 | "medium": "Watercolor and graphite on off-white wove paper", 63 | "dimensions": "13 15/16 x 21 3/4 in. (35.4 x 55.2 cm)\r\nFramed: 24 1/2 x 30 1/2 in. (62.2 x 77.5 cm)", 64 | "objectURL": "https://www.metmuseum.org/art/collection/search/11120", 65 | "objectDate": "1903", 66 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DP119111.jpg", 67 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DP119111.jpg", 68 | "repository": "Metropolitan Museum of Art, New York, NY", 69 | "department": "The American Wing", 70 | "creditLine": "Amelia B. Lazarus Fund, 1910" 71 | }, 72 | { 73 | "objectID": 436532, 74 | "title": "Self-Portrait with a Straw Hat (obverse: The Potato Peeler)", 75 | "artistDisplayName": "Vincent van Gogh", 76 | "medium": "Oil on canvas", 77 | "dimensions": "16 x 12 1/2 in. (40.6 x 31.8 cm)", 78 | "objectURL": "https://www.metmuseum.org/art/collection/search/436532", 79 | "objectDate": "1887", 80 | "primaryImage": "https://images.metmuseum.org/CRDImages/ep/original/DT1502_cropped2.jpg", 81 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ep/web-large/DT1502_cropped2.jpg", 82 | "repository": "Metropolitan Museum of Art, New York, NY", 83 | "department": "European Paintings", 84 | "creditLine": "Bequest of Miss Adelaide Milton de Groot (1876-1967), 1967" 85 | }, 86 | { 87 | "objectID": 438817, 88 | "title": "The Dance Class", 89 | "artistDisplayName": "Edgar Degas", 90 | "medium": "Oil on canvas", 91 | "dimensions": "32 7/8 x 30 3/8 in. (83.5 x 77.2 cm)", 92 | "objectURL": "https://www.metmuseum.org/art/collection/search/438817", 93 | "objectDate": "1874", 94 | "primaryImage": "https://images.metmuseum.org/CRDImages/ep/original/DP-20101-001.jpg", 95 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ep/web-large/DP-20101-001.jpg", 96 | "repository": "Metropolitan Museum of Art, New York, NY", 97 | "department": "European Paintings", 98 | "creditLine": "Bequest of Mrs. Harry Payne Bingham, 1986" 99 | }, 100 | { 101 | "objectID": 10997, 102 | "title": "Still Life—Violin and Music", 103 | "artistDisplayName": "William Michael Harnett", 104 | "medium": "Oil on canvas", 105 | "dimensions": "40 x 30 in. (101.6 x 76.2 cm)", 106 | "objectURL": "https://www.metmuseum.org/art/collection/search/10997", 107 | "objectDate": "1888", 108 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT2046.jpg", 109 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT2046.jpg", 110 | "repository": "Metropolitan Museum of Art, New York, NY", 111 | "department": "The American Wing", 112 | "creditLine": "Catharine Lorillard Wolfe Collection, Wolfe Fund, 1963" 113 | }, 114 | { 115 | "objectID": 436528, 116 | "title": "Irises", 117 | "artistDisplayName": "Vincent van Gogh", 118 | "medium": "Oil on canvas", 119 | "dimensions": "29 x 36 1/4 in. (73.7 x 92.1 cm)", 120 | "objectURL": "https://www.metmuseum.org/art/collection/search/436528", 121 | "objectDate": "1890", 122 | "primaryImage": "https://images.metmuseum.org/CRDImages/ep/original/DP346474.jpg", 123 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ep/web-large/DP346474.jpg", 124 | "repository": "Metropolitan Museum of Art, New York, NY", 125 | "department": "European Paintings", 126 | "creditLine": "Gift of Adele R. Levy, 1958" 127 | }, 128 | { 129 | "objectID": 13137, 130 | "title": "The Indian Hunter", 131 | "artistDisplayName": "John Quincy Adams Ward", 132 | "medium": "Bronze", 133 | "dimensions": "16 1/8 x 10 1/2 x 15 1/4 in. (41 x 26.7 x 38.7 cm)", 134 | "objectURL": "https://www.metmuseum.org/art/collection/search/13137", 135 | "objectDate": "1860, cast by 1883", 136 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DP259785.jpg", 137 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DP259785.jpg", 138 | "repository": "Metropolitan Museum of Art, New York, NY", 139 | "department": "The American Wing", 140 | "creditLine": "Morris K. Jesup Fund, 1973" 141 | }, 142 | { 143 | "objectID": 11619, 144 | "title": "Cider Making", 145 | "artistDisplayName": "William Sidney Mount", 146 | "medium": "Oil on canvas", 147 | "dimensions": "27 x 34 1/8 in. (68.6 x 86.7 cm)", 148 | "objectURL": "https://www.metmuseum.org/art/collection/search/11619", 149 | "objectDate": "1840–41", 150 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT72.jpg", 151 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT72.jpg", 152 | "repository": "Metropolitan Museum of Art, New York, NY", 153 | "department": "The American Wing", 154 | "creditLine": "Purchase, Bequest of Charles Allen Munn, by exchange, 1966" 155 | }, 156 | { 157 | "objectID": 11737, 158 | "title": "Still Life with Cake", 159 | "artistDisplayName": "Raphaelle Peale", 160 | "medium": "Oil on wood", 161 | "dimensions": "10 3/4 x 15 1/4 in. (27.3 x 38.7 cm)", 162 | "objectURL": "https://www.metmuseum.org/art/collection/search/11737", 163 | "objectDate": "1818", 164 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT64.jpg", 165 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT64.jpg", 166 | "repository": "Metropolitan Museum of Art, New York, NY", 167 | "department": "The American Wing", 168 | "creditLine": "Maria DeWitt Jesup Fund, 1959" 169 | }, 170 | { 171 | "objectID": 503046, 172 | "title": "Grand Pianoforte", 173 | "artistDisplayName": "Érard", 174 | "medium": "Satinwood veneer, oak, spruce, iron, steel, ebony, ivory, gilding, mother-of-pearl, holly, mahogany, burl walnut, tulipwood, silver wire", 175 | "dimensions": "Height (Total): 37 1/2 in. (95.3 cm)\r\nWidth (Of case, perpendicular to keyboard): 97 1/4 in. (247 cm)\r\nDepth (Of case, parallel to keyboard): 58 7/8 in. (149.5 cm)", 176 | "objectURL": "https://www.metmuseum.org/art/collection/search/503046", 177 | "objectDate": "ca. 1840", 178 | "primaryImage": "https://images.metmuseum.org/CRDImages/mi/original/DP225545.jpg", 179 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/mi/web-large/DP225545.jpg", 180 | "repository": "Metropolitan Museum of Art, New York, NY", 181 | "department": "Musical Instruments", 182 | "creditLine": "Gift of Mrs. Henry McSweeney, 1959" 183 | }, 184 | { 185 | "objectID": 503219, 186 | "title": "Division Viol", 187 | "artistDisplayName": "Richard Meares", 188 | "medium": "Spruce, ebony, maple", 189 | "dimensions": "Height: 46 1/16 in. (117 cm)\r\nWidth (At lower bout): 14 3/4 in. (37.4 cm)\r\nDepth (At bottom block): 5 in. (12.7 cm)", 190 | "objectURL": "https://www.metmuseum.org/art/collection/search/503219", 191 | "objectDate": "ca. 1680", 192 | "primaryImage": "https://images.metmuseum.org/CRDImages/mi/original/DP331229.jpg", 193 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/mi/web-large/DP331229.jpg", 194 | "repository": "Metropolitan Museum of Art, New York, NY", 195 | "department": "Musical Instruments", 196 | "creditLine": "Purchase, Louis V. Bell Fund, Mrs. Vincent Astor Gift, and funds from various donors, 1982" 197 | }, 198 | { 199 | "objectID": 11396, 200 | "title": "Stage Fort across Gloucester Harbor", 201 | "artistDisplayName": "Fitz Henry Lane (formerly Fitz Hugh Lane)", 202 | "medium": "Oil on canvas", 203 | "dimensions": "38 x 60 in. (96.5 x 152.4 cm)", 204 | "objectURL": "https://www.metmuseum.org/art/collection/search/11396", 205 | "objectDate": "1862", 206 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT5586.jpg", 207 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT5586.jpg", 208 | "repository": "Metropolitan Museum of Art, New York, NY", 209 | "department": "The American Wing", 210 | "creditLine": "Purchase, Rogers and Fletcher Funds, Erving and Joyce Wolf Fund, Raymond J. Horowitz Gift, Bequest of Richard De Wolfe Brixey, by exchange, and John Osgood and Elizabeth Amis Cameron Blanchard Memorial Fund, 1978" 211 | }, 212 | { 213 | "objectID": 738466, 214 | "title": "Modern chromatics : with applications to art and industry", 215 | "artistDisplayName": "Ogden Nicholas Rood", 216 | "medium": "", 217 | "dimensions": "3 pages, 1 leaf, [v]-viii, [9]-329 pages : color frontispiece, illustrations, diagrams ; Height: 7 7/8 in. (20 cm)", 218 | "objectURL": "https://www.metmuseum.org/art/collection/search/738466", 219 | "objectDate": "1879", 220 | "primaryImage": "https://images.metmuseum.org/CRDImages/li/original/b1100612_001.jpg", 221 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/li/web-large/b1100612_001.jpg", 222 | "repository": "Metropolitan Museum of Art, New York, NY", 223 | "department": "The Libraries", 224 | "creditLine": "" 225 | }, 226 | { 227 | "objectID": 437299, 228 | "title": "Jalais Hill, Pontoise", 229 | "artistDisplayName": "Camille Pissarro", 230 | "medium": "Oil on canvas", 231 | "dimensions": "34 1/4 x 45 1/4 in. (87 x 114.9 cm)", 232 | "objectURL": "https://www.metmuseum.org/art/collection/search/437299", 233 | "objectDate": "1867", 234 | "primaryImage": "https://images.metmuseum.org/CRDImages/ep/original/DT1859.jpg", 235 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ep/web-large/DT1859.jpg", 236 | "repository": "Metropolitan Museum of Art, New York, NY", 237 | "department": "European Paintings", 238 | "creditLine": "Bequest of William Church Osborn, 1951" 239 | }, 240 | { 241 | "objectID": 506174, 242 | "title": "Kettle Drums", 243 | "artistDisplayName": "Franz Peter Bundsen", 244 | "medium": "Silver, iron, calfskin, textiles, gilding,", 245 | "dimensions": "2010.138.1: 16 1/2 × 23 × 23 in., 52.9 lb. (41.9 × 58.4 × 58.4 cm, 24 kg)\r\n2010.138.2: 16 3/4 × 24 1/2 × 24 1/2 in. (42.5 × 62.2 × 62.2 cm)", 246 | "objectURL": "https://www.metmuseum.org/art/collection/search/506174", 247 | "objectDate": "1780", 248 | "primaryImage": "https://images.metmuseum.org/CRDImages/mi/original/DP229625.jpg", 249 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/mi/web-large/DP229625.jpg", 250 | "repository": "Metropolitan Museum of Art, New York, NY", 251 | "department": "Musical Instruments", 252 | "creditLine": "Purchase, Robert Alonzo Lehman Bequest, Acquisitions Fund, and Frederick M. Lehman Bequest, 2010" 253 | }, 254 | { 255 | "objectID": 11311, 256 | "title": "Lake George", 257 | "artistDisplayName": "John Frederick Kensett", 258 | "medium": "Oil on canvas", 259 | "dimensions": "44 1/8 x 66 3/8 in. (112.1 x 168.6 cm)", 260 | "objectURL": "https://www.metmuseum.org/art/collection/search/11311", 261 | "objectDate": "1869", 262 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT84.jpg", 263 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT84.jpg", 264 | "repository": "Metropolitan Museum of Art, New York, NY", 265 | "department": "The American Wing", 266 | "creditLine": "Bequest of Maria DeWitt Jesup, from the collection of her husband, Morris K. Jesup, 1914" 267 | }, 268 | { 269 | "objectID": 250551, 270 | "title": "Terracotta neck-amphora (jar) with lid and knob (27.16)", 271 | "artistDisplayName": "Exekias", 272 | "medium": "Terracotta", 273 | "dimensions": "H. 18 1/2 in. (47 cm)\r\ndiameter 9 3/4 in. (24.8 cm)", 274 | "objectURL": "https://www.metmuseum.org/art/collection/search/250551", 275 | "objectDate": "ca. 540 BCE", 276 | "primaryImage": "https://images.metmuseum.org/CRDImages/gr/original/DP218568.jpg", 277 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/gr/web-large/DP218568.jpg", 278 | "repository": "Metropolitan Museum of Art, New York, NY", 279 | "department": "Greek and Roman Art", 280 | "creditLine": "Rogers Fund, 1917" 281 | }, 282 | { 283 | "objectID": 14931, 284 | "title": "A Rose", 285 | "artistDisplayName": "Thomas Anshutz", 286 | "medium": "Oil on canvas", 287 | "dimensions": "58 x 43 7/8 in. (147.3 x 111.4 cm)", 288 | "objectURL": "https://www.metmuseum.org/art/collection/search/14931", 289 | "objectDate": "1907", 290 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT104.jpg", 291 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT104.jpg", 292 | "repository": "Metropolitan Museum of Art, New York, NY", 293 | "department": "The American Wing", 294 | "creditLine": "Marguerite and Frank A. Cosgrove Jr. Fund, 1993" 295 | }, 296 | { 297 | "objectID": 436323, 298 | "title": "Marie Emilie Coignet de Courson (1716–1806) with a Dog", 299 | "artistDisplayName": "Jean Honoré Fragonard", 300 | "medium": "Oil on canvas", 301 | "dimensions": "32 x 25 3/4 in. (81.3 x 65.4 cm)", 302 | "objectURL": "https://www.metmuseum.org/art/collection/search/436323", 303 | "objectDate": "ca. 1769", 304 | "primaryImage": "https://images.metmuseum.org/CRDImages/ep/original/DP-1019-01.jpg", 305 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ep/web-large/DP-1019-01.jpg", 306 | "repository": "Metropolitan Museum of Art, New York, NY", 307 | "department": "European Paintings", 308 | "creditLine": "Fletcher Fund, 1937" 309 | }, 310 | { 311 | "objectID": 459028, 312 | "title": "Portrait of Alvise Contarini(?); (verso) A Tethered Roebuck", 313 | "artistDisplayName": "Jacometto (Jacometto Veneziano)", 314 | "medium": "Oil on wood; verso: oil and gold on wood", 315 | "dimensions": "Overall 4 5/8 x 3 3/8 in. ; recto, painted surface 4 1/8 x 3 1/8 in.; verso, painted surface 4 3/8 x 3 1/8 in.", 316 | "objectURL": "https://www.metmuseum.org/art/collection/search/459028", 317 | "objectDate": "ca. 1485–95", 318 | "primaryImage": "https://images.metmuseum.org/CRDImages/rl/original/DP221485.jpg", 319 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/rl/web-large/DP221485.jpg", 320 | "repository": "Metropolitan Museum of Art, New York, NY", 321 | "department": "Robert Lehman Collection", 322 | "creditLine": "Robert Lehman Collection, 1975" 323 | }, 324 | { 325 | "objectID": 10481, 326 | "title": "Heart of the Andes", 327 | "artistDisplayName": "Frederic Edwin Church", 328 | "medium": "Oil on canvas", 329 | "dimensions": "66 1/8 x 120 3/16 in. (168 x 302.9cm)", 330 | "objectURL": "https://www.metmuseum.org/art/collection/search/10481", 331 | "objectDate": "1859", 332 | "primaryImage": "https://images.metmuseum.org/CRDImages/ad/original/DT78.jpg", 333 | "primaryImageSmall": "https://images.metmuseum.org/CRDImages/ad/web-large/DT78.jpg", 334 | "repository": "Metropolitan Museum of Art, New York, NY", 335 | "department": "The American Wing", 336 | "creditLine": "Bequest of Margaret E. Dows, 1909" 337 | } 338 | ] 339 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "KMP-App-Template" 2 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 3 | 4 | pluginManagement { 5 | repositories { 6 | google { 7 | mavenContent { 8 | includeGroupAndSubgroups("androidx") 9 | includeGroupAndSubgroups("com.android") 10 | includeGroupAndSubgroups("com.google") 11 | } 12 | } 13 | mavenCentral() 14 | gradlePluginPortal() 15 | } 16 | } 17 | 18 | dependencyResolutionManagement { 19 | repositories { 20 | google { 21 | mavenContent { 22 | includeGroupAndSubgroups("androidx") 23 | includeGroupAndSubgroups("com.android") 24 | includeGroupAndSubgroups("com.google") 25 | } 26 | } 27 | mavenCentral() 28 | } 29 | } 30 | 31 | include(":composeApp") 32 | --------------------------------------------------------------------------------