aboutsummaryrefslogtreecommitdiff
path: root/adapter/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-02-23 20:53:16 -0500
committerGitHub <noreply@github.com>2018-02-23 20:53:16 -0500
commita7e24f0c6bb1c598735eb902cf8cdff8de5dd1da (patch)
tree98671b65142ea84aac26d455cae1ec1ce99a5cf8 /adapter/src/main/kotlin/ca/allanwang
parent3d7c85bd97261116a090a7202b0e0ed2625b5d73 (diff)
downloadkau-a7e24f0c6bb1c598735eb902cf8cdff8de5dd1da.tar.gz
kau-a7e24f0c6bb1c598735eb902cf8cdff8de5dd1da.tar.bz2
kau-a7e24f0c6bb1c598735eb902cf8cdff8de5dd1da.zip
Update/fast adapter (#138)
* Update version and add debug key * Update fast adapter * Add debug separation * Inline functions and remove unused
Diffstat (limited to 'adapter/src/main/kotlin/ca/allanwang')
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt5
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt2
2 files changed, 4 insertions, 3 deletions
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt
index 14be76b..2f25d8c 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt
@@ -1,5 +1,6 @@
package ca.allanwang.kau.adapters
+import android.view.View
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.IAdapter
import com.mikepenz.fastadapter.IItem
@@ -11,5 +12,5 @@ import com.mikepenz.fastadapter.IItem
/**
* Add kotlin's generic syntax to better support out types
*/
-fun <T : IItem<*, *>> fastAdapter(vararg adapter: IAdapter<out T>) =
- FastAdapter.with<T, IAdapter<out T>>(adapter.toList())!! \ No newline at end of file
+fun <Item : IItem<*, *>> fastAdapter(vararg adapter: IAdapter<out Item>) =
+ FastAdapter.with<Item, IAdapter<out Item>>(adapter.toList())!! \ No newline at end of file
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 5925454..aeee94c 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt
@@ -35,7 +35,7 @@ private class RepeatedClickListener<Item : IItem<*, *>>(
private var chain = 0
private var time = -1L
- override fun onClick(v: View, adapter: IAdapter<Item>, item: Item, position: Int): Boolean {
+ override fun onClick(v: View?, adapter: IAdapter<Item>, item: Item, position: Int): Boolean {
val now = System.currentTimeMillis()
if (time - now < duration)
chain++