diff --git a/app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicListAdapter.kt b/app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicListAdapter.kt index 8013d84a..3def04b0 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicListAdapter.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicListAdapter.kt @@ -1,6 +1,8 @@ package net.pokeranalytics.android.ui.adapter.components +import android.view.View import android.view.ViewGroup +import android.widget.Toast import androidx.recyclerview.widget.RecyclerView interface EditableDataDelegate : DynamicRowDelegate { @@ -9,26 +11,32 @@ interface EditableDataDelegate : DynamicRowDelegate { interface DynamicRowDelegate { - fun adapterRows() : ArrayList + fun adapterRows() : ArrayList - fun boolForRow(row: DynamicRowInterface) : Boolean - fun stringForRow(row: DynamicRowInterface) : String + fun boolForRow(row: DynamicRowInterface) : Boolean + fun stringForRow(row: DynamicRowInterface) : String - /** - * Manages: - * - label (string) - * - segmented control (live/online) - * - textfield (string) - * - switch (bool) - * - static content - * */ + /** + * Manages: + * - label (string) + * - segmented control (live/online) + * - textfield (string) + * - switch (bool) + * - static content + * */ } + +interface DynamicRowCallback { + fun onRowSelected(row: DynamicRowInterface) +} + class DynamicListAdapter(delegate: DynamicRowDelegate) : RecyclerView.Adapter() { private var rows: ArrayList = ArrayList() private var delegate: DynamicRowDelegate = delegate + var callback: ((row: DynamicRowInterface) -> Unit)? = null init { this.rows = delegate.adapterRows() @@ -49,7 +57,10 @@ class DynamicListAdapter(delegate: DynamicRowDelegate) : RecyclerView.Adapter - + + android:id="@+id/container" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintBottom_toTopOf="@+id/navigation" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:id="@+id/navigation" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="0dp" + android:layout_marginEnd="0dp" + android:background="?android:attr/windowBackground" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:menu="@menu/navigation" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_bottom_sheet_container.xml b/app/src/main/res/layout/fragment_bottom_sheet_container.xml index 0be9445a..a848e2d5 100644 --- a/app/src/main/res/layout/fragment_bottom_sheet_container.xml +++ b/app/src/main/res/layout/fragment_bottom_sheet_container.xml @@ -11,8 +11,8 @@ android:background="#222222" android:gravity="center" android:text="Bottom sheet fragment" - android:textSize="18sp" android:textColor="#FFFFFF" + android:textSize="18sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -30,4 +30,16 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="@+id/appCompatTextView" /> + + \ No newline at end of file