diff options
author | Allan Wang <me@allanwang.ca> | 2018-09-09 11:59:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-09 11:59:24 -0400 |
commit | d540934915da26ab2cec4c897e973be35e0bfe24 (patch) | |
tree | 6f114d080c168381266a0d5d3a40b685e28b8e9a /adapter | |
parent | 718a51ed00a0a5c3dc7a655e617308e82da65d1a (diff) | |
download | kau-d540934915da26ab2cec4c897e973be35e0bfe24.tar.gz kau-d540934915da26ab2cec4c897e973be35e0bfe24.tar.bz2 kau-d540934915da26ab2cec4c897e973be35e0bfe24.zip |
Clean up kotterknife (#161)
* Remove bindview implementations internally
* Remove more bindView calls
* Make config private in ElasticRecyclerActivity
* Fix recyclerview
* Update adapter
* Improve swipe destroy and add direction to swipe finish
Diffstat (limited to 'adapter')
-rw-r--r-- | adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt | 17 | ||||
-rw-r--r-- | adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt | 5 |
2 files changed, 11 insertions, 11 deletions
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt index 9fd5512..ba969a2 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt @@ -71,7 +71,7 @@ class CardIItem( override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) { super.bindView(holder, payloads) - with(holder.itemView.context) context@ { + with(holder.itemView.context) context@{ with(configs) { holder.title.text = string(titleRes, title) val descText = string(descRes, desc) @@ -82,7 +82,8 @@ class CardIItem( holder.button.text = buttonText } val icon = drawable(imageRes) { - imageIIcon?.toDrawable(this@context, sizeDp = 24, color = imageIIconColor) ?: image + imageIIcon?.toDrawable(this@context, sizeDp = 24, color = imageIIconColor) + ?: image } if (icon != null) holder.icon.visible().setImageDrawable(icon) } @@ -109,12 +110,12 @@ class CardIItem( } class ViewHolder(v: View) : RecyclerView.ViewHolder(v) { - val card: CardView by bindView(R.id.kau_card_container) - val icon: ImageView by bindView(R.id.kau_card_image) - val title: TextView by bindView(R.id.kau_card_title) - val description: TextView by bindView(R.id.kau_card_description) - val bottomRow: LinearLayout by bindView(R.id.kau_card_bottom_row) - val button: Button by bindView(R.id.kau_card_button) + val card: CardView = v.findViewById(R.id.kau_card_container) + val icon: ImageView = v.findViewById(R.id.kau_card_image) + val title: TextView = v.findViewById(R.id.kau_card_title) + val description: TextView = v.findViewById(R.id.kau_card_description) + val bottomRow: LinearLayout = v.findViewById(R.id.kau_card_bottom_row) + val button: Button = v.findViewById(R.id.kau_card_button) } }
\ No newline at end of file diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt index 67e7d30..2116b34 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt @@ -8,7 +8,6 @@ import ca.allanwang.kau.adapter.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.utils.INVALID_ID -import ca.allanwang.kau.utils.bindView import ca.allanwang.kau.utils.string /** @@ -38,8 +37,8 @@ class HeaderIItem( } class ViewHolder(v: View) : RecyclerView.ViewHolder(v) { - val text: TextView by bindView(R.id.kau_header_text) - val container: CardView by bindView(R.id.kau_header_container) + val text: TextView = v.findViewById(R.id.kau_header_text) + val container: CardView = v.findViewById(R.id.kau_header_container) } }
\ No newline at end of file |