aboutsummaryrefslogtreecommitdiff
path: root/adapter
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
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')
-rw-r--r--adapter/build.gradle2
-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
3 files changed, 4 insertions, 5 deletions
diff --git a/adapter/build.gradle b/adapter/build.gradle
index b58c912..a4f2583 100644
--- a/adapter/build.gradle
+++ b/adapter/build.gradle
@@ -5,9 +5,7 @@ apply from: '../android-lib.gradle'
dependencies {
implementation project(':core')
- //noinspection GradleDependency
api "com.mikepenz:fastadapter-commons:${kau.fastAdapterCommons}@aar"
- //noinspection GradleDependency
api "com.mikepenz:fastadapter:${kau.fastAdapter}@aar"
}
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++