aboutsummaryrefslogtreecommitdiff
path: root/adapter
diff options
context:
space:
mode:
Diffstat (limited to 'adapter')
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt17
-rw-r--r--adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt5
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