Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Compose Multiplatform Support#1208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
blakelee wants to merge15 commits intomain
base:main
Choose a base branch
Loading
fromblakelee/kmp-compose
Draft

Conversation

blakelee
Copy link

@blakeleeblakelee commentedJun 28, 2024
edited
Loading

Overview

This pull request add Kotlin Multiplatform (KMP) support for theworkflow-ui:compose module. Some of the most notable changes are thebuild.gradle.kts configurations and changing/adding targets e.g.androidMain vsmain

Note that this PR also uses a commit from@MilanJovic92#1185. The bulk of this PR is simply copying that module over. The changes I made will cut the PR size in half.

All of the iOS target UI tests pass. Tests that contained Android code (View and Dialog) were removed for iOS but retained for Android.

The Compose samples have also been update to support iOS. Due to some limitations, the samples that use the Preview aren't shown as well any that used Android specific code. All of the Android code works the same as before.

While not tested, this should also work for Desktop and JS 🎉

Considerations

  • Compose Multiplatform release cycles are different than Jetpack Compose Android so we may just want to make a new package in:workflow-ui:compose-multiplatform

The gap between a Compose Multiplatform release and a Jetpack Compose release is usually 1–3 months.

Fromhere

  • Support for multiplatform besides Android is probably going to have to be community maintained since it's not in use at Square
  • The minimal Kotlin version needed for this to work is1.9.24 which is higher than what we had before. This is due to needing Jetbrains version of lifecycle which just recently released in May 2024.

EDIT: It looks like the above may not be true after getting this message from the KMP team hereJetBrains/compose-multiplatform#5047 (comment)

Todo

  • There's not native back handling so it needs to be done manually. I have a sample implementation in the compose-samples for how to do this for multiplatform.
  • The iOS dialog equivalent is not supported, this is pure Kotlin Multiplatform code
  • The snapshot saving functions are only available in Android
  • There could be a lot more work on the gradle plugins which is why you see my apply stuff from the toml
  • Thecompose-ui-tooling package needs to be updated for KMP support but can be done pretty trivially
  • The publish plugins are commented out because I don't know how to do that and it made my syncs fail whenever I changed anything
  • I addedhttps://github.com/autonomousapps/dependency-analysis-gradle-plugin for doing project health but this will be removed if this project ever goes anywhere.

Here is a demo of the compose-samples working

Simulator.Screen.Recording.-.iPhone.15.-.2024-06-28.at.13.47.18.mp4

Notes

Some UI tests are failing due to an issue with LeakCanary and Google. Seehere. The issue is fixed with Lifecycle 2.8.2 but Jetbrains hasn't updated their version of Lifecycle to match it.

@CLAassistant
Copy link

CLAassistant commentedJun 28, 2024
edited
Loading

CLA assistant check
All committers have signed the CLA.

blakeleeand others added5 commitsJune 28, 2024 20:52
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zach-klippensteinzach-klippensteinAwaiting requested review from zach-klippensteinzach-klippenstein will be requested when the pull request is marked ready for reviewzach-klippenstein is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@blakelee@CLAassistant@MilanJovic92@RBusarow

[8]ページ先頭

©2009-2025 Movatter.jp