RouteTo - VerstSiu/kotlin_extension GitHub Wiki

API List

package com.ijoic.ktx.content.router

/*
 * Route methods
 */
fun Context.routeTo(action: String[, onError: ((Context, Throwable) -> Unit)?])
fun Context.routeTo(intent: Intent[, onError: ((Context, Throwable) -> Unit)?])

Usage

context.routeTo(Actions.signIn)
context.routeTo(Intent(Actions.signIn))

Customize

  • change default error behaviour:

    Router.onRouteError = { context, error ->
      context.showToast("Feature developing")
    }