Browse Source

Refactor todoapp-lite to follow KMM structure and add iOS target (#2536)

pull/2540/head
Nikita Lipsky 2 years ago committed by GitHub
parent
commit
4ac946cd06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      experimental/examples/todoapp-lite/.gitignore
  2. 9
      experimental/examples/todoapp-lite/.run/desktopApp.run.xml
  3. 8
      experimental/examples/todoapp-lite/.run/iosApp.run.xml
  4. 7
      experimental/examples/todoapp-lite/.run/iosApp_.run.xml
  5. 34
      experimental/examples/todoapp-lite/README.md
  6. 29
      experimental/examples/todoapp-lite/android/build.gradle.kts
  7. 34
      experimental/examples/todoapp-lite/androidApp/build.gradle.kts
  8. 0
      experimental/examples/todoapp-lite/androidApp/src/main/AndroidManifest.xml
  9. 6
      experimental/examples/todoapp-lite/androidApp/src/main/java/example/todoapp/lite/MainActivity.kt
  10. 42
      experimental/examples/todoapp-lite/common/build.gradle.kts
  11. 10
      experimental/examples/todoapp-lite/desktopApp/build.gradle.kts
  12. 9
      experimental/examples/todoapp-lite/desktopApp/src/jvmMain/kotlin/example/todoapp/lite/Main.kt
  13. 33
      experimental/examples/todoapp-lite/gradle.properties
  14. 1
      experimental/examples/todoapp-lite/iosApp/Configuration/TeamId.xcconfig
  15. 5
      experimental/examples/todoapp-lite/iosApp/Podfile
  16. 380
      experimental/examples/todoapp-lite/iosApp/TodoAppLite.xcodeproj/project.pbxproj
  17. 48
      experimental/examples/todoapp-lite/iosApp/iosApp/Info.plist
  18. 15
      experimental/examples/todoapp-lite/iosApp/iosApp/iosApp.swift
  19. BIN
      experimental/examples/todoapp-lite/run-configurations.png
  20. BIN
      experimental/examples/todoapp-lite/screenshots/desktop-run-configuration.png
  21. 6
      experimental/examples/todoapp-lite/settings.gradle.kts
  22. 63
      experimental/examples/todoapp-lite/shared/build.gradle.kts
  23. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/AndroidManifest.xml
  24. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/kotlin/example/todoapp/lite/common/Utils.kt
  25. 6
      experimental/examples/todoapp-lite/shared/src/androidMain/kotlin/main.android.kt
  26. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml
  27. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/drawable/ic_launcher_background.xml
  28. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml
  29. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml
  30. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-hdpi/ic_launcher.png
  31. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png
  32. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-mdpi/ic_launcher.png
  33. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png
  34. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xhdpi/ic_launcher.png
  35. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png
  36. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png
  37. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png
  38. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png
  39. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png
  40. 0
      experimental/examples/todoapp-lite/shared/src/androidMain/res/values/strings.xml
  41. 0
      experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/EditDialog.kt
  42. 0
      experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/MainContent.kt
  43. 2
      experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt
  44. 0
      experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootStore.kt
  45. 0
      experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/TodoItem.kt
  46. 0
      experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/Utils.kt
  47. 0
      experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt
  48. 6
      experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/main.desktop.kt
  49. 32
      experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/example/todoapp/lite/common/Utils.kt
  50. 26
      experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/main.ios.kt

14
experimental/examples/todoapp-lite/.gitignore vendored

@ -1,15 +1,15 @@
*.iml *.iml
.gradle .gradle
/local.properties /local.properties
/.idea /.idea/
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store .DS_Store
build/ build/
/captures /captures
.externalNativeBuild .externalNativeBuild
.cxx .cxx
iosApp/Podfile.lock
iosApp/Pods/*
iosApp/TodoAppLite.xcworkspace/*
iosApp/TodoAppLite.xcodeproj/*
!iosApp/TodoAppLite.xcodeproj/project.pbxproj
shared/shared.podspec

9
experimental/examples/todoapp-lite/.run/desktop.run.xml → experimental/examples/todoapp-lite/.run/desktopApp.run.xml

@ -1,6 +1,11 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="desktop" type="GradleRunConfiguration" factoryName="Gradle"> <configuration default="false" name="desktopApp" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings> <ExternalSystemSettings>
<option name="env">
<map>
<entry key="DEVELOPER_DIR" value="/Applications/Xcode.app/Contents/Developer" />
</map>
</option>
<option name="executionName" /> <option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" /> <option name="externalSystemIdString" value="GRADLE" />
@ -10,7 +15,7 @@
</option> </option>
<option name="taskNames"> <option name="taskNames">
<list> <list>
<option value=":desktop:run" /> <option value=":desktopApp:run" />
</list> </list>
</option> </option>
<option name="vmOptions" /> <option name="vmOptions" />

8
experimental/examples/todoapp-lite/.run/iosApp.run.xml

@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="iosApp" type="AppleRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="TodoAppLite" TARGET_NAME="TodoAppLite" CONFIG_NAME="Debug" IS_LOCATION_SIMULATION_SUPPORTED="true" SCHEME_NAME="iosApp" IS_LOCATION_SIMULATION_ALLOWED="true" LOCATION_SCENARIO_ID="com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier" LOCATION_SCENARIO_TYPE="1" APPLICATION_LANGUAGE="IDELaunchSchemeLanguageUseSystemLanguage" APPLICATION_REGION="" RUN_TARGET_PROJECT_NAME="TodoAppLite" RUN_TARGET_NAME="TodoAppLite" MAKE_ACTIVE="TRUE" SHOULD_DEBUG_EXTENSIONS="false">
<embedded_app_extension_list />
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

7
experimental/examples/todoapp-lite/.run/iosApp_.run.xml

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="iosApp_" type="KmmRunConfiguration" factoryName="iOS Application" CONFIG_VERSION="1" EXEC_TARGET_ID="9003B6AD-4F7F-48D4-9988-383A8AFC72F5" XCODE_PROJECT="$PROJECT_DIR$/./iosApp/TodoAppLite.xcworkspace" XCODE_CONFIGURATION="Debug" XCODE_SCHEME="iosApp">
<method v="2">
<option name="com.jetbrains.kmm.ios.BuildIOSAppTask" enabled="true" />
</method>
</configuration>
</component>

34
experimental/examples/todoapp-lite/README.md

@ -1,20 +1,30 @@
# TodoApp (lite version)
A simplified version of the [TodoApp example](https://github.com/JetBrains/compose-jb/tree/master/examples/todoapp), fully based on Jetpack Compose and without using any third-party libraries. A simplified version of the [TodoApp example](https://github.com/JetBrains/compose-jb/tree/master/examples/todoapp), fully based on Jetpack Compose and without using any third-party libraries.
Supported targets: Android and Desktop. Supported targets: Android, Desktop and iOS.
### Running desktop application ## How to run
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
### Building native desktop distribution Choose a run configuration for an appropriate target in IDE and run it.
```
./gradlew :desktop:packageDistributionForCurrentOS ![run-configurations.png](run-configurations.png)
# outputs are written to desktop/build/compose/binaries
``` To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID.
Alternatively, you may setup signing within XCode opening `iosApp/TodoAppLite.xcworkspace` and then
using "Signing & Capabilities" tab of `TodoAppLite` target.
### Running Android application Then choose **iosApp** configuration in IDE and run it
(may also be referred as `TodoAppLite` in the Run Configurations or `iosApp_` for Android studio).
Open project in IntelliJ IDEA or Android Studio and run "android" configuration.
## Run on desktop via Gradle
`./gradlew desktopApp:run`
## Building native desktop distribution
```
./gradlew :desktopApp:packageDistributionForCurrentOS
# outputs are written to desktopApp/build/compose/binaries
```
![Desktop](screenshots/todoapplite.png) ![Desktop](screenshots/todoapplite.png)

29
experimental/examples/todoapp-lite/android/build.gradle.kts

@ -1,29 +0,0 @@
plugins {
id("com.android.application")
kotlin("android")
id("org.jetbrains.compose")
}
android {
compileSdk = 32
defaultConfig {
minSdk = 26
targetSdk = 32
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
implementation(project(":common"))
implementation(compose.material)
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.activity:activity-compose:1.5.0")
}

34
experimental/examples/todoapp-lite/androidApp/build.gradle.kts

@ -0,0 +1,34 @@
plugins {
kotlin("multiplatform")
id("com.android.application")
id("org.jetbrains.compose")
}
kotlin {
android()
sourceSets {
val androidMain by getting {
dependencies {
implementation(project(":shared"))
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.activity:activity-compose:1.6.1")
implementation(compose.material)
}
}
}
}
android {
compileSdk = 33
defaultConfig {
applicationId = "org.jetbrains.TodoAppLite"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

0
experimental/examples/todoapp-lite/android/src/main/AndroidManifest.xml → experimental/examples/todoapp-lite/androidApp/src/main/AndroidManifest.xml

6
experimental/examples/todoapp-lite/android/src/main/java/example/todoapp/lite/MainActivity.kt → experimental/examples/todoapp-lite/androidApp/src/main/java/example/todoapp/lite/MainActivity.kt

@ -1,13 +1,11 @@
package example.todoapp.lite package example.todoapp.lite
import MainView
import android.os.Bundle import android.os.Bundle
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface import androidx.compose.material.Surface
import androidx.compose.ui.Modifier
import example.todoapp.lite.common.RootContent
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
@ -17,7 +15,7 @@ class MainActivity : AppCompatActivity() {
setContent { setContent {
MaterialTheme { MaterialTheme {
Surface(color = MaterialTheme.colors.background) { Surface(color = MaterialTheme.colors.background) {
RootContent(modifier = Modifier.fillMaxSize()) MainView()
} }
} }
} }

42
experimental/examples/todoapp-lite/common/build.gradle.kts

@ -1,42 +0,0 @@
plugins {
id("com.android.library")
kotlin("multiplatform")
id("org.jetbrains.compose")
}
kotlin {
android()
jvm("desktop")
sourceSets {
named("commonMain") {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
}
}
}
}
android {
compileSdk = 32
defaultConfig {
minSdk = 26
targetSdk = 32
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
sourceSets {
named("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
res.srcDirs("src/androidMain/res")
}
}
}

10
experimental/examples/todoapp-lite/desktop/build.gradle.kts → experimental/examples/todoapp-lite/desktopApp/build.gradle.kts

@ -1,19 +1,17 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins { plugins {
kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22) kotlin("multiplatform")
id("org.jetbrains.compose") id("org.jetbrains.compose")
} }
kotlin { kotlin {
jvm { jvm {}
withJava()
}
sourceSets { sourceSets {
named("jvmMain") { val jvmMain by getting {
dependencies { dependencies {
implementation(compose.desktop.currentOs) implementation(compose.desktop.currentOs)
implementation(project(":common")) implementation(project(":shared"))
} }
} }
} }

9
experimental/examples/todoapp-lite/desktop/src/jvmMain/kotlin/example/todoapp/lite/Main.kt → experimental/examples/todoapp-lite/desktopApp/src/jvmMain/kotlin/example/todoapp/lite/Main.kt

@ -1,14 +1,13 @@
package example.todoapp.lite package example.todoapp.lite
import androidx.compose.foundation.layout.fillMaxSize import MainView
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.WindowPosition import androidx.compose.ui.window.WindowPosition
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState import androidx.compose.ui.window.rememberWindowState
import example.todoapp.lite.common.RootContent
fun main() { fun main() {
application { application {
@ -20,9 +19,7 @@ fun main() {
), ),
) { ) {
MaterialTheme { MaterialTheme {
RootContent( MainView()
modifier = Modifier.fillMaxSize()
)
} }
} }
} }

33
experimental/examples/todoapp-lite/gradle.properties

@ -1,24 +1,17 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official kotlin.code.style=official
xcodeproj=./iosApp
kotlin.native.cocoapods.generate.wrapper=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.enableGranularSourceSetsMetadata=true
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.7.20 kotlin.version=1.7.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.2.1 compose.version=1.2.1

1
experimental/examples/todoapp-lite/iosApp/Configuration/TeamId.xcconfig

@ -0,0 +1 @@
TEAM_ID=

5
experimental/examples/todoapp-lite/iosApp/Podfile

@ -0,0 +1,5 @@
target 'TodoAppLite' do
use_frameworks!
platform :ios, '14.1'
pod 'shared', :path => '../shared'
end

380
experimental/examples/todoapp-lite/iosApp/TodoAppLite.xcodeproj/project.pbxproj

@ -0,0 +1,380 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
2152FB042600AC8F00CF470E /* iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iosApp.swift */; };
C1FC908188C4E8695729CB06 /* Pods_TodoAppLite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE96E47030356CE6AD9794A /* Pods_TodoAppLite.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1EB65E27D2C0F884D0A1A133 /* Pods-TodoAppLite.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TodoAppLite.debug.xcconfig"; path = "Target Support Files/Pods-TodoAppLite/Pods-TodoAppLite.debug.xcconfig"; sourceTree = "<group>"; };
2152FB032600AC8F00CF470E /* iosApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iosApp.swift; sourceTree = "<group>"; };
3D7A606AB0AD7636269BD9D0 /* Pods-TodoAppLite.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TodoAppLite.release.xcconfig"; path = "Target Support Files/Pods-TodoAppLite/Pods-TodoAppLite.release.xcconfig"; sourceTree = "<group>"; };
7555FF7B242A565900829871 /* TodoAppLite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TodoAppLite.app; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DE96E47030356CE6AD9794A /* Pods_TodoAppLite.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TodoAppLite.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AB3632DC29227652001CCB65 /* TeamId.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TeamId.xcconfig; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
9964867F0862B4D9FB6ABFC7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C1FC908188C4E8695729CB06 /* Pods_TodoAppLite.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
7555FF72242A565900829871 = {
isa = PBXGroup;
children = (
AB1DB47929225F7C00F7AF9C /* Configuration */,
7555FF7D242A565900829871 /* iosApp */,
7555FF7C242A565900829871 /* Products */,
E1DAFBE8E1CFC0878361EF0E /* Pods */,
B62309C7396AD7BF607A63B2 /* Frameworks */,
);
sourceTree = "<group>";
};
7555FF7C242A565900829871 /* Products */ = {
isa = PBXGroup;
children = (
7555FF7B242A565900829871 /* TodoAppLite.app */,
);
name = Products;
sourceTree = "<group>";
};
7555FF7D242A565900829871 /* iosApp */ = {
isa = PBXGroup;
children = (
7555FF8C242A565B00829871 /* Info.plist */,
2152FB032600AC8F00CF470E /* iosApp.swift */,
);
path = iosApp;
sourceTree = "<group>";
};
AB1DB47929225F7C00F7AF9C /* Configuration */ = {
isa = PBXGroup;
children = (
AB3632DC29227652001CCB65 /* TeamId.xcconfig */,
);
path = Configuration;
sourceTree = "<group>";
};
B62309C7396AD7BF607A63B2 /* Frameworks */ = {
isa = PBXGroup;
children = (
8DE96E47030356CE6AD9794A /* Pods_TodoAppLite.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
E1DAFBE8E1CFC0878361EF0E /* Pods */ = {
isa = PBXGroup;
children = (
1EB65E27D2C0F884D0A1A133 /* Pods-TodoAppLite.debug.xcconfig */,
3D7A606AB0AD7636269BD9D0 /* Pods-TodoAppLite.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
7555FF7A242A565900829871 /* TodoAppLite */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "TodoAppLite" */;
buildPhases = (
E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */,
7555FF77242A565900829871 /* Sources */,
7555FF79242A565900829871 /* Resources */,
9964867F0862B4D9FB6ABFC7 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = TodoAppLite;
productName = iosApp;
productReference = 7555FF7B242A565900829871 /* TodoAppLite.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
7555FF73242A565900829871 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1130;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = org.jetbrains;
TargetAttributes = {
7555FF7A242A565900829871 = {
CreatedOnToolsVersion = 11.3.1;
};
};
};
buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "TodoAppLite" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 7555FF72242A565900829871;
productRefGroup = 7555FF7C242A565900829871 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
7555FF7A242A565900829871 /* TodoAppLite */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
7555FF79242A565900829871 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
E8D673591E7196AEA2EA10E2 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-TodoAppLite-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
7555FF77242A565900829871 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2152FB042600AC8F00CF470E /* iosApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
7555FFA3242A565B00829871 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
7555FFA4242A565B00829871 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AB3632DC29227652001CCB65 /* TeamId.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
7555FFA6242A565B00829871 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1EB65E27D2C0F884D0A1A133 /* Pods-TodoAppLite.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "${TEAM_ID}";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.TodoAppLite${TEAM_ID}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
7555FFA7242A565B00829871 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D7A606AB0AD7636269BD9D0 /* Pods-TodoAppLite.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "${TEAM_ID}";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.TodoAppLite${TEAM_ID}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
7555FF76242A565900829871 /* Build configuration list for PBXProject "TodoAppLite" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7555FFA3242A565B00829871 /* Debug */,
7555FFA4242A565B00829871 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "TodoAppLite" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7555FFA6242A565B00829871 /* Debug */,
7555FFA7242A565B00829871 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 7555FF73242A565900829871 /* Project object */;
}

48
experimental/examples/todoapp-lite/iosApp/iosApp/Info.plist

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
</dict>
<key>UILaunchScreen</key>
<dict/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

15
experimental/examples/todoapp-lite/iosApp/iosApp/iosApp.swift

@ -0,0 +1,15 @@
import UIKit
import shared
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
let mainViewController = Main_iosKt.MainViewController()
window?.rootViewController = mainViewController
window?.makeKeyAndVisible()
return true
}
}

BIN
experimental/examples/todoapp-lite/run-configurations.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
experimental/examples/todoapp-lite/screenshots/desktop-run-configuration.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

6
experimental/examples/todoapp-lite/settings.gradle.kts

@ -19,4 +19,8 @@ pluginManagement {
} }
} }
include(":common", ":android", ":desktop") rootProject.name = "todoapp-lite"
include(":androidApp")
include(":shared")
include(":desktopApp")

63
experimental/examples/todoapp-lite/shared/build.gradle.kts

@ -0,0 +1,63 @@
plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
id("com.android.library")
id("org.jetbrains.compose")
}
version = "1.0-SNAPSHOT"
kotlin {
android()
jvm("desktop")
ios()
iosSimulatorArm64()
cocoapods {
summary = "Shared code for the sample"
homepage = "https://github.com/JetBrains/compose-jb"
ios.deploymentTarget = "14.1"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
}
}
val androidMain by getting
val iosMain by getting
val iosTest by getting
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
}
val iosSimulatorArm64Test by getting {
dependsOn(iosTest)
}
val desktopMain by getting
}
}
android {
compileSdk = 33
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources")
defaultConfig {
minSdk = 24
targetSdk = 33
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

0
experimental/examples/todoapp-lite/common/src/androidMain/AndroidManifest.xml → experimental/examples/todoapp-lite/shared/src/androidMain/AndroidManifest.xml

0
experimental/examples/todoapp-lite/common/src/androidMain/kotlin/example/todoapp/lite/common/Utils.kt → experimental/examples/todoapp-lite/shared/src/androidMain/kotlin/example/todoapp/lite/common/Utils.kt

6
experimental/examples/todoapp-lite/shared/src/androidMain/kotlin/main.android.kt

@ -0,0 +1,6 @@
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import example.todoapp.lite.common.RootContent
@Composable fun MainView() = RootContent(Modifier.fillMaxSize())

0
experimental/examples/todoapp-lite/common/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml → experimental/examples/todoapp-lite/shared/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml

0
experimental/examples/todoapp-lite/common/src/androidMain/res/drawable/ic_launcher_background.xml → experimental/examples/todoapp-lite/shared/src/androidMain/res/drawable/ic_launcher_background.xml

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-hdpi/ic_launcher.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-hdpi/ic_launcher.png

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-mdpi/ic_launcher.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-mdpi/ic_launcher.png

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-xhdpi/ic_launcher.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xhdpi/ic_launcher.png

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png → experimental/examples/todoapp-lite/shared/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
experimental/examples/todoapp-lite/common/src/androidMain/res/values/strings.xml → experimental/examples/todoapp-lite/shared/src/androidMain/res/values/strings.xml

0
experimental/examples/todoapp-lite/common/src/commonMain/kotlin/example/todoapp/lite/common/EditDialog.kt → experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/EditDialog.kt

0
experimental/examples/todoapp-lite/common/src/commonMain/kotlin/example/todoapp/lite/common/MainContent.kt → experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/MainContent.kt

2
experimental/examples/todoapp-lite/common/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt → experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt

@ -6,7 +6,7 @@ import androidx.compose.ui.Modifier
import example.todoapp.lite.common.RootStore.RootState import example.todoapp.lite.common.RootStore.RootState
@Composable @Composable
fun RootContent(modifier: Modifier = Modifier) { internal fun RootContent(modifier: Modifier = Modifier) {
val model = remember { RootStore() } val model = remember { RootStore() }
val state = model.state val state = model.state

0
experimental/examples/todoapp-lite/common/src/commonMain/kotlin/example/todoapp/lite/common/RootStore.kt → experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootStore.kt

0
experimental/examples/todoapp-lite/common/src/commonMain/kotlin/example/todoapp/lite/common/TodoItem.kt → experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/TodoItem.kt

0
experimental/examples/todoapp-lite/common/src/commonMain/kotlin/example/todoapp/lite/common/Utils.kt → experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/Utils.kt

0
experimental/examples/todoapp-lite/common/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt → experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/example/todoapp/lite/common/Utils.kt

6
experimental/examples/todoapp-lite/shared/src/desktopMain/kotlin/main.desktop.kt

@ -0,0 +1,6 @@
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import example.todoapp.lite.common.RootContent
@Composable fun MainView() = RootContent(Modifier.fillMaxSize())

32
experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/example/todoapp/lite/common/Utils.kt

@ -0,0 +1,32 @@
package example.todoapp.lite.common
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
internal actual val MARGIN_SCROLLBAR: Dp = 0.dp
internal actual interface ScrollbarAdapter
@Composable
internal actual fun rememberScrollbarAdapter(scrollState: LazyListState): ScrollbarAdapter =
object : ScrollbarAdapter {}
@Composable
internal actual fun VerticalScrollbar(
modifier: Modifier,
adapter: ScrollbarAdapter
) {
// no-op
}
@Composable
internal actual fun Dialog(
title: String,
onCloseRequest: () -> Unit,
content: @Composable () -> Unit
) = Unit

26
experimental/examples/todoapp-lite/shared/src/iosMain/kotlin/main.ios.kt

@ -0,0 +1,26 @@
/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Application
import example.todoapp.lite.common.RootContent
import platform.UIKit.UIViewController
fun MainViewController() : UIViewController =
Application("Todo") {
Column {
// To skip upper part of screen.
Box(
modifier = Modifier
.height(30.dp)
)
RootContent(modifier = Modifier.fillMaxSize())
}
}
Loading…
Cancel
Save