KComponent
KComponent copied to clipboard
A powerful componentized framework.一个强大、100% 兼容、支持 AndroidX、支持纯 Kotlin并且灵活的组件化框架
[OpenOnceInterceptor.kt#L37](https://github.com/xiaojinzi123/KComponent/blob/363d4caa9161b34d460fcb3544794c4251e85903/ComponentImpl/src/main/java/com/xiaojinzi/component/impl/interceptor/OpenOnceInterceptor.kt#L37) ```kotlin val currentTime = System.currentTimeMillis() // 如果把系统时间修改到当前时间之前,这里会一直 throw NavigationException if (map.containsKey(hostAndPath) && currentTime - map[hostAndPath]!! < requiredConfig().routeRepeatCheckDuration) { throw NavigationException("same request can't launch twice in a second, target uri...
KComponent 支持 Jetpack Compose 导航么
``` @InterceptorAnno(CommonConst.INTERCEPTOR_USER_LOGIN) class LoginInterceptor(context: Context) : RouterInterceptor { @Inject lateinit var userDataRepository: UserDataRepository init { LoginInterceptorEntryPoint.resolve(context).inject(this) } override suspend fun intercept(chain: RouterInterceptor.Chain): RouterResult { if(!userDataRepository.isLogin()) { val context = chain.request().rawAliveContext!!...
新建了个项目,默认是kts脚本的,项目的build.gradle.kts只有 plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.jetbrains.kotlin.android) apply false } 老用法build.gradle是: buildscript { dependencies { classpath "com.android.tools.build:gradle:7.4.2" classpath "com.xiaojinzi.kcomponent:kcomponent-plugin:1.0.0-beta1" } } 请问:如何在项目的build.gradle.kts中引入 "com.xiaojinzi.kcomponent:kcomponent-plugin:1.0.0-beta1"
用了ksp,那个自动生成的代码,会自动消失 ksp { arg("ModuleName", project.name) } 每个模块都用了这个,然后初始化: Component.init( application = BaseApplication.app, isDebug = BuildConfig.DEBUG, config = Config.Builder() .optimizeInit(isOptimizeInit = true) .autoRegisterModule(isAutoRegisterModule = true) .build() ) 最开始尝试自动手动注册,失败,现在改成这个自动注册,还是一样,这里自动注册,那个classpath配置过插件。就是那个生成的com.xiaojinzi.component.`impl`这个override fun initRouterList(): List {这里面,第一次有内容,然后再启动一次,里面的东西就没了,真是神奇的代码,然后淡然,从第一次那个路由就没成功跳转过,我是从launch页使用Router的forward想跳转login页面,login用@RouterAnno(hostAndPath...