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) --- .../main/kotlin/ca/allanwang/kau/about/FaqIItem.kt | 2 +- .../kotlin/ca/allanwang/kau/about/LibraryIItem.kt | 13 ++++---- about/src/main/res/layout/kau_iitem_library.xml | 38 +++++++++------------- 3 files changed, 23 insertions(+), 30 deletions(-) (limited to 'about/src/main') 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 - } } } } diff --git a/about/src/main/res/layout/kau_iitem_library.xml b/about/src/main/res/layout/kau_iitem_library.xml index 759a622..47b4e01 100644 --- a/about/src/main/res/layout/kau_iitem_library.xml +++ b/about/src/main/res/layout/kau_iitem_library.xml @@ -16,50 +16,45 @@ android:paddingStart="@dimen/kau_padding_normal" android:paddingTop="@dimen/kau_padding_normal"> - - + - + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/lib_item_name" /> -- cgit v1.2.3