Package-level declarations

Types

Link copied to clipboard

Activity的路由器,和ActivityRouterLauncher配合可实现从compose跳转到Activity并获取activity的返回值

Link copied to clipboard

Activity路由器的分配器

Link copied to clipboard
abstract class BackInterceptor(isEnabled: Boolean)
Link copied to clipboard
Link copied to clipboard
data object ClearTaskFlag : StackFlag

清空当前栈

Link copied to clipboard
data object NormalFlag : RouteFlag

正常

Link copied to clipboard
class ResultCallBack(lifecycleOwnerDelegate: LifecycleOwnerDelegate)
Link copied to clipboard
class RouteBuilder(currentWindowId: String = Constants.DEFAULT_WINDOW)

路由构建类,用于构建路由到下一个页面所需的一些数据:参数,回调等。

Link copied to clipboard
sealed interface RouteFlag

路由的一些标识,可以指导路由期间内部的一些变化。

Link copied to clipboard
typealias RouteResult = (Bundle) -> Unit
Link copied to clipboard
Link copied to clipboard
sealed interface StackFlag : RouteFlag

回退栈类型的flag

Functions

Link copied to clipboard
fun BackHandler(enabled: Boolean = true, onBack: BackPressedHandler.() -> Unit = {})

后退拦截器

Link copied to clipboard
fun Exit(enable: MutableState<Boolean> = mutableStateOf(true), delayTime: Duration = 1000.milliseconds, block: @Composable () -> Unit = {})

退出

Link copied to clipboard
inline fun <T> getBasicData(value: Any): T?

转换数据,如果不是基础数据类型或无法转换则返回null

Link copied to clipboard
fun ActivityRouter<Intent, ActivityResult>.intent(activityKClass: KClass<out Activity>, block: Intent.() -> Unit = {}): Intent

获取Intent

Link copied to clipboard
fun isBasic(value: Any): Boolean

是否是基础数据类型

Link copied to clipboard
fun <I, O> Register.platformRoute(address: String, contract: ActivityResultContract<I, O>, block: (ActivityRouter<I, O>) -> Unit)

注册路由到activity的部分

fun Register.platformRoute(address: String, target: UIViewController)
fun Register.platformRoute(address: String, url: String, target: String = "", features: String = "")
Link copied to clipboard
Link copied to clipboard
fun <I, O> ActivityRouter<I, O>.route(input: I, block: Bundle.(O) -> Unit = {})

fun ActivityRouter<Intent, ActivityResult>.route(activityKClass: KClass<out Activity>, block: Intent.() -> Unit = {})

简化单Activity跳转以及其返回值配置

Link copied to clipboard
fun routeBuild(route: String, optionsBuilder: RouteBuilder.() -> Unit = {}): Route

构建路由的方法

Link copied to clipboard
fun Register.setting(address: String, setting: String, intentBody: Intent.(Bundle) -> Unit = {})

设置跳转setting界面

Link copied to clipboard
fun Register.startActivity(address: String, activityKClass: KClass<out Activity>, intentBody: Intent.(Bundle) -> Unit = {}, block: Bundle.(ActivityResult) -> Unit = { it.data?.extras?.let { putAll(it) } })

打开activity

Link copied to clipboard
actual fun SysBackPressed(body: () -> Unit)
expect fun SysBackPressed(body: () -> Unit)

平台的后退实现

actual fun SysBackPressed(body: () -> Unit)
actual fun SysBackPressed(body: () -> Unit)
actual fun SysBackPressed(body: () -> Unit)
Link copied to clipboard
fun List<Pair<String, String>>.toBundle(): Bundle