entry | entry-annotation | entry-compiler |
---|---|---|
Quickly create entrances for debugging various functions
###如何使用
1.在 build.gradle 文件中 添加依赖
#####kotlin
apply plugin: 'com.google.devtools.ksp'
.....
.....
dependencies {
implementation 'io.github.caldremch:entry:1.6.3'
ksp 'io.github.caldremch:entry-compiler:1.6.3'
}
dependencies {
implementation 'io.github.caldremch:entry:1.6.3'
annotationProcessor 'io.github.caldremch:entry-compiler:1.6.2'
}
2.创建入口
@Entry
class AEntry : IEntry{
override fun getTitle(): String {
return "AEntry"
}
override fun onClick(context: Context) {
Toast.makeText(context, "it a entry", Toast.LENGTH_SHORT).show()
}
}
3.配置入口Activity
<activity android:name="com.caldremch.android.entry.EntryActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Ok.
1.auto-service对kotlin项目不生效, 需要手动配置
在src/main/
创建 resources/META-INF/services/javax.annotation.processing.Processor
同时在javax.annotation.processing.Processor文件中加上
包名.注解器名字