Skip to content

Instantly share code, notes, and snippets.

View egorikftp's full-sized avatar
😼
Hire me

Yahor egorikftp

😼
Hire me
  • EPAM
  • 16:00 (UTC +03:00)
View GitHub Profile
@egorikftp
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? {