From 63c89c63af30027e75660e607b2e997c0fc829cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sun, 20 Oct 2019 22:07:00 +0200 Subject: [PATCH] Start Session from MainActivity on Android --- .../main/DisplayHostRecyclerViewAdapter.kt | 3 +- .../com/metallic/chiaki/main/MainActivity.kt | 25 ++- .../src/main/res/layout/item_display_host.xml | 179 +++++++++--------- 3 files changed, 113 insertions(+), 94 deletions(-) diff --git a/android/app/src/main/java/com/metallic/chiaki/main/DisplayHostRecyclerViewAdapter.kt b/android/app/src/main/java/com/metallic/chiaki/main/DisplayHostRecyclerViewAdapter.kt index 5762a0d..b733678 100644 --- a/android/app/src/main/java/com/metallic/chiaki/main/DisplayHostRecyclerViewAdapter.kt +++ b/android/app/src/main/java/com/metallic/chiaki/main/DisplayHostRecyclerViewAdapter.kt @@ -27,7 +27,7 @@ import com.metallic.chiaki.common.ext.inflate import com.metallic.chiaki.lib.DiscoveryHost import kotlinx.android.synthetic.main.item_display_host.view.* -class DisplayHostRecyclerViewAdapter: RecyclerView.Adapter() +class DisplayHostRecyclerViewAdapter(val clickCallback: (DisplayHost) -> Unit): RecyclerView.Adapter() { var hosts: List = listOf() set(value) @@ -78,6 +78,7 @@ class DisplayHostRecyclerViewAdapter: RecyclerView.Adapter - + android:layout_height="250dp" + app:cardCornerRadius="4dp" + android:layout_marginTop="8dp" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:layout_marginBottom="0dp" + android:elevation="8dp" + android:foreground="?android:attr/selectableItemBackground"> - - - + + - - - + android:src="@drawable/ic_discovered_on_secondary" + android:layout_gravity="left|top" + android:layout_margin="8dp" /> + - + + + android:layout_height="wrap_content" + android:fontFamily="sans-serif-condensed-medium" + app:layout_constraintTop_toTopOf="parent" + tools:text="Name" + android:textSize="32sp" + android:gravity="center" + android:textColor="?attr/colorOnSurface"/> - + - + - + - + - + - - - - - \ No newline at end of file + \ No newline at end of file