From 7a9ca234c3245047ccda9597345a26884e9d3290 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 31 Dec 2017 15:37:47 -0500 Subject: Fix up constraint layouts for about (#121) --- about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt | 2 +- .../src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'about/src/main/kotlin/ca/allanwang') 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( - 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( - 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>) { 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 - } } } } -- cgit v1.2.3