aboutsummaryrefslogtreecommitdiff
path: root/about/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-12-31 15:37:47 -0500
committerGitHub <noreply@github.com>2017-12-31 15:37:47 -0500
commit7a9ca234c3245047ccda9597345a26884e9d3290 (patch)
treed054414ba6879867878de1b8adc5203109d0c78a /about/src/main/kotlin
parente2009a3e33a58bab37f433845f6d105cb7821da1 (diff)
downloadkau-7a9ca234c3245047ccda9597345a26884e9d3290.tar.gz
kau-7a9ca234c3245047ccda9597345a26884e9d3290.tar.bz2
kau-7a9ca234c3245047ccda9597345a26884e9d3290.zip
Fix up constraint layouts for about (#121)
Diffstat (limited to 'about/src/main/kotlin')
-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
- }
}
}
}