Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.23 KB

setup.md

File metadata and controls

34 lines (25 loc) · 1.23 KB

Setup

Add Dependency

Maven Central

Add the dependency in your common module's commonMain sourceSet

// Please do remember to add compose.foundation and compose.animation
api(compose.foundation)
api(compose.animation)
//...
api("moe.tlaster:precompose:$precompose_version")

// api("moe.tlaster:precompose-molecule:$precompose_version") // For Molecule intergration 

// api("moe.tlaster:precompose-viewmodel:$precompose_version") // For ViewModel intergration

Android

Change the Activity's parent class to moe.tlaster.precompose.lifecycle.PreComposeActivity and use moe.tlaster.precompose.lifecycle.setContent for setting compose content

Desktop (JVM)

Change the Window to moe.tlaster.precompose.PreComposeWindow

iOS

Set the UIWindow.rootViewController to PreComposeApplication

Native macOS

Change the Window to moe.tlaster.precompose.PreComposeWindow

Web (Canvas)

Change the Window to moe.tlaster.precompose.preComposeWindow

Done!

That's it! Enjoying the PreCompose! Now you can write all your business logic and ui code in commonMain