aboutsummaryrefslogtreecommitdiff
path: root/adapter/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-10-18 00:32:08 -0400
committerAllan Wang <me@allanwang.ca>2018-10-18 00:32:08 -0400
commit096172ead4674bffd5dd83eb994dd68ac48b88ae (patch)
tree7806e238993cb4370f385a5753d3a5ec8f6a5fbc /adapter/src/main
parent5b3762b3e04042447b9bf2758c37237d0c8af1b6 (diff)
parent9dd6249d634c8b70d152907a4cda80da1626cddc (diff)
downloadkau-096172ead4674bffd5dd83eb994dd68ac48b88ae.tar.gz
kau-096172ead4674bffd5dd83eb994dd68ac48b88ae.tar.bz2
kau-096172ead4674bffd5dd83eb994dd68ac48b88ae.zip
Merge dev
Diffstat (limited to 'adapter/src/main')
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt3
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt9
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt1
-rw-r--r--adapter/src/main/res-public/values/public.xml4
4 files changed, 6 insertions, 11 deletions
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt
index c3a1c61..870861d 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt
@@ -172,7 +172,8 @@ class ThemableIItemDelegate : ThemableIItem, ThemableIItemColors by ThemableIIte
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
override fun bindBackgroundRipple(vararg views: View?) {
val background = backgroundColor ?: return
- val foreground = accentColor ?: textColor ?: backgroundColor ?: return //default to normal background
+ val foreground = accentColor ?: textColor ?: backgroundColor
+ ?: return //default to normal background
val ripple = createSimpleRippleDrawable(foreground, background)
views.forEach { it?.background = ripple }
}
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt
index 9e52aac..7b9b732 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt
@@ -14,8 +14,7 @@ open class KauAnimator(
val changeAnimator: KauAnimatorChange = FadeAnimatorChange()
) : BaseItemAnimator() {
- open fun startDelay(holder: RecyclerView.ViewHolder, duration: Long, factor: Float)
- = Math.max(0L, (holder.adapterPosition * duration * factor).toLong())
+ open fun startDelay(holder: RecyclerView.ViewHolder, duration: Long, factor: Float) = Math.max(0L, (holder.adapterPosition * duration * factor).toLong())
override fun removeAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator {
return holder.itemView.animate().apply {
@@ -30,8 +29,7 @@ open class KauAnimator(
holder.itemView.apply { removeAnimator.animationCleanup(holder)() }
}
- override fun getRemoveDelay(remove: Long, move: Long, change: Long): Long
- = removeAnimator.getDelay(remove, move, change)
+ override fun getRemoveDelay(remove: Long, move: Long, change: Long): Long = removeAnimator.getDelay(remove, move, change)
override fun addAnimationPrepare(holder: RecyclerView.ViewHolder) {
holder.itemView.apply { addAnimator.animationPrepare(holder)() }
@@ -50,8 +48,7 @@ open class KauAnimator(
holder.itemView.apply { addAnimator.animationCleanup(holder)() }
}
- override fun getAddDelay(remove: Long, move: Long, change: Long): Long
- = addAnimator.getDelay(remove, move, change)
+ override fun getAddDelay(remove: Long, move: Long, change: Long): Long = addAnimator.getDelay(remove, move, change)
override fun changeOldAnimation(holder: RecyclerView.ViewHolder, changeInfo: ChangeInfo): ViewPropertyAnimator {
return holder.itemView.animate().apply {
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt
index 196959c..5174503 100644
--- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt
+++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt
@@ -21,6 +21,7 @@ open class KauIItem<Item, VH : RecyclerView.ViewHolder>(
) : AbstractItem<Item, VH>() where Item : IItem<*, *>, Item : IClickable<*> {
@SuppressLint("ResourceType")
final override fun getType(): Int = type
+
final override fun getViewHolder(v: View): VH = viewHolder(v)
final override fun getLayoutRes(): Int = layoutRes
} \ No newline at end of file
diff --git a/adapter/src/main/res-public/values/public.xml b/adapter/src/main/res-public/values/public.xml
deleted file mode 100644
index cf14680..0000000
--- a/adapter/src/main/res-public/values/public.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources xmlns:tools='http://schemas.android.com/tools' tools:ignore='ResourceName'>
-<!-- AUTO-GENERATED FILE. DO NOT MODIFY. public.xml is generated by the generatepublicxml gradle task -->
- <public name='dummy' type='id' />
-</resources> \ No newline at end of file