aboutsummaryrefslogtreecommitdiff
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
parentbbaddee2ed4c5f2e534683d9687392d254c37d67 (diff)
downloadkau-196a29b88bc2e1e464f4aa01ae5b0677f5067ee5.tar.gz
kau-196a29b88bc2e1e464f4aa01ae5b0677f5067ee5.tar.bz2
kau-196a29b88bc2e1e464f4aa01ae5b0677f5067ee5.zip
Improve repeated click listener
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt3
-rw-r--r--sample/src/main/res/xml/kau_changelog.xml1
2 files changed, 2 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
}
diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml
index 55e110d..6356ef4 100644
--- a/sample/src/main/res/xml/kau_changelog.xml
+++ b/sample/src/main/res/xml/kau_changelog.xml
@@ -7,6 +7,7 @@
-->
<version title="v3.6.0" />
+ <item text=":adapter: Create withOnRepeatedClickListener" />
<item text=":core: Create kotlin flyweight" />
<item text=":core: Created BundleUtils" />
<item text=":core: [Breaking] Refactored startActivity functions" />