Skip to content

A demo to show usage of Jetbrains Compose in Android and iOS.

License

Notifications You must be signed in to change notification settings

LouisWoong/multiplatform-compose

Repository files navigation

Kotlin Multiplatform

⚠️ This PoC compile on iOS and Android but I've remove some functionality because Compose changed too much since I started it. I will update it using the compose compiler when it will be possible. There are some hope on the way :

I've started to experiment with Compose Native, you can have a look at https://github.com/cl3m/kmp-redux/tree/skiko on iOS two views are SwiftUI and two views are Compose (ComposeSpaceView & ComposeCounterView) and share the same store.

Multiplatform Compose

A demo to show usage of Jetpack Compose in Android and iOS. Originally a Jetpack Compose implementation with native view and yoga.

Table of contents

Requirements

  • Android Studio
  • Xcode
  • cocoapods (gem install cocoapods)

Libraries

  • kotlinx coroutines
  • kotlinx serialization
  • ktor
  • jetbrain compose (uikit experimental)
  • Precompose (for navigation)

Demos

Run the app to see a demo of compose on ios.

Demos

AsyncImage

The image composable allow url loading

AsyncImage(url = "https://loremflickr.com/320/240/ocean", modifier = Modifier.preferredSize(200.dp))

SafeArea

SafeArea.current context with PaddingValues.

Troubleshooting

e: java.lang.IllegalStateException: No file for ***

Compose function and context has to be internal and not exposed to iOS module.

Sponsors

No one yet, be the first sponsor!

Contributing

All development (both new features and bug fixes) is performed in the develop branch. This way master always contains the sources of the most recently released version. Use git-flow if possible.

You can start a PR with incomplete implementation to shows what you are working on. Please send PRs with bug fixes or new features to the develop branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in master.

The develop branch is pushed to master on release.

License

Copyright 2021 Clément Beffa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A demo to show usage of Jetbrains Compose in Android and iOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 89.3%
  • Swift 6.3%
  • Ruby 4.4%