Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
WIP

Muhammet Ali Yuce mayuce

💻
WIP
View GitHub Profile
View RouterModule.kt
package com.some.thing.di
import android.util.SparseArray
import com.some.thing.routing.Routable
import com.some.thing.feature_main.MainRouter
import com.some.thing.feature_boarding.BoardingRouter
import com.some.thing.feature_login.LoginRouter
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
View ModularRouter.kt
package com.some.thing.routing
import android.content.Context
import android.net.Uri
import android.util.SparseArray
import androidx.core.util.forEach
import javax.inject.Inject
class Router @Inject constructor(
private val routes: SparseArray<Routable<*, *>>
View MainRouter.kt
package com.some.thing.routerdata
import com.some.thing.routing.RouterData
import kotlinx.android.parcel.Parcelize
@Parcelize
data class MainRouterData(
val userId: Int?
) : RouterData {
companion object {
View MainRouter.kt
package com.some.thing.feature_main
import android.content.Context
import android.net.Uri
import com.some.thing.common.routerdata.MainRouterData
import com.some.thing.routing.Routable
import com.some.thing.feature_main.presentation.MainActivity
class MainRouter {
companion object : Routable<MainActivity, MainRouterData> {
View ModularRoutable.kt
package com.some.thing.routing
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Parcelable
import android.util.Log
import com.some.thing.ui.BaseActivity
/**
View SplashActivity.kt
package com.some.package.ui.splash.presentation
import ....
class SplashActivity :
BaseActivity<*, *>() {
companion object {
private const val DEEP_LINK_FUNCTION_ID = "functionId"
}
View Router.kt
package com.some.package.base.routing
import android.content.Context
import android.net.Uri
import com.some.package.routing.Routable
import com.some.package.router.MovieDetailRouter
class Router {
companion object {
View MovieDetailRouter.kt
package com.some.package.router
import android.content.Context
import android.net.Uri
import android.os.Parcelable
import android.widget.Toast
import com.some.package.routing.Routable
import com.some.package.ui.moviedetail.presentation.MovieDetailActivity
import kotlinx.android.parcel.Parcelize
View Routable.kt
package com.some.package.routing
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Parcelable
import com.some.package.ui.BaseActivity
/**
* Routable implementation provides usage of navigation between activities