aboutsummaryrefslogtreecommitdiff
path: root/adapter/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-03 15:18:20 -0700
committerGitHub <noreply@github.com>2017-08-03 15:18:20 -0700
commitbafc1996d803862d30a2c7d0c402d30c79c4f647 (patch)
tree5456960a330d7890ac43e1193a80f1db670a8b06 /adapter/src/main/kotlin
parent84b9d3b40e342dc7715c5af13d102bb98529b0fb (diff)
downloadkau-bafc1996d803862d30a2c7d0c402d30c79c4f647.tar.gz
kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.tar.bz2
kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.zip
3.2.2 - Create faq parser and update sample (#19)3.2.3
* Test emulator * Update readme * Update fastadapter and about listing * Make faq parser asynchronous * Modularize about panels * Add basis for faq * Test and finalize the faq panel * Update readme * Update changelog * Remove emulator for now * Update sample
Diffstat (limited to 'adapter/src/main/kotlin')
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt36
1 files changed, 17 insertions, 19 deletions
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt
index 244287b..5ecc937 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt
@@ -1,41 +1,39 @@
package ca.allanwang.kau.animators
import android.support.v7.widget.RecyclerView
+import android.view.View
import android.view.ViewPropertyAnimator
/**
- * Created by Allan Wang on 2017-06-27.
- *
- * Truly have no animation
+ * Created by Allan Wang on 2017-08-02.
*/
-class NoAnimator : DefaultAnimator() {
- override fun addAnimationPrepare(holder: RecyclerView.ViewHolder) {}
+class NoAnimatorAdd(override var itemDelayFactor: Float = 0f) : KauAnimatorAdd {
- override fun addAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator = holder.itemView.animate().apply { duration = 0 }
+ override fun animationPrepare(holder: RecyclerView.ViewHolder): View.() -> Unit = {}
- override fun addAnimationCleanup(holder: RecyclerView.ViewHolder) {}
+ override fun animation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit = {}
- override fun changeOldAnimation(holder: RecyclerView.ViewHolder, changeInfo: ChangeInfo): ViewPropertyAnimator = holder.itemView.animate().apply { duration = 0 }
+ override fun animationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit = { }
- override fun changeNewAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator = holder.itemView.animate().apply { duration = 0 }
+ override fun getDelay(remove: Long, move: Long, change: Long): Long = 0L
- override fun changeAnimationCleanup(holder: RecyclerView.ViewHolder) {}
+}
- override fun changeAnimation(oldHolder: RecyclerView.ViewHolder, newHolder: RecyclerView.ViewHolder?, fromX: Int, fromY: Int, toX: Int, toY: Int) {}
+class NoAnimatorRemove(override var itemDelayFactor: Float = 0f) : KauAnimatorRemove {
- override fun getAddDelay(remove: Long, move: Long, change: Long): Long = 0
+ override fun animation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit = { }
- override fun getAddDuration(): Long = 0
+ override fun animationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit = {}
- override fun getMoveDuration(): Long = 0
+ override fun getDelay(remove: Long, move: Long, change: Long): Long = 0L
+}
- override fun getRemoveDuration(): Long = 0
+class NoAnimatorChange : KauAnimatorChange {
- override fun getChangeDuration(): Long = 0
+ override fun changeOldAnimation(holder: RecyclerView.ViewHolder, changeInfo: BaseItemAnimator.ChangeInfo): ViewPropertyAnimator.() -> Unit = { }
- override fun getRemoveDelay(remove: Long, move: Long, change: Long): Long = 0
+ override fun changeNewAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit = { }
- override fun removeAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator = holder.itemView.animate().apply { duration = 0 }
+ override fun changeAnimationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit = { alpha = 1f }
- override fun removeAnimationCleanup(holder: RecyclerView.ViewHolder) {}
} \ No newline at end of file