Skip to content

Instantly share code, notes, and snippets.

View micadasystems's full-sized avatar

micadasystems

View GitHub Profile
@micadasystems
micadasystems / ThrottledOnClickListener.kt
Last active October 9, 2020 07:30 — forked from tieorange/ThrottledOnClickListener.kt
A debounced onClickListener for Android
package com.westwingnow.android.utils
import android.os.SystemClock
import android.view.View
import java.util.*
/**
* A Throttled OnClickListener
* Rejects clicks that are too close together in time.
* This class is safe to use as an OnClickListener for multiple views, and will throttle each one separately.