Skip to content

Instantly share code, notes, and snippets.

View egorikftp's full-sized avatar
What are you doing in my Github?

Yahor egorikftp

What are you doing in my Github?
View GitHub Profile
egorikftp / KmmDsl.kt
Last active April 19, 2022 11:42
KMM extensions for sourceSets
import org.gradle.api.NamedDomainObjectContainer
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
typealias SourceSets = NamedDomainObjectContainer<KotlinSourceSet>
fun SourceSets.androidMain(setup: KotlinSourceSet.() -> Unit) = kotlinSourceSet("androidMain", setup)
fun SourceSets.commonMain(setup: KotlinSourceSet.() -> Unit) = kotlinSourceSet("commonMain", setup)
fun SourceSets.jvmMain(setup: KotlinSourceSet.() -> Unit) = kotlinSourceSet("jvmMain", setup)
open class CustomNavigator(
activity: FragmentActivity?,
containerId: Int
) : SupportAppNavigator(activity, containerId) {
override fun createActivityIntent(context: Context?, screenKey: String?, data: Any?): Intent? {
return (data as? Screen)?.let { createActivityIntent(context, it) }
override fun createFragment(screenKey: String?, data: Any?): Fragment? {