aboutsummaryrefslogtreecommitdiff
path: root/about/src/main/kotlin/ca
diff options
context:
space:
mode:
Diffstat (limited to 'about/src/main/kotlin/ca')
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt2
-rw-r--r--about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt13
2 files changed, 7 insertions, 8 deletions
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt
index b153fc9..0729ea4 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt
@@ -19,7 +19,7 @@ import com.mikepenz.fastadapter.listeners.ClickEventHook
* Created by Allan Wang on 2017-08-02.
*/
class FaqIItem(val content: FaqItem) : KauIItem<LibraryIItem, FaqIItem.ViewHolder>(
- R.layout.kau_iitem_faq, { ViewHolder(it) }, R.id.kau_item_faq
+ R.layout.kau_iitem_faq, ::ViewHolder, R.id.kau_item_faq
), ThemableIItem by ThemableIItemDelegate() {
companion object {
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
index f61c72c..89906c3 100644
--- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
+++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt
@@ -21,21 +21,20 @@ import com.mikepenz.fastadapter.IItem
* Created by Allan Wang on 2017-06-27.
*/
class LibraryIItem(val lib: Library) : KauIItem<LibraryIItem, LibraryIItem.ViewHolder>(
- R.layout.kau_iitem_library, { ViewHolder(it) }, R.id.kau_item_library
+ R.layout.kau_iitem_library, ::ViewHolder, R.id.kau_item_library
), ThemableIItem by ThemableIItemDelegate() {
companion object {
fun bindEvents(fastAdapter: FastAdapter<IItem<*, *>>) {
fastAdapter.withSelectable(false)
.withOnClickListener { v, _, item, _ ->
- if (item !is LibraryIItem) false
- else {
- val c = v.context
+ if (item !is LibraryIItem)
+ false
+ else
with(item.lib) {
- c.startLink(libraryWebsite, repositoryLink, authorWebsite)
+ v.context.startLink(libraryWebsite, repositoryLink, authorWebsite)
+ true
}
- true
- }
}
}
}