You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Arkadii Ivanov d457a520d7
TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191)
2 years ago
..
.run examples README and .run configurations (#2355) 2 years ago
android TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
buildSrc TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
common TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
desktop Fix Todo example (#2391) 2 years ago
gradle/wrapper TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
ios TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
kotlin-js-store TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
screenshots Fix examples, templates (#2359) 2 years ago
web TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
.gitignore Unify .gitignore across all examples and templates 4 years ago
README.md Replace package by packageDistributionForCurrentOS (#2390) 2 years ago
build.gradle.kts TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
gradle.properties TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
gradlew TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
gradlew.bat TodoApp. Updated Kotlin to 1.7.10, Compose to 1.2.0, and other libs. (#2191) 2 years ago
settings.gradle.kts Add web app for the TodoApp example (#778) 4 years ago

README.md

An example of Kotlin Multiplatform todo app with shared Android/Desktop Compose UI and SwiftUI (not Compose) iOS.

This example supports the following targets:

  • Android (Compose)
  • Desktop/JVM (Compose)
  • Web/JavaScript (Compose)
  • iOS (SwiftUI, not Compose)

Libraries used:

  • Jetpack Compose - shared UI
  • Decompose - navigation and lifecycle
  • MVIKotlin - presentation and business logic
  • Reaktive - background processing and data transformation
  • SQLDelight - data storage

There are multiple modules:

  • :common:utils - just some useful helpers
  • :common:database - SQLDelight database definition
  • :common:main - displays a list of todo items and a text field
  • :common:edit - accepts an item id and allows editing
  • :common:root - navigates between main and edit screens
  • :common:compose-ui - Shared Compose UI for Android and Desktop
  • :android - Android application
  • :desktop - Desktop application
  • :web - Web browser application + Compose Web UI
  • ios - iOS Xcode project

The root module is integrated into Android, Desktop and iOS (non-Compose) apps.

Features:

  • 99% of the code is shared: data, business logic, presentation, navigation and UI
  • View state is preserved when navigating between screens, Android configuration change, etc.
  • Model-View-Intent (aka MVI) architectural pattern
  • Pluggable UI - Compose UI for Android, Desktop and Web, SwiftUI (not Compose) for iOS

Running desktop application

  • To run, launch command: ./gradlew :desktop:run
  • Or choose desktop configuration in IDE and run it.
    desktop-run-configuration.png

Building native desktop distribution

./gradlew :desktop:packageDistributionForCurrentOS
# outputs are written to desktop/build/compose/binaries

Running Android application

Open project in Intellij IDEA or Android Studio and run "android" configuration.

Running Web browser application

  • To run, launch command: ./gradlew :web:jsBrowserDevelopmentRun
  • Or choose browser configuration in IDE and run it.
    browser-run-configuration.png

Running iOS application

Open and build the Xcode project located in ios folder.

Desktop