Bekzod
02/20/2024, 8:46 AMBekzod
02/20/2024, 8:48 AMandroidMain
directory, while keeping shared feature code in the commonMain
directory, could you share any tips or best practices for achieving this structure?
Thank you!Joel Denke
02/20/2024, 9:06 AMBekzod
02/20/2024, 10:33 AMMaxime Vince
02/20/2024, 10:33 AMMaxime Vince
02/20/2024, 10:33 AMChanjung Kim
02/20/2024, 10:35 AMis it possible to have Android-specific screens within theYes, it is possibledirectory, while keeping shared feature code in theandroidMain
directorycommonMain
Bekzod
02/20/2024, 10:35 AMChanjung Kim
02/20/2024, 10:37 AMiosArm64
, androidTarget
, etc.) When you build your app or library for a specific target, sourceSets that is not included in the target is not compiled.Joel Denke
02/20/2024, 10:38 AM@CommonParcelize
data object LoginScreen: MyScreen {
override val name: String = "Login()"
override val arguments: ScreenArguments? = null
override fun requireLogin(): Boolean = false
}
ScreenArguments here is just typealias for Map<Enum, Any?>
Put this into core module so all modules knows what each screen represents.
And yes can mix between commonMain, iosMain, androidMain etc. I recommend however if you can having all in commonMain if you can πChanjung Kim
02/20/2024, 10:38 AMcommonMain
is always compiled for any targets, so you can put the common logic to commonMain
and put Android-specific code to androidMain
(even activities!), and put iOS-specific code to iosMain
.Joel Denke
02/20/2024, 10:39 AMJoel Denke
02/20/2024, 10:40 AMJoel Denke
02/20/2024, 10:42 AMBekzod
02/20/2024, 10:43 AMJoel Denke
02/20/2024, 10:45 AMBekzod
02/20/2024, 10:47 AMJoel Denke
02/20/2024, 12:52 PMBekzod
02/20/2024, 1:20 PMJoel Denke
02/20/2024, 1:27 PMMaxime Vince
02/20/2024, 3:00 PMJoel Denke
02/20/2024, 3:01 PMMaxime Vince
02/21/2024, 9:30 AMBekzod
03/11/2024, 7:46 AM