|
|
|
@ -4,6 +4,7 @@ import android.os.Bundle |
|
|
|
import android.text.InputType |
|
|
|
import android.text.InputType |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
|
|
|
|
import android.view.inputmethod.EditorInfo |
|
|
|
import kotlinx.android.synthetic.main.bottom_sheet_double_edit_text.* |
|
|
|
import kotlinx.android.synthetic.main.bottom_sheet_double_edit_text.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.* |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
@ -35,7 +36,8 @@ class BottomSheetDoubleEditTextFragment : BottomSheetFragment() { |
|
|
|
|
|
|
|
|
|
|
|
val data = getData() |
|
|
|
val data = getData() |
|
|
|
|
|
|
|
|
|
|
|
LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_double_edit_text, view?.bottomSheetContainer, true) |
|
|
|
LayoutInflater.from(requireContext()) |
|
|
|
|
|
|
|
.inflate(R.layout.bottom_sheet_double_edit_text, view?.bottomSheetContainer, true) |
|
|
|
|
|
|
|
|
|
|
|
if (data.size == 2) { |
|
|
|
if (data.size == 2) { |
|
|
|
|
|
|
|
|
|
|
|
@ -46,8 +48,21 @@ class BottomSheetDoubleEditTextFragment : BottomSheetFragment() { |
|
|
|
editText2.hint = data[1].hint |
|
|
|
editText2.hint = data[1].hint |
|
|
|
editText2.setText((data[1].defaultValue ?: "").toString()) |
|
|
|
editText2.setText((data[1].defaultValue ?: "").toString()) |
|
|
|
editText2.inputType = data[1].inputType ?: InputType.TYPE_CLASS_TEXT |
|
|
|
editText2.inputType = data[1].inputType ?: InputType.TYPE_CLASS_TEXT |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editText2.setOnEditorActionListener { v, actionId, event -> |
|
|
|
|
|
|
|
if (actionId == EditorInfo.IME_ACTION_DONE) { |
|
|
|
|
|
|
|
val values = ArrayList<String>() |
|
|
|
|
|
|
|
values.add(editText1.text.toString()) |
|
|
|
|
|
|
|
values.add(editText2.text.toString()) |
|
|
|
|
|
|
|
bottomSheetDelegate.setValue(values, row) |
|
|
|
|
|
|
|
dismiss() |
|
|
|
|
|
|
|
true |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|