├── .gitignore
├── LICENSE
├── README.md
├── androidApp
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── qamar
│ │ └── composemultiplatform
│ │ └── android
│ │ ├── MainActivity.kt
│ │ └── MyApplicationTheme.kt
│ └── res
│ └── values
│ └── styles.xml
├── build.gradle.kts
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── iosApp
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Manifest.lock
│ └── Target Support Files
│ │ └── Pods-iosApp
│ │ ├── Pods-iosApp-Info.plist
│ │ ├── Pods-iosApp-acknowledgements.markdown
│ │ ├── Pods-iosApp-acknowledgements.plist
│ │ ├── Pods-iosApp-dummy.m
│ │ ├── Pods-iosApp-umbrella.h
│ │ ├── Pods-iosApp.debug.xcconfig
│ │ ├── Pods-iosApp.modulemap
│ │ └── Pods-iosApp.release.xcconfig
├── iosApp.xcodeproj
│ └── project.pbxproj
├── iosApp.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── iosApp
│ ├── Assets.xcassets
│ ├── AccentColor.colorset
│ │ └── Contents.json
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── ContentView.swift
│ ├── Info.plist
│ ├── Preview Content
│ └── Preview Assets.xcassets
│ │ └── Contents.json
│ └── iOSApp.swift
├── settings.gradle.kts
└── shared
├── build.gradle.kts
├── shared.podspec
└── src
├── androidMain
└── kotlin
│ └── com
│ └── qamar
│ └── composemultiplatform
│ └── main.android.kt
├── commonMain
├── kotlin
│ └── com
│ │ └── qamar
│ │ └── composemultiplatform
│ │ ├── App.kt
│ │ ├── components
│ │ ├── CategoryTabs.kt
│ │ ├── CircularProgress.kt
│ │ ├── CustomIndicator.kt
│ │ ├── ItemPager.kt
│ │ ├── item
│ │ │ └── TabItem.kt
│ │ └── plant
│ │ │ ├── PlantImage.kt
│ │ │ └── PlantProperty.kt
│ │ └── model
│ │ └── Plant.kt
└── resources
│ ├── Plants.png
│ ├── Plants1.jpg
│ ├── Plants2.jpg
│ ├── Plants3.jpg
│ └── Plants4.png
└── iosMain
└── kotlin
└── com
└── qamar
└── composemultiplatform
└── main.ios.kt
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | .idea
4 | .DS_Store
5 | build
6 | captures
7 | .externalNativeBuild
8 | .cxx
9 | local.properties
10 | xcuserdata
--------------------------------------------------------------------------------
/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 [yyyy] [name of copyright owner]
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.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | 
3 |
4 |
5 | # Compose Multiplatform
6 |
7 | Compose
8 |
9 | https://user-images.githubusercontent.com/30949634/236697673-dbf52629-9809-41a9-b9fd-8363ea527b99.mov
10 |
11 | Multiplatform simplifies and accelerates UI and share it between Android, IOS, Desktop and Web.
12 |
13 |
14 |
15 |
16 | # Repositroy
17 |
18 | This repository will contain instructions to start your first Compose Multiplatform Project.
19 |
20 |
21 |
22 |
23 | ## Plugin
24 |
25 | Install
26 | [KMM](https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile)
27 | plugin in Android Studio
28 |
29 | ## Instructions
30 | - Create a new KMM project using the plugin above
31 |
32 |
34 |
35 |
36 | ### Setup Compose for KMM
37 |
38 | in your `settings.gradle` file add the following dependency
39 |
40 | ```kotlin
41 | pluginManagement {
42 | repositories {
43 | google()
44 | gradlePluginPortal()
45 | mavenCentral()
46 | maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") // this one
47 | }
48 |
49 | plugins {
50 | kotlin("jvm").version("1.8.21")
51 | kotlin("multiplatform").version("1.8.21")
52 | kotlin("android").version("1.8.21")
53 | id("com.android.application").version("7.4.2")
54 | id("com.android.library").version("7.4.2")
55 | id("org.jetbrains.compose").version("1.4.3")
56 | }
57 | }
58 | ```
59 |
60 | in your `build.gradle.kts` add compose plugin
61 | ```kotlin
62 | plugins {
63 | //trick: for the same plugin versions in all sub-modules
64 | id("com.android.application").version("8.2.0-alpha06").apply(false)
65 | id("com.android.library").version("8.2.0-alpha06").apply(false)
66 | kotlin("android").version("1.8.21").apply(false)
67 | kotlin("multiplatform").version("1.8.21").apply(false)
68 | }
69 |
70 |
71 |
72 | ```
73 |
74 | now inside `shared module` `build.gradle.kts` add these two plugins
75 | ```kotlin
76 | plugins {
77 | kotlin("multiplatform")
78 | id("com.android.library")
79 | kotlin("native.cocoapods") // this
80 | id("org.jetbrains.compose") // and this
81 | }
82 |
83 | ```
84 |
85 | in your `kotlin` block add the following lines
86 | ```kotlin
87 | iosX64()
88 | iosArm64()
89 | iosSimulatorArm64()
90 | cocoapods {
91 | version = "1.0.0"
92 | summary = "Some description for the Shared Module"
93 | homepage = "Link to the Shared Module homepage"
94 | ios.deploymentTarget = "14.1"
95 | podfile = project.file("../iosApp/Podfile")
96 | framework {
97 | baseName = "shared"
98 | isStatic = true
99 | }
100 | extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" // this is for images
101 | }
102 |
103 | // in android block add these lines to support common resources
104 |
105 | sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
106 | sourceSets["main"].res.srcDirs("src/androidMain/res")
107 | sourceSets["main"].resources.srcDirs("src/commonMain/resources")
108 |
109 | ```
110 |
111 | now BEFORE you sync you need to make sure about the following:
112 |
113 | - Install cocoapods
114 | ```termial
115 | brew install cocoapods
116 |
117 | ```
118 | - cd to iosApp and init pod
119 | ```terminal
120 | pod init
121 | ```
122 | - install your pods
123 | ```terminal
124 | pod install
125 | ```
126 |
127 | In `sourceSets`
128 |
129 | ```kotlin
130 | sourceSets {
131 | val commonMain by getting {
132 | dependencies {
133 | implementation(compose.runtime)
134 | implementation(compose.foundation)
135 | implementation(compose.material)
136 | @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
137 | implementation(compose.components.resources)
138 | }
139 | }
140 | val androidMain by getting {
141 | dependencies {
142 | api("androidx.activity:activity-compose:1.6.1")
143 | api("androidx.appcompat:appcompat:1.6.1")
144 | api("androidx.core:core-ktx:1.9.0")
145 | }
146 | }
147 | val iosX64Main by getting
148 | val iosArm64Main by getting
149 | val iosSimulatorArm64Main by getting
150 | val iosMain by getting {
151 | dependsOn(commonMain)
152 | iosX64Main.dependsOn(this)
153 | iosArm64Main.dependsOn(this)
154 | iosSimulatorArm64Main.dependsOn(this)
155 | }
156 | }
157 | ```
158 |
159 | and to avoid Compose targets '[uikit]' are experimental and may have bugs! Error add this in `gradle.properties`
160 | ```groovy
161 | org.jetbrains.compose.experimental.uikit.enabled=true
162 |
163 | ```
164 |
165 | Sync now !
166 |
167 | ## Let the magic begin
168 |
169 | Inside your `shared module` commonMain directory create your first Composable function to use it for Android and IOS
170 |
171 | ```kotlin
172 | @Composable
173 | internal fun App(){
174 | Text(Greeting().greet())
175 | }
176 | ```
177 |
178 | In your `AndroidMain` make `main.android` class to use your App function
179 | ```kotlin
180 | @Composable
181 | fun Application(){
182 | App()
183 | }
184 | ```
185 |
186 |
187 | In your `IosMain` make `main.ios` class to use your App function
188 | ```kotlin
189 | import androidx.compose.ui.window.ComposeUIViewController
190 |
191 | fun MainViewController() = ComposeUIViewController { App() }
192 |
193 | ```
194 |
195 | Now go to `AndoroidApp` module to use the function we made in main.android class
196 | ```kotlin
197 | Surface(
198 | modifier = Modifier.fillMaxSize(),
199 | color = MaterialTheme.colors.background
200 | ) {
201 | Application()
202 | }
203 | ```
204 |
205 | Next go to `IosApp` module to use the function we made in main.ios class
206 |
207 |
208 | ```swift
209 | import shared // this important to import don't forget it!
210 |
211 | @main
212 | struct iOSApp: App {
213 | var body: some Scene {
214 | WindowGroup {
215 | ContentView()
216 | }
217 | }
218 | }
219 |
220 | // inside your ContentView class
221 |
222 | import SwiftUI
223 | import shared
224 |
225 | struct ComposeView: UIViewControllerRepresentable {
226 | func makeUIViewController(context: Context) -> UIViewController {
227 | Main_iosKt.MainViewController()
228 | }
229 |
230 | func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
231 | }
232 |
233 | struct ContentView: View {
234 | var body: some View {
235 | ComposeView()
236 | .ignoresSafeArea(.keyboard) // Compose has own keyboard handler
237 | }
238 | }
239 |
240 | ```
241 |
242 | ## Run
243 |
244 | Add this to solve dependencies conflicts in `gradle.properties`
245 | ```groovy
246 | kotlin.native.cacheKind=none
247 | ```
248 |
249 | now you can run your android normally, for `IOS` you need to run the following command first
250 |
251 | ```terminal
252 | ./gradlew build
253 | ./gradlew :shared:linkPodDebugFrameworkIosSimulatorArm64
254 |
255 | ```
256 |
257 | Now open `iosApp.xcworkspace` inside xcode and run the app! or Run it inside Android Studio itself
258 |
259 |
260 |
261 | ## Resources
262 |
263 | [JetBrains Compose](https://github.com/JetBrains/compose-jb/tree/master/tutorials/Getting_Started)
264 |
265 | [Compose Mutliplatofrom Examples](https://github.com/JetBrains/compose-jb/tree/master/experimental/examples)
266 |
267 | [Compose Mutliplatofrom Template](https://github.com/JetBrains/compose-multiplatform-ios-android-template)
268 |
269 |
270 |
271 |
272 |
273 |
274 | Happy Kotlin 🚀!
275 |
276 |
277 |
--------------------------------------------------------------------------------
/androidApp/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.application")
3 | kotlin("android")
4 | }
5 |
6 | android {
7 | namespace = "com.qamar.composemultiplatform.android"
8 | compileSdk = 33
9 | defaultConfig {
10 | applicationId = "com.qamar.composemultiplatform.android"
11 | minSdk = 24
12 | targetSdk = 33
13 | versionCode = 1
14 | versionName = "1.0"
15 | }
16 | buildFeatures {
17 | compose = true
18 | }
19 | composeOptions {
20 | kotlinCompilerExtensionVersion = "1.4.0"
21 | }
22 | packagingOptions {
23 | resources {
24 | excludes += "/META-INF/{AL2.0,LGPL2.1}"
25 | }
26 | }
27 | buildTypes {
28 | getByName("release") {
29 | isMinifyEnabled = false
30 | }
31 | }
32 | compileOptions {
33 | sourceCompatibility = JavaVersion.VERSION_1_8
34 | targetCompatibility = JavaVersion.VERSION_1_8
35 | }
36 | kotlinOptions {
37 | jvmTarget = "1.8"
38 | }
39 | }
40 |
41 | dependencies {
42 | implementation(project(":shared"))
43 | implementation("androidx.compose.ui:ui:1.4.3")
44 | implementation("androidx.compose.ui:ui-tooling:1.4.3")
45 | implementation("androidx.compose.ui:ui-tooling-preview:1.4.3")
46 | implementation("androidx.compose.foundation:foundation:1.4.3")
47 | implementation("androidx.compose.material:material:1.4.3")
48 | implementation("androidx.activity:activity-compose:1.7.1")
49 | }
--------------------------------------------------------------------------------
/androidApp/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/androidApp/src/main/java/com/qamar/composemultiplatform/android/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.android
2 |
3 | import android.os.Bundle
4 | import androidx.activity.ComponentActivity
5 | import androidx.activity.compose.setContent
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.material.*
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.tooling.preview.Preview
11 | import com.qamar.composemultiplatform.Application
12 |
13 | class MainActivity : ComponentActivity() {
14 | override fun onCreate(savedInstanceState: Bundle?) {
15 | super.onCreate(savedInstanceState)
16 | setContent {
17 | MyApplicationTheme {
18 | Surface(
19 | modifier = Modifier.fillMaxSize(),
20 | color = MaterialTheme.colors.background
21 | ) {
22 | Application()
23 | }
24 | }
25 | }
26 | }
27 | }
28 |
29 | @Composable
30 | fun GreetingView(text: String) {
31 | Text(text = text)
32 | }
33 |
34 | @Preview
35 | @Composable
36 | fun DefaultPreview() {
37 | MyApplicationTheme {
38 | GreetingView("Hello, Android!")
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/androidApp/src/main/java/com/qamar/composemultiplatform/android/MyApplicationTheme.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.android
2 |
3 | import androidx.compose.foundation.isSystemInDarkTheme
4 | import androidx.compose.foundation.shape.RoundedCornerShape
5 | import androidx.compose.material.MaterialTheme
6 | import androidx.compose.material.Shapes
7 | import androidx.compose.material.Typography
8 | import androidx.compose.material.darkColors
9 | import androidx.compose.material.lightColors
10 | import androidx.compose.runtime.Composable
11 | import androidx.compose.ui.graphics.Color
12 | import androidx.compose.ui.text.TextStyle
13 | import androidx.compose.ui.text.font.FontFamily
14 | import androidx.compose.ui.text.font.FontWeight
15 | import androidx.compose.ui.unit.dp
16 | import androidx.compose.ui.unit.sp
17 |
18 | @Composable
19 | fun MyApplicationTheme(
20 | darkTheme: Boolean = isSystemInDarkTheme(),
21 | content: @Composable () -> Unit
22 | ) {
23 | val colors = if (darkTheme) {
24 | darkColors(
25 | primary = Color(0xFFBB86FC),
26 | primaryVariant = Color(0xFF3700B3),
27 | secondary = Color(0xFF03DAC5)
28 | )
29 | } else {
30 | lightColors(
31 | primary = Color(0xFF6200EE),
32 | primaryVariant = Color(0xFF3700B3),
33 | secondary = Color(0xFF03DAC5)
34 | )
35 | }
36 | val typography = Typography(
37 | body1 = TextStyle(
38 | fontFamily = FontFamily.Default,
39 | fontWeight = FontWeight.Normal,
40 | fontSize = 16.sp
41 | )
42 | )
43 | val shapes = Shapes(
44 | small = RoundedCornerShape(4.dp),
45 | medium = RoundedCornerShape(4.dp),
46 | large = RoundedCornerShape(0.dp)
47 | )
48 |
49 | MaterialTheme(
50 | colors = colors,
51 | typography = typography,
52 | shapes = shapes,
53 | content = content
54 | )
55 | }
56 |
--------------------------------------------------------------------------------
/androidApp/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 |
2 |
3 | plugins {
4 | //trick: for the same plugin versions in all sub-modules
5 | id("com.android.application").version("8.0.0").apply(false)
6 | id("com.android.library").version("8.0.0").apply(false)
7 | kotlin("multiplatform").version("1.8.0").apply(false)
8 | id("org.jetbrains.compose").version("1.4.0") apply false
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | #Gradle
2 | org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
3 |
4 | #Kotlin
5 | kotlin.code.style=official
6 |
7 | #MPP
8 | kotlin.mpp.stability.nowarn=true
9 | kotlin.mpp.enableCInteropCommonization=true
10 | kotlin.mpp.androidSourceSetLayoutVersion=2
11 |
12 | #Compose
13 | org.jetbrains.compose.experimental.uikit.enabled=true
14 | kotlin.native.cacheKind=none
15 |
16 | #Android
17 | android.useAndroidX=true
18 | android.compileSdk=33
19 | android.targetSdk=33
20 | android.minSdk=24
21 |
22 | #Versions
23 | kotlin.version=1.8.20
24 | agp.version=7.4.2
25 | compose.version=1.4.0
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qamarelsafadi/ComposeMultiplatform/7046bd37fbc059df87147ed971fcdf065417ea8f/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat May 06 18:16:26 EEST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or 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 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/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 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/iosApp/Podfile:
--------------------------------------------------------------------------------
1 | target 'iosApp' do
2 | use_frameworks!
3 | platform :ios, '14.1'
4 | pod 'shared', :path => '../shared'
5 | end
--------------------------------------------------------------------------------
/iosApp/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - shared (1.0.0)
3 |
4 | DEPENDENCIES:
5 | - shared (from `../shared`)
6 |
7 | EXTERNAL SOURCES:
8 | shared:
9 | :path: "../shared"
10 |
11 | SPEC CHECKSUMS:
12 | shared: 5a943f721a346307aa14f7da2d5ae14270a854a7
13 |
14 | PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756
15 |
16 | COCOAPODS: 1.12.1
17 |
--------------------------------------------------------------------------------
/iosApp/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - shared (1.0.0)
3 |
4 | DEPENDENCIES:
5 | - shared (from `../shared`)
6 |
7 | EXTERNAL SOURCES:
8 | shared:
9 | :path: "../shared"
10 |
11 | SPEC CHECKSUMS:
12 | shared: 5a943f721a346307aa14f7da2d5ae14270a854a7
13 |
14 | PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756
15 |
16 | COCOAPODS: 1.12.1
17 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | ${PODS_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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_iosApp : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_iosApp
5 | @end
6 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_iosAppVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_iosAppVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../shared/build/cocoapods/framework"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -framework "shared"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_iosApp {
2 | umbrella header "Pods-iosApp-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../shared/build/cocoapods/framework"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -framework "shared"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/iosApp/iosApp.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
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 | 7D0E06802A081B3100B762EA /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D0E067F2A081B3100B762EA /* ContentView.swift */; };
14 | 7FAE86A0E9B0E863F5EBAB66 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EF4867F0693D619484DC1F9 /* Pods_iosApp.framework */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXCopyFilesBuildPhase section */
18 | 7555FFB4242A642300829871 /* Embed Frameworks */ = {
19 | isa = PBXCopyFilesBuildPhase;
20 | buildActionMask = 2147483647;
21 | dstPath = "";
22 | dstSubfolderSpec = 10;
23 | files = (
24 | );
25 | name = "Embed Frameworks";
26 | runOnlyForDeploymentPostprocessing = 0;
27 | };
28 | /* End PBXCopyFilesBuildPhase section */
29 |
30 | /* Begin PBXFileReference section */
31 | 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
32 | 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
33 | 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; };
34 | 2EF4867F0693D619484DC1F9 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
35 | 7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
36 | 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
37 | 7C1F78A7F2DDF9E703862C3B /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; };
38 | 7D0E067F2A081B3100B762EA /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
39 | C2769754368C67975C78530E /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; };
40 | /* End PBXFileReference section */
41 |
42 | /* Begin PBXFrameworksBuildPhase section */
43 | 7555FF78242A565900829871 /* Frameworks */ = {
44 | isa = PBXFrameworksBuildPhase;
45 | buildActionMask = 2147483647;
46 | files = (
47 | 7FAE86A0E9B0E863F5EBAB66 /* Pods_iosApp.framework in Frameworks */,
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | /* End PBXFrameworksBuildPhase section */
52 |
53 | /* Begin PBXGroup section */
54 | 058557D7273AAEEB004C7B11 /* Preview Content */ = {
55 | isa = PBXGroup;
56 | children = (
57 | 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */,
58 | );
59 | path = "Preview Content";
60 | sourceTree = "";
61 | };
62 | 1B621ECD65053DD2B00C7703 /* Frameworks */ = {
63 | isa = PBXGroup;
64 | children = (
65 | 2EF4867F0693D619484DC1F9 /* Pods_iosApp.framework */,
66 | );
67 | name = Frameworks;
68 | sourceTree = "";
69 | };
70 | 2803E525B65FE340920D4168 /* Pods */ = {
71 | isa = PBXGroup;
72 | children = (
73 | C2769754368C67975C78530E /* Pods-iosApp.debug.xcconfig */,
74 | 7C1F78A7F2DDF9E703862C3B /* Pods-iosApp.release.xcconfig */,
75 | );
76 | name = Pods;
77 | path = Pods;
78 | sourceTree = "";
79 | };
80 | 7555FF72242A565900829871 = {
81 | isa = PBXGroup;
82 | children = (
83 | 7555FF7D242A565900829871 /* iosApp */,
84 | 7555FF7C242A565900829871 /* Products */,
85 | 2803E525B65FE340920D4168 /* Pods */,
86 | 1B621ECD65053DD2B00C7703 /* Frameworks */,
87 | );
88 | sourceTree = "";
89 | };
90 | 7555FF7C242A565900829871 /* Products */ = {
91 | isa = PBXGroup;
92 | children = (
93 | 7555FF7B242A565900829871 /* iosApp.app */,
94 | );
95 | name = Products;
96 | sourceTree = "";
97 | };
98 | 7555FF7D242A565900829871 /* iosApp */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 058557BA273AAA24004C7B11 /* Assets.xcassets */,
102 | 7555FF8C242A565B00829871 /* Info.plist */,
103 | 2152FB032600AC8F00CF470E /* iOSApp.swift */,
104 | 058557D7273AAEEB004C7B11 /* Preview Content */,
105 | 7D0E067F2A081B3100B762EA /* ContentView.swift */,
106 | );
107 | path = iosApp;
108 | sourceTree = "";
109 | };
110 | /* End PBXGroup section */
111 |
112 | /* Begin PBXNativeTarget section */
113 | 7555FF7A242A565900829871 /* iosApp */ = {
114 | isa = PBXNativeTarget;
115 | buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */;
116 | buildPhases = (
117 | 64E2B65E40F1A5CB4B450804 /* [CP] Check Pods Manifest.lock */,
118 | 7555FFB5242A651A00829871 /* ShellScript */,
119 | 7555FF77242A565900829871 /* Sources */,
120 | 7555FF78242A565900829871 /* Frameworks */,
121 | 7555FF79242A565900829871 /* Resources */,
122 | 7555FFB4242A642300829871 /* Embed Frameworks */,
123 | 4EE764338FEA86DBE186EA3F /* [CP] Copy Pods Resources */,
124 | );
125 | buildRules = (
126 | );
127 | dependencies = (
128 | );
129 | name = iosApp;
130 | productName = iosApp;
131 | productReference = 7555FF7B242A565900829871 /* iosApp.app */;
132 | productType = "com.apple.product-type.application";
133 | };
134 | /* End PBXNativeTarget section */
135 |
136 | /* Begin PBXProject section */
137 | 7555FF73242A565900829871 /* Project object */ = {
138 | isa = PBXProject;
139 | attributes = {
140 | LastSwiftUpdateCheck = 1130;
141 | LastUpgradeCheck = 1130;
142 | ORGANIZATIONNAME = orgName;
143 | TargetAttributes = {
144 | 7555FF7A242A565900829871 = {
145 | CreatedOnToolsVersion = 11.3.1;
146 | };
147 | };
148 | };
149 | buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */;
150 | compatibilityVersion = "Xcode 9.3";
151 | developmentRegion = en;
152 | hasScannedForEncodings = 0;
153 | knownRegions = (
154 | en,
155 | Base,
156 | );
157 | mainGroup = 7555FF72242A565900829871;
158 | productRefGroup = 7555FF7C242A565900829871 /* Products */;
159 | projectDirPath = "";
160 | projectRoot = "";
161 | targets = (
162 | 7555FF7A242A565900829871 /* iosApp */,
163 | );
164 | };
165 | /* End PBXProject section */
166 |
167 | /* Begin PBXResourcesBuildPhase section */
168 | 7555FF79242A565900829871 /* Resources */ = {
169 | isa = PBXResourcesBuildPhase;
170 | buildActionMask = 2147483647;
171 | files = (
172 | 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */,
173 | 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */,
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | };
177 | /* End PBXResourcesBuildPhase section */
178 |
179 | /* Begin PBXShellScriptBuildPhase section */
180 | 4EE764338FEA86DBE186EA3F /* [CP] Copy Pods Resources */ = {
181 | isa = PBXShellScriptBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | );
185 | inputFileListPaths = (
186 | "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist",
187 | );
188 | name = "[CP] Copy Pods Resources";
189 | outputFileListPaths = (
190 | "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist",
191 | );
192 | runOnlyForDeploymentPostprocessing = 0;
193 | shellPath = /bin/sh;
194 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n";
195 | showEnvVarsInLog = 0;
196 | };
197 | 64E2B65E40F1A5CB4B450804 /* [CP] Check Pods Manifest.lock */ = {
198 | isa = PBXShellScriptBuildPhase;
199 | buildActionMask = 2147483647;
200 | files = (
201 | );
202 | inputFileListPaths = (
203 | );
204 | inputPaths = (
205 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
206 | "${PODS_ROOT}/Manifest.lock",
207 | );
208 | name = "[CP] Check Pods Manifest.lock";
209 | outputFileListPaths = (
210 | );
211 | outputPaths = (
212 | "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt",
213 | );
214 | runOnlyForDeploymentPostprocessing = 0;
215 | shellPath = /bin/sh;
216 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
217 | showEnvVarsInLog = 0;
218 | };
219 | 7555FFB5242A651A00829871 /* ShellScript */ = {
220 | isa = PBXShellScriptBuildPhase;
221 | buildActionMask = 2147483647;
222 | files = (
223 | );
224 | inputFileListPaths = (
225 | );
226 | inputPaths = (
227 | );
228 | outputFileListPaths = (
229 | );
230 | outputPaths = (
231 | );
232 | runOnlyForDeploymentPostprocessing = 0;
233 | shellPath = /bin/sh;
234 | shellScript = "cd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode\n";
235 | };
236 | /* End PBXShellScriptBuildPhase section */
237 |
238 | /* Begin PBXSourcesBuildPhase section */
239 | 7555FF77242A565900829871 /* Sources */ = {
240 | isa = PBXSourcesBuildPhase;
241 | buildActionMask = 2147483647;
242 | files = (
243 | 7D0E06802A081B3100B762EA /* ContentView.swift in Sources */,
244 | 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */,
245 | );
246 | runOnlyForDeploymentPostprocessing = 0;
247 | };
248 | /* End PBXSourcesBuildPhase section */
249 |
250 | /* Begin XCBuildConfiguration section */
251 | 7555FFA3242A565B00829871 /* Debug */ = {
252 | isa = XCBuildConfiguration;
253 | buildSettings = {
254 | ALWAYS_SEARCH_USER_PATHS = NO;
255 | CLANG_ANALYZER_NONNULL = YES;
256 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
257 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
258 | CLANG_CXX_LIBRARY = "libc++";
259 | CLANG_ENABLE_MODULES = YES;
260 | CLANG_ENABLE_OBJC_ARC = YES;
261 | CLANG_ENABLE_OBJC_WEAK = YES;
262 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
263 | CLANG_WARN_BOOL_CONVERSION = YES;
264 | CLANG_WARN_COMMA = YES;
265 | CLANG_WARN_CONSTANT_CONVERSION = YES;
266 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
267 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
268 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
269 | CLANG_WARN_EMPTY_BODY = YES;
270 | CLANG_WARN_ENUM_CONVERSION = YES;
271 | CLANG_WARN_INFINITE_RECURSION = YES;
272 | CLANG_WARN_INT_CONVERSION = YES;
273 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
274 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
275 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
276 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
277 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
279 | CLANG_WARN_STRICT_PROTOTYPES = YES;
280 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
281 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
282 | CLANG_WARN_UNREACHABLE_CODE = YES;
283 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
284 | COPY_PHASE_STRIP = NO;
285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
286 | ENABLE_STRICT_OBJC_MSGSEND = YES;
287 | ENABLE_TESTABILITY = YES;
288 | GCC_C_LANGUAGE_STANDARD = gnu11;
289 | GCC_DYNAMIC_NO_PIC = NO;
290 | GCC_NO_COMMON_BLOCKS = YES;
291 | GCC_OPTIMIZATION_LEVEL = 0;
292 | GCC_PREPROCESSOR_DEFINITIONS = (
293 | "DEBUG=1",
294 | "$(inherited)",
295 | );
296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
298 | GCC_WARN_UNDECLARED_SELECTOR = YES;
299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
300 | GCC_WARN_UNUSED_FUNCTION = YES;
301 | GCC_WARN_UNUSED_VARIABLE = YES;
302 | IPHONEOS_DEPLOYMENT_TARGET = 14.1;
303 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
304 | MTL_FAST_MATH = YES;
305 | ONLY_ACTIVE_ARCH = YES;
306 | SDKROOT = iphoneos;
307 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
308 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
309 | };
310 | name = Debug;
311 | };
312 | 7555FFA4242A565B00829871 /* Release */ = {
313 | isa = XCBuildConfiguration;
314 | buildSettings = {
315 | ALWAYS_SEARCH_USER_PATHS = NO;
316 | CLANG_ANALYZER_NONNULL = YES;
317 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
318 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
319 | CLANG_CXX_LIBRARY = "libc++";
320 | CLANG_ENABLE_MODULES = YES;
321 | CLANG_ENABLE_OBJC_ARC = YES;
322 | CLANG_ENABLE_OBJC_WEAK = YES;
323 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
324 | CLANG_WARN_BOOL_CONVERSION = YES;
325 | CLANG_WARN_COMMA = YES;
326 | CLANG_WARN_CONSTANT_CONVERSION = YES;
327 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
328 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
329 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
330 | CLANG_WARN_EMPTY_BODY = YES;
331 | CLANG_WARN_ENUM_CONVERSION = YES;
332 | CLANG_WARN_INFINITE_RECURSION = YES;
333 | CLANG_WARN_INT_CONVERSION = YES;
334 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
335 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
336 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
338 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
339 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
340 | CLANG_WARN_STRICT_PROTOTYPES = YES;
341 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
342 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
343 | CLANG_WARN_UNREACHABLE_CODE = YES;
344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
345 | COPY_PHASE_STRIP = NO;
346 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
347 | ENABLE_NS_ASSERTIONS = NO;
348 | ENABLE_STRICT_OBJC_MSGSEND = YES;
349 | GCC_C_LANGUAGE_STANDARD = gnu11;
350 | GCC_NO_COMMON_BLOCKS = YES;
351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
353 | GCC_WARN_UNDECLARED_SELECTOR = YES;
354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
355 | GCC_WARN_UNUSED_FUNCTION = YES;
356 | GCC_WARN_UNUSED_VARIABLE = YES;
357 | IPHONEOS_DEPLOYMENT_TARGET = 14.1;
358 | MTL_ENABLE_DEBUG_INFO = NO;
359 | MTL_FAST_MATH = YES;
360 | SDKROOT = iphoneos;
361 | SWIFT_COMPILATION_MODE = wholemodule;
362 | SWIFT_OPTIMIZATION_LEVEL = "-O";
363 | VALIDATE_PRODUCT = YES;
364 | };
365 | name = Release;
366 | };
367 | 7555FFA6242A565B00829871 /* Debug */ = {
368 | isa = XCBuildConfiguration;
369 | baseConfigurationReference = C2769754368C67975C78530E /* Pods-iosApp.debug.xcconfig */;
370 | buildSettings = {
371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
372 | CODE_SIGN_STYLE = Automatic;
373 | CURRENT_PROJECT_VERSION = 1;
374 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
375 | DEVELOPMENT_TEAM = M43JXC9XJS;
376 | ENABLE_PREVIEWS = YES;
377 | FRAMEWORK_SEARCH_PATHS = (
378 | "$(inherited)",
379 | "$(SRCROOT)/../common/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
380 | );
381 | INFOPLIST_FILE = iosApp/Info.plist;
382 | LD_RUNPATH_SEARCH_PATHS = (
383 | "$(inherited)",
384 | "@executable_path/Frameworks",
385 | );
386 | MARKETING_VERSION = 1;
387 | OTHER_LDFLAGS = (
388 | "$(inherited)",
389 | "-framework",
390 | shared,
391 | );
392 | PRODUCT_BUNDLE_IDENTIFIER = com.qamar.composemultiplatform;
393 | PRODUCT_NAME = "$(TARGET_NAME)";
394 | SWIFT_VERSION = 5.0;
395 | TARGETED_DEVICE_FAMILY = "1,2";
396 | };
397 | name = Debug;
398 | };
399 | 7555FFA7242A565B00829871 /* Release */ = {
400 | isa = XCBuildConfiguration;
401 | baseConfigurationReference = 7C1F78A7F2DDF9E703862C3B /* Pods-iosApp.release.xcconfig */;
402 | buildSettings = {
403 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
404 | CODE_SIGN_IDENTITY = "Apple Development";
405 | CODE_SIGN_STYLE = Automatic;
406 | CURRENT_PROJECT_VERSION = 1;
407 | DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
408 | DEVELOPMENT_TEAM = M43JXC9XJS;
409 | ENABLE_PREVIEWS = YES;
410 | FRAMEWORK_SEARCH_PATHS = (
411 | "$(inherited)",
412 | "$(SRCROOT)/../common/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
413 | );
414 | INFOPLIST_FILE = iosApp/Info.plist;
415 | LD_RUNPATH_SEARCH_PATHS = (
416 | "$(inherited)",
417 | "@executable_path/Frameworks",
418 | );
419 | MARKETING_VERSION = 1;
420 | OTHER_LDFLAGS = (
421 | "$(inherited)",
422 | "-framework",
423 | shared,
424 | );
425 | PRODUCT_BUNDLE_IDENTIFIER = com.qamar.composemultiplatform;
426 | PRODUCT_NAME = "$(TARGET_NAME)";
427 | PROVISIONING_PROFILE_SPECIFIER = "";
428 | SWIFT_VERSION = 5.0;
429 | TARGETED_DEVICE_FAMILY = "1,2";
430 | };
431 | name = Release;
432 | };
433 | /* End XCBuildConfiguration section */
434 |
435 | /* Begin XCConfigurationList section */
436 | 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = {
437 | isa = XCConfigurationList;
438 | buildConfigurations = (
439 | 7555FFA3242A565B00829871 /* Debug */,
440 | 7555FFA4242A565B00829871 /* Release */,
441 | );
442 | defaultConfigurationIsVisible = 0;
443 | defaultConfigurationName = Release;
444 | };
445 | 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = {
446 | isa = XCConfigurationList;
447 | buildConfigurations = (
448 | 7555FFA6242A565B00829871 /* Debug */,
449 | 7555FFA7242A565B00829871 /* Release */,
450 | );
451 | defaultConfigurationIsVisible = 0;
452 | defaultConfigurationName = Release;
453 | };
454 | /* End XCConfigurationList section */
455 | };
456 | rootObject = 7555FF73242A565900829871 /* Project object */;
457 | }
458 |
--------------------------------------------------------------------------------
/iosApp/iosApp.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/iosApp/iosApp.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 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "scale" : "1x",
46 | "size" : "20x20"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "scale" : "2x",
51 | "size" : "20x20"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "scale" : "1x",
56 | "size" : "29x29"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "29x29"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "scale" : "1x",
66 | "size" : "40x40"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "scale" : "2x",
71 | "size" : "40x40"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "scale" : "1x",
76 | "size" : "76x76"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "scale" : "2x",
81 | "size" : "76x76"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "scale" : "2x",
86 | "size" : "83.5x83.5"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "scale" : "1x",
91 | "size" : "1024x1024"
92 | }
93 | ],
94 | "info" : {
95 | "author" : "xcode",
96 | "version" : 1
97 | }
98 | }
--------------------------------------------------------------------------------
/iosApp/iosApp/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/iosApp/iosApp/ContentView.swift:
--------------------------------------------------------------------------------
1 |
2 | import SwiftUI
3 | import shared
4 |
5 | struct ComposeView: UIViewControllerRepresentable {
6 | func makeUIViewController(context: Context) -> UIViewController {
7 | Main_iosKt.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(.keyboard) // Compose has own keyboard handler
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/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 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 |
28 | UILaunchScreen
29 |
30 | UIRequiredDeviceCapabilities
31 |
32 | armv7
33 |
34 | UISupportedInterfaceOrientations
35 |
36 | UIInterfaceOrientationPortrait
37 | UIInterfaceOrientationLandscapeLeft
38 | UIInterfaceOrientationLandscapeRight
39 |
40 | UISupportedInterfaceOrientations~ipad
41 |
42 | UIInterfaceOrientationPortrait
43 | UIInterfaceOrientationPortraitUpsideDown
44 | UIInterfaceOrientationLandscapeLeft
45 | UIInterfaceOrientationLandscapeRight
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/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 |
3 | @main
4 | struct iOSApp: App {
5 | var body: some Scene {
6 | WindowGroup {
7 | ContentView()
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | rootProject.name = "ComposeMultiplatform"
2 |
3 | include(":androidApp")
4 | include(":shared")
5 |
6 | pluginManagement {
7 | repositories {
8 | gradlePluginPortal()
9 | maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
10 | google()
11 | }
12 |
13 | plugins {
14 | val kotlinVersion = extra["kotlin.version"] as String
15 | val agpVersion = extra["agp.version"] as String
16 | val composeVersion = extra["compose.version"] as String
17 |
18 | kotlin("jvm").version(kotlinVersion)
19 | kotlin("multiplatform").version(kotlinVersion)
20 | kotlin("android").version(kotlinVersion)
21 |
22 | id("com.android.application").version(agpVersion)
23 | id("com.android.library").version(agpVersion)
24 |
25 | id("org.jetbrains.compose").version(composeVersion)
26 | }
27 | }
28 |
29 | dependencyResolutionManagement {
30 | repositories {
31 | google()
32 | mavenCentral()
33 | maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/shared/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | kotlin("multiplatform")
3 | kotlin("native.cocoapods")
4 | id("com.android.library")
5 | id("org.jetbrains.compose")
6 | }
7 |
8 | kotlin {
9 | android()
10 |
11 | iosX64()
12 | iosArm64()
13 | iosSimulatorArm64()
14 |
15 | cocoapods {
16 | version = "1.0.0"
17 | summary = "Some description for the Shared Module"
18 | homepage = "Link to the Shared Module homepage"
19 | ios.deploymentTarget = "16.1"
20 | podfile = project.file("../iosApp/Podfile")
21 | framework {
22 | baseName = "shared"
23 | isStatic = true
24 | }
25 | extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
26 | }
27 |
28 | sourceSets {
29 | val commonMain by getting {
30 | dependencies {
31 | implementation(compose.runtime)
32 | implementation(compose.foundation)
33 | implementation(compose.material)
34 | @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
35 | implementation(compose.components.resources)
36 | }
37 | }
38 | val androidMain by getting {
39 | dependencies {
40 | api("androidx.activity:activity-compose:1.6.1")
41 | api("androidx.appcompat:appcompat:1.6.1")
42 | api("androidx.core:core-ktx:1.9.0")
43 | }
44 | }
45 | val iosX64Main by getting
46 | val iosArm64Main by getting
47 | val iosSimulatorArm64Main by getting
48 | val iosMain by creating {
49 | dependsOn(commonMain)
50 | iosX64Main.dependsOn(this)
51 | iosArm64Main.dependsOn(this)
52 | iosSimulatorArm64Main.dependsOn(this)
53 | }
54 | }
55 | }
56 |
57 | android {
58 | compileSdk = (findProperty("android.compileSdk") as String).toInt()
59 | namespace = "com.myapplication.common"
60 |
61 | sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
62 | sourceSets["main"].res.srcDirs("src/androidMain/res")
63 | sourceSets["main"].resources.srcDirs("src/commonMain/resources")
64 |
65 | defaultConfig {
66 | minSdk = (findProperty("android.minSdk") as String).toInt()
67 | targetSdk = (findProperty("android.targetSdk") as String).toInt()
68 | }
69 | compileOptions {
70 | sourceCompatibility = JavaVersion.VERSION_11
71 | targetCompatibility = JavaVersion.VERSION_11
72 | }
73 | kotlin {
74 | jvmToolchain(11)
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/shared/shared.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |spec|
2 | spec.name = 'shared'
3 | spec.version = '1.0.0'
4 | spec.homepage = 'Link to the Shared Module homepage'
5 | spec.source = { :http=> ''}
6 | spec.authors = ''
7 | spec.license = ''
8 | spec.summary = 'Some description for the Shared Module'
9 | spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework'
10 | spec.libraries = 'c++'
11 | spec.ios.deployment_target = '16.1'
12 |
13 |
14 | spec.pod_target_xcconfig = {
15 | 'KOTLIN_PROJECT_PATH' => ':shared',
16 | 'PRODUCT_MODULE_NAME' => 'shared',
17 | }
18 |
19 | spec.script_phases = [
20 | {
21 | :name => 'Build shared',
22 | :execution_position => :before_compile,
23 | :shell_path => '/bin/sh',
24 | :script => <<-SCRIPT
25 | if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
26 | echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
27 | exit 0
28 | fi
29 | set -ev
30 | REPO_ROOT="$PODS_TARGET_SRCROOT"
31 | "$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
32 | -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
33 | -Pkotlin.native.cocoapods.archs="$ARCHS" \
34 | -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
35 | SCRIPT
36 | }
37 | ]
38 | spec.resources = ['src/commonMain/resources/**', 'src/iosMain/resources/**']
39 | end
--------------------------------------------------------------------------------
/shared/src/androidMain/kotlin/com/qamar/composemultiplatform/main.android.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform
2 |
3 |
4 | import androidx.compose.runtime.Composable
5 | @Composable
6 | fun Application(){
7 | App()
8 | }
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/App.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform
2 |
3 |
4 | import androidx.compose.foundation.background
5 | import androidx.compose.foundation.clickable
6 | import androidx.compose.foundation.layout.Arrangement
7 | import androidx.compose.foundation.layout.Box
8 | import androidx.compose.foundation.layout.Column
9 | import androidx.compose.foundation.layout.PaddingValues
10 | import androidx.compose.foundation.layout.Row
11 | import androidx.compose.foundation.layout.Spacer
12 | import androidx.compose.foundation.layout.fillMaxSize
13 | import androidx.compose.foundation.layout.fillMaxWidth
14 | import androidx.compose.foundation.layout.height
15 | import androidx.compose.foundation.layout.padding
16 | import androidx.compose.foundation.layout.requiredHeight
17 | import androidx.compose.foundation.layout.size
18 | import androidx.compose.foundation.shape.RoundedCornerShape
19 | import androidx.compose.foundation.text.KeyboardOptions
20 | import androidx.compose.material.Button
21 | import androidx.compose.material.ButtonDefaults
22 | import androidx.compose.material.OutlinedTextField
23 | import androidx.compose.material.Text
24 | import androidx.compose.runtime.Composable
25 | import androidx.compose.runtime.getValue
26 | import androidx.compose.runtime.mutableStateOf
27 | import androidx.compose.runtime.remember
28 | import androidx.compose.runtime.setValue
29 | import androidx.compose.ui.Alignment
30 | import androidx.compose.ui.Modifier
31 | import androidx.compose.ui.graphics.Color
32 | import androidx.compose.ui.text.font.FontWeight
33 | import androidx.compose.ui.text.input.ImeAction
34 | import androidx.compose.ui.text.input.KeyboardType
35 | import androidx.compose.ui.text.input.PasswordVisualTransformation
36 | import androidx.compose.ui.text.style.TextAlign
37 | import androidx.compose.ui.unit.dp
38 | import androidx.compose.ui.unit.sp
39 | import com.qamar.composemultiplatform.components.CategoryTabs
40 |
41 | @Composable
42 | internal fun App() {
43 | HomeContent()
44 | }
45 |
46 | @Composable
47 | internal fun LoginUi() {
48 | var email by remember { mutableStateOf("") }
49 | var password by remember { mutableStateOf("") }
50 |
51 | Column(
52 | modifier = Modifier.fillMaxSize().padding(horizontal = 16.dp),
53 | verticalArrangement = Arrangement.Center
54 | ) {
55 |
56 | Text(
57 | text = "Login",
58 | fontSize = 28.sp,
59 | fontWeight = FontWeight.Bold,
60 | textAlign = TextAlign.Center,
61 | modifier = Modifier.fillMaxWidth().padding(vertical = 32.dp)
62 | )
63 |
64 | OutlinedTextField(
65 | value = email,
66 | onValueChange = { email = it },
67 | label = { Text("Email") },
68 | keyboardOptions = KeyboardOptions(
69 | keyboardType = KeyboardType.Email,
70 | imeAction = ImeAction.Next
71 | ),
72 | modifier = Modifier.fillMaxWidth()
73 | )
74 |
75 | Spacer(modifier = Modifier.height(16.dp))
76 |
77 | OutlinedTextField(
78 | value = password,
79 | onValueChange = { password = it },
80 | label = { Text("Password") },
81 | visualTransformation = PasswordVisualTransformation(),
82 | keyboardOptions = KeyboardOptions(
83 | keyboardType = KeyboardType.Password,
84 | imeAction = ImeAction.Done
85 | ),
86 | modifier = Modifier.fillMaxWidth()
87 | )
88 |
89 | Spacer(modifier = Modifier.height(32.dp))
90 |
91 | Button(
92 | onClick = { /* Handle login button click */ },
93 | modifier = Modifier.fillMaxWidth()
94 | ) {
95 | Text(text = "Log in")
96 | }
97 | }
98 | }
99 |
100 | @Composable
101 | internal fun HomeContent() {
102 | Column(
103 | Modifier
104 | .fillMaxSize()
105 | .background(Color.White)
106 | ) {
107 | Text(
108 | text = "Planty App",
109 | color = Color.Black,
110 | modifier = Modifier.padding(start = 52.dp, top = 50.dp)
111 | )
112 | CategoryTabs()
113 | Spacer(modifier = Modifier.weight(1f))
114 |
115 | // Footer
116 | Row(
117 | Modifier
118 | .fillMaxWidth()
119 | .requiredHeight(150.dp)
120 | .background(Color.Transparent),
121 | horizontalArrangement = Arrangement.End
122 | ) {
123 | Button(
124 | onClick = { /*TODO*/ },
125 | shape = RoundedCornerShape(topStart = 30.dp, topEnd = 30.dp),
126 | modifier = Modifier
127 | .fillMaxWidth(1f)
128 | .height(150.dp),
129 | colors = ButtonDefaults.buttonColors(backgroundColor = Color.Black),
130 | contentPadding = PaddingValues(0.dp)
131 | ) {
132 | Box(
133 | modifier = Modifier.fillMaxSize(),
134 | contentAlignment = Alignment.Center
135 | ) {
136 | Text(
137 | text = "TAKE CARE",
138 | color = Color.White,
139 | textAlign = TextAlign.Center,
140 | modifier = Modifier
141 | .padding(top = 20.dp)
142 | .fillMaxWidth(1f)
143 | .height(150.dp),
144 | )
145 | }
146 | }
147 | }
148 | }
149 | }
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/components/CategoryTabs.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.components
2 |
3 |
4 | import androidx.compose.foundation.ExperimentalFoundationApi
5 | import androidx.compose.foundation.background
6 | import androidx.compose.foundation.layout.Column
7 | import androidx.compose.foundation.layout.fillMaxSize
8 | import androidx.compose.foundation.layout.height
9 | import androidx.compose.foundation.layout.padding
10 | import androidx.compose.foundation.pager.rememberPagerState
11 | import androidx.compose.material.Divider
12 | import androidx.compose.material.ScrollableTabRow
13 | import androidx.compose.material.TabPosition
14 | import androidx.compose.runtime.Composable
15 | import androidx.compose.ui.Modifier
16 | import androidx.compose.ui.graphics.Color
17 | import androidx.compose.ui.unit.dp
18 | import com.qamar.composemultiplatform.components.item.TabItem
19 | import com.qamar.composemultiplatform.model.Plant
20 |
21 | @OptIn(ExperimentalFoundationApi::class)
22 | @Composable
23 | internal fun CategoryTabs() {
24 | val pagerState = rememberPagerState()
25 | val pages = Plant.getPlantList()
26 | val indicator = @Composable { tabPositions: List ->
27 | CustomIndicator(tabPositions, pagerState)
28 | }
29 |
30 | Column(
31 | Modifier
32 | .fillMaxSize()
33 | .background(Color.White)
34 | ) {
35 | ScrollableTabRow(
36 | modifier = Modifier
37 | .padding(top = 33.dp, start = 37.dp)
38 | .height(30.dp),
39 | selectedTabIndex = pagerState.currentPage,
40 | indicator = indicator,
41 | backgroundColor = Color.White,
42 | edgePadding = 0.dp,
43 | divider = {
44 | Divider(color = Color.Transparent)
45 | }
46 | ) {
47 | pages.forEachIndexed { index, plant ->
48 | TabItem(pagerState, index, plant)
49 | }
50 | }
51 | ItemPager(pagerState, pages)
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/components/CircularProgress.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.components
2 |
3 | import androidx.compose.animation.core.animateFloatAsState
4 | import androidx.compose.foundation.layout.Arrangement
5 | import androidx.compose.foundation.layout.Box
6 | import androidx.compose.foundation.layout.Column
7 | import androidx.compose.foundation.layout.size
8 | import androidx.compose.foundation.shape.RoundedCornerShape
9 | import androidx.compose.material.CircularProgressIndicator
10 | import androidx.compose.material.ProgressIndicatorDefaults
11 | import androidx.compose.material.Text
12 | import androidx.compose.runtime.Composable
13 | import androidx.compose.runtime.getValue
14 | import androidx.compose.ui.Alignment
15 | import androidx.compose.ui.Modifier
16 | import androidx.compose.ui.draw.clip
17 | import androidx.compose.ui.graphics.Color
18 | import androidx.compose.ui.graphics.Color.Companion.LightGray
19 | import androidx.compose.ui.unit.dp
20 | import com.qamar.composemultiplatform.model.Properties
21 |
22 |
23 | @Composable
24 | internal fun CircularProgress(property: Properties) {
25 | val animatedProgress by animateFloatAsState(
26 | targetValue = property.percent,
27 | animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec
28 | )
29 |
30 | Box {
31 | CircularProgressIndicator(
32 | progress = 1f,
33 | color = LightGray,
34 | strokeWidth = 1.4.dp,
35 | modifier = Modifier.size(120.dp)
36 |
37 | )
38 | CircularProgressIndicator(
39 | progress = animatedProgress,
40 | modifier = Modifier
41 | .size(120.dp)
42 | .clip(RoundedCornerShape(14.dp)),
43 | color = Color.Black,
44 | strokeWidth = 2.8.dp
45 | )
46 |
47 | PercentText( property, Modifier.Companion.align(Alignment.Center))
48 | }
49 |
50 | }
51 |
52 | @Composable
53 | private fun PercentText(property: Properties, modifier: Modifier) {
54 | Column(
55 | modifier = modifier,
56 | horizontalAlignment = Alignment.CenterHorizontally,
57 | verticalArrangement = Arrangement.Center
58 | ) {
59 |
60 | Text(
61 | text = "${property.percent.times(100).toInt()}%",
62 | color = Color.Black
63 | )
64 | Text(
65 | text = property.propertyName,
66 | color = Color.Gray,
67 | )
68 |
69 | }
70 | }
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/components/CustomIndicator.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.components
2 |
3 |
4 | import androidx.compose.animation.core.animateDp
5 | import androidx.compose.animation.core.spring
6 | import androidx.compose.animation.core.updateTransition
7 | import androidx.compose.foundation.ExperimentalFoundationApi
8 | import androidx.compose.foundation.background
9 | import androidx.compose.foundation.layout.Box
10 | import androidx.compose.foundation.layout.fillMaxSize
11 | import androidx.compose.foundation.layout.offset
12 | import androidx.compose.foundation.layout.padding
13 | import androidx.compose.foundation.layout.requiredHeight
14 | import androidx.compose.foundation.layout.width
15 | import androidx.compose.foundation.layout.wrapContentSize
16 | import androidx.compose.foundation.pager.PagerState
17 | import androidx.compose.foundation.shape.RoundedCornerShape
18 | import androidx.compose.material.TabPosition
19 | import androidx.compose.runtime.Composable
20 | import androidx.compose.runtime.getValue
21 | import androidx.compose.ui.Alignment
22 | import androidx.compose.ui.Modifier
23 | import androidx.compose.ui.graphics.Color.Companion.Black
24 | import androidx.compose.ui.unit.dp
25 | import androidx.compose.ui.zIndex
26 |
27 |
28 | @OptIn(ExperimentalFoundationApi::class)
29 | @Composable
30 | internal fun CustomIndicator(tabPositions: List, pagerState: PagerState) {
31 | val transition = updateTransition(pagerState.currentPage, label = "")
32 | val indicatorStart by transition.animateDp(
33 | transitionSpec = {
34 | if (initialState < targetState) {
35 | spring(dampingRatio = 1f, stiffness = 50f)
36 | } else {
37 | spring(dampingRatio = 1f, stiffness = 1000f)
38 | }
39 | }, label = ""
40 | ) {
41 | tabPositions[it].left
42 | }
43 |
44 | val indicatorEnd by transition.animateDp(
45 | transitionSpec = {
46 | if (initialState < targetState) {
47 | spring(dampingRatio = 1f, stiffness = 1000f)
48 | } else {
49 | spring(dampingRatio = 1f, stiffness = 50f)
50 | }
51 | }, label = ""
52 | ) {
53 | tabPositions[it].right
54 | }
55 |
56 | Box(
57 | Modifier
58 | .offset(x = indicatorStart)
59 | .wrapContentSize(align = Alignment.BottomStart)
60 | .width(indicatorEnd - indicatorStart)
61 | .requiredHeight(30.dp)
62 | .padding(2.dp)
63 | .fillMaxSize()
64 | .background(color = Black, RoundedCornerShape(50))
65 | .zIndex(1f)
66 |
67 | )
68 | }
69 |
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/components/ItemPager.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.components
2 |
3 | import androidx.compose.foundation.ExperimentalFoundationApi
4 | import androidx.compose.foundation.background
5 | import androidx.compose.foundation.layout.Box
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.foundation.layout.padding
8 | import androidx.compose.foundation.layout.wrapContentWidth
9 | import androidx.compose.foundation.pager.HorizontalPager
10 | import androidx.compose.foundation.pager.PagerState
11 | import androidx.compose.runtime.Composable
12 | import androidx.compose.runtime.LaunchedEffect
13 | import androidx.compose.runtime.getValue
14 | import androidx.compose.runtime.mutableStateOf
15 | import androidx.compose.runtime.remember
16 | import androidx.compose.runtime.setValue
17 | import androidx.compose.runtime.snapshotFlow
18 | import androidx.compose.ui.Alignment
19 | import androidx.compose.ui.Modifier
20 | import androidx.compose.ui.graphics.Color
21 | import androidx.compose.ui.unit.dp
22 | import com.qamar.composemultiplatform.components.plant.PlantImage
23 | import com.qamar.composemultiplatform.components.plant.PlantProperty
24 | import com.qamar.composemultiplatform.model.Plant
25 |
26 |
27 | @OptIn(ExperimentalFoundationApi::class)
28 | @Composable
29 | internal fun ItemPager(
30 | pagerState: PagerState,
31 | pages: List
32 | ) {
33 | var currentItem by remember {
34 | mutableStateOf(Plant(image ="plant1.png"))
35 | }
36 |
37 | LaunchedEffect(pagerState) {
38 | // get current page
39 | snapshotFlow { pagerState.currentPage }.collect { page ->
40 | currentItem = pages[page]
41 | }
42 | }
43 | HorizontalPager(
44 | modifier = Modifier
45 | .fillMaxSize()
46 | .background(Color.White),
47 | pageCount = pages.size,
48 | state = pagerState,
49 | ) { page ->
50 | Box(
51 | Modifier
52 | .padding(top = 50.dp)
53 | .fillMaxSize(),
54 | contentAlignment = Alignment.CenterStart
55 | ) {
56 | PlantImage(
57 | currentItem,
58 | Modifier
59 | .padding(bottom = 80.dp, end = 100.dp)
60 | .align(Alignment.CenterStart)
61 | )
62 | PlantProperty(
63 | currentItem,
64 | Modifier
65 | .padding(
66 | end = 26.dp,
67 | bottom = 50.dp
68 | )
69 | .align(Alignment.CenterEnd)
70 | .wrapContentWidth()
71 | )
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/components/item/TabItem.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.components.item
2 |
3 | import androidx.compose.animation.animateColorAsState
4 | import androidx.compose.foundation.ExperimentalFoundationApi
5 | import androidx.compose.foundation.pager.PagerState
6 | import androidx.compose.foundation.shape.RoundedCornerShape
7 | import androidx.compose.material.Tab
8 | import androidx.compose.material.Text
9 | import androidx.compose.runtime.Composable
10 | import androidx.compose.runtime.getValue
11 | import androidx.compose.runtime.rememberCoroutineScope
12 | import androidx.compose.ui.Modifier
13 | import androidx.compose.ui.draw.clip
14 | import androidx.compose.ui.graphics.Color
15 | import androidx.compose.ui.graphics.Color.Companion.Gray
16 | import androidx.compose.ui.zIndex
17 | import com.qamar.composemultiplatform.model.Plant
18 | import kotlinx.coroutines.launch
19 |
20 | @OptIn(ExperimentalFoundationApi::class)
21 | @Composable
22 | internal fun TabItem(
23 | pagerState: PagerState,
24 | index: Int,
25 | plant: Plant
26 | ) {
27 | val scope = rememberCoroutineScope()
28 | val isSelected = pagerState.currentPage == index
29 | val color: Color by animateColorAsState(
30 | if (isSelected) Color.White else Gray
31 | )
32 | Tab(
33 | modifier = Modifier.zIndex(6f)
34 | .clip( RoundedCornerShape(50)),
35 | text = {
36 | Text(
37 | text = plant.name ?: "", color = color,
38 | )
39 | },
40 | selected = isSelected,
41 | onClick = {
42 | scope.launch {
43 | pagerState.animateScrollToPage(index,pagerState.currentPageOffsetFraction)
44 | }
45 | },
46 | )
47 | }
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/components/plant/PlantImage.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.components.plant
2 |
3 | import androidx.compose.animation.Crossfade
4 | import androidx.compose.animation.core.tween
5 | import androidx.compose.foundation.Image
6 | import androidx.compose.foundation.layout.size
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Modifier
9 | import androidx.compose.ui.unit.dp
10 | import com.qamar.composemultiplatform.model.Plant
11 | import org.jetbrains.compose.resources.ExperimentalResourceApi
12 | import org.jetbrains.compose.resources.painterResource
13 |
14 | @OptIn(ExperimentalResourceApi::class)
15 | @Composable
16 | internal fun PlantImage(currentItem: Plant, modifier: Modifier) {
17 | Crossfade(
18 | targetState = currentItem,
19 | modifier = modifier,
20 | animationSpec = tween(700)
21 | ) {
22 | Image(
23 | painterResource(currentItem.image!!) ,
24 | contentDescription = "",
25 | Modifier.size(500.dp)
26 |
27 | )
28 | }
29 | }
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/components/plant/PlantProperty.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.components.plant
2 |
3 | import androidx.compose.foundation.layout.Arrangement
4 | import androidx.compose.foundation.layout.Column
5 | import androidx.compose.runtime.Composable
6 | import androidx.compose.ui.Modifier
7 | import androidx.compose.ui.unit.dp
8 | import com.qamar.composemultiplatform.components.CircularProgress
9 | import com.qamar.composemultiplatform.model.Plant
10 |
11 |
12 |
13 | @Composable
14 | internal fun PlantProperty(currentItem: Plant, modifier: Modifier) {
15 | Column(
16 | modifier = modifier,
17 | verticalArrangement = Arrangement.spacedBy(19.dp)
18 | ) {
19 | repeat(currentItem.properties.size) {
20 | CircularProgress(currentItem.properties[it])
21 | }
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/shared/src/commonMain/kotlin/com/qamar/composemultiplatform/model/Plant.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform.model
2 |
3 |
4 | data class Plant(
5 | val name: String? = "",
6 | val properties: List =
7 | listOf(
8 | Properties("Light"),
9 | Properties("Food"),
10 | Properties("Water"),
11 | ),
12 | val image: String? = null
13 | ) {
14 |
15 | companion object{
16 | fun getPlantList(): List {
17 |
18 | return listOf(
19 | Plant(image = "Plants1.jpg", name = "Bird of paradise", ),
20 | Plant("Dracaena", image = "Plants2.jpg"),
21 | Plant("Palm", image = "Plants3.jpg"),
22 | Plant("Ficus", image = "Plants1.jpg"),
23 | Plant("Cedar", image = "Plants2.jpg"),
24 | Plant("Fiddle", image = "Plants3.jpg"),
25 | )
26 | }
27 | }
28 |
29 | }
30 |
31 | data class Properties(
32 | val propertyName: String,
33 | val percent: Float = (0 until 100).random().toFloat()/100
34 | )
35 |
--------------------------------------------------------------------------------
/shared/src/commonMain/resources/Plants.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qamarelsafadi/ComposeMultiplatform/7046bd37fbc059df87147ed971fcdf065417ea8f/shared/src/commonMain/resources/Plants.png
--------------------------------------------------------------------------------
/shared/src/commonMain/resources/Plants1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qamarelsafadi/ComposeMultiplatform/7046bd37fbc059df87147ed971fcdf065417ea8f/shared/src/commonMain/resources/Plants1.jpg
--------------------------------------------------------------------------------
/shared/src/commonMain/resources/Plants2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qamarelsafadi/ComposeMultiplatform/7046bd37fbc059df87147ed971fcdf065417ea8f/shared/src/commonMain/resources/Plants2.jpg
--------------------------------------------------------------------------------
/shared/src/commonMain/resources/Plants3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qamarelsafadi/ComposeMultiplatform/7046bd37fbc059df87147ed971fcdf065417ea8f/shared/src/commonMain/resources/Plants3.jpg
--------------------------------------------------------------------------------
/shared/src/commonMain/resources/Plants4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qamarelsafadi/ComposeMultiplatform/7046bd37fbc059df87147ed971fcdf065417ea8f/shared/src/commonMain/resources/Plants4.png
--------------------------------------------------------------------------------
/shared/src/iosMain/kotlin/com/qamar/composemultiplatform/main.ios.kt:
--------------------------------------------------------------------------------
1 | package com.qamar.composemultiplatform
2 |
3 | import androidx.compose.ui.window.ComposeUIViewController
4 |
5 | fun MainViewController() = ComposeUIViewController { App() }
--------------------------------------------------------------------------------