aboutsummaryrefslogtreecommitdiff
path: root/adapter/src/main/kotlin/ca
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-12-27 00:24:37 -0500
committerAllan Wang <me@allanwang.ca>2017-12-27 00:24:37 -0500
commit196a29b88bc2e1e464f4aa01ae5b0677f5067ee5 (patch)
tree935268d301e81345a0a23cca1039b2f5f4141417 /adapter/src/main/kotlin/ca
parentbbaddee2ed4c5f2e534683d9687392d254c37d67 (diff)
downloadkau-196a29b88bc2e1e464f4aa01ae5b0677f5067ee5.tar.gz
kau-196a29b88bc2e1e464f4aa01ae5b0677f5067ee5.tar.bz2
kau-196a29b88bc2e1e464f4aa01ae5b0677f5067ee5.zip
Improve repeated click listener
Diffstat (limited to 'adapter/src/main/kotlin/ca')
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt3
1 files changed, 1 insertions, 2 deletions
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
index d864a55..5925454 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
@@ -40,11 +40,10 @@ private class RepeatedClickListener<Item : IItem<*, *>>(
if (time - now < duration)
chain++
else
- chain = 0
+ chain = 1
time = now
if (chain == count) {
chain = 0
- time = -1
event.onClick(v, adapter, item, position)
return true
}