WngYilei / Shield

字节码插桩实现方法防抖,是方法防抖不是点击防抖

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shield

通过字节码插桩的方式,实现的方法防抖方案。

使用:

1.在项目根目录的build.gradle 中引入插件

 classpath 'com.github.WngYilei.Shield:shieldplugin:1.0.9'

2.在需要使用的moudle 中应用插件:

apply plugin: 'shield-plugin'

3.添加工具依赖

implementation 'com.github.WngYilei.Shield:shieldlib:1.0.9'

4.在需要进行防抖的方法上面加入注解:

@ShieldAnnotation(key = "test",time = 200)
fun test(){

}

key是用来识别方法的唯一key值,time 是防抖时间,规定时间内不可以重复执行。

联系方式:

wangyilei0318@gmail.com

About

字节码插桩实现方法防抖,是方法防抖不是点击防抖


Languages

Language:Kotlin 83.1%Language:Java 16.9%