Using ASM to handle Android's click debounce
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
art
buildSrc
click-debounce-gradle-plugin
click-debounce-lib-android
click-debounce-lib-java
click-debounce-sample
gradle/wrapper
runtime @ 9cedd85
.gitignore
.gitmodules
LICENSE
README.md
build-sample.sh
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

README.md

asm-clickdebounce

It is a gradle plugin that uses bytecode weaving technology to solve the click debounce problem of Android applications.

Safe, efficient, easy to use, support incremental build to avoid waste of build time.

I also wrote a blog to share my ideas to solve the click debounce.

Note: This repository is just a gradle plugin, responsible for bytecode weaving work, Android runtime library please move here.

Requirements

  • JDK 1.7 +
  • Gradle 3.0.0 +

To build

$ git clone git@github.com:SmartDengg/asm-clickdebounce.git
$ cd asm-clickdebounce/
$ ./gradlew build

Getting Started

Step 1. Add the JitPack repository and the plugin to your buildscript:

buildscript {

    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        ...
        classpath 'com.github.SmartDengg.asm-clickdebounce:click-debounce-gradle-plugin:1.0.0'
    }
}

Step 2. Apply it in your module:

It supports 'com.android.application', 'com.android.library' and 'com.android.feature'.

apply plugin: 'smartdengg.clickdebounce'
// or apply plugin: 'clickdebounce'

Step 3 (Optional). Enable logging by adding the following code to your build.gradle:

debounce.loggable = true

How it works

Will not intercept the touch event delivery, only intercepted in the callback of the click event, so that it will not be passed to the business logic.

Support

R8 / ProGuard (Not Required)

Pure bytecode weaving without any reflections. No Proguard rules are required.

Bugs and Feedback

For bugs, feature requests, and discussion please use GitHub Issues. Or send email to hi4joker@gmail.com.

Found this project useful

❤️ Hope this article can help you. Support by clicking the ⭐️, or share it with people around you. ❤️

About me

email : hi4joker@gmail.com

blog : 小鄧子

weibo : -小鄧子-

License

See the LICENSE file for license rights and limitations (MIT).