parent
1c651e6ebe
commit
a3b5efdbcf
@ -0,0 +1,12 @@ |
||||
package net.pokeranalytics.android.ui.fragment.components |
||||
|
||||
import android.text.InputType |
||||
import net.pokeranalytics.android.ui.adapter.components.DisplayableDataSource |
||||
|
||||
class BottomSheetData( |
||||
var title: String? = "", |
||||
var defaultValue: Any? = null, |
||||
var hint: String? = "", |
||||
var inputType: Int? = InputType.TYPE_CLASS_TEXT, |
||||
var data: ArrayList<DisplayableDataSource>? = ArrayList() |
||||
) |
||||
@ -0,0 +1,48 @@ |
||||
package net.pokeranalytics.android.ui.fragment.components |
||||
|
||||
import android.os.Bundle |
||||
import android.view.LayoutInflater |
||||
import android.view.View |
||||
import kotlinx.android.synthetic.main.bottom_sheet_edit_text.* |
||||
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.* |
||||
import net.pokeranalytics.android.R |
||||
|
||||
|
||||
class BottomSheetEditTextFragment : BottomSheetFragment() { |
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||
super.onViewCreated(view, savedInstanceState) |
||||
initData() |
||||
initUI() |
||||
} |
||||
|
||||
override fun clickOnCheck() { |
||||
super.clickOnCheck() |
||||
valueDelegate.setValue("", row) |
||||
dismiss() |
||||
} |
||||
|
||||
override fun onStart() { |
||||
super.onStart() |
||||
editText1.requestFocus() |
||||
} |
||||
|
||||
/** |
||||
* Init data |
||||
*/ |
||||
private fun initData() { |
||||
val data = getData() |
||||
} |
||||
|
||||
/** |
||||
* Init UI |
||||
*/ |
||||
private fun initUI() { |
||||
|
||||
LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_edit_text, view?.bottomSheetContainer, true) |
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,42 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical" |
||||
tools:background="@color/gray_darker"> |
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView |
||||
android:id="@+id/title" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginEnd="8dp" |
||||
android:layout_marginBottom="16dp" |
||||
tools:text="Blinds" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toStartOf="@+id/editText1" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText |
||||
android:id="@+id/editText1" |
||||
android:layout_width="96dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
android:layout_marginEnd="8dp" |
||||
android:layout_marginBottom="8dp" |
||||
android:gravity="end|center_vertical" |
||||
android:imeOptions="actionDone" |
||||
android:inputType="numberDecimal" |
||||
android:lines="1" |
||||
android:textColor="@color/white" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
||||
Loading…
Reference in new issue