|
|
|
@ -26,7 +26,12 @@ class BottomSheetDoubleEditTextFragment : BottomSheetFragment() { |
|
|
|
|
|
|
|
|
|
|
|
override fun onStart() { |
|
|
|
override fun onStart() { |
|
|
|
super.onStart() |
|
|
|
super.onStart() |
|
|
|
editText1.requestFocus() |
|
|
|
|
|
|
|
|
|
|
|
if (isEditingBlinds) { |
|
|
|
|
|
|
|
editText2.requestFocus() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
editText1.requestFocus() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun getValue(): Any? { |
|
|
|
override fun getValue(): Any? { |
|
|
|
@ -57,28 +62,29 @@ class BottomSheetDoubleEditTextFragment : BottomSheetFragment() { |
|
|
|
|
|
|
|
|
|
|
|
if (data.size == 2) { |
|
|
|
if (data.size == 2) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editText1.setText((data[0].defaultValue ?: "").toString()) |
|
|
|
|
|
|
|
editText2.setText((data[1].defaultValue ?: "").toString()) |
|
|
|
|
|
|
|
|
|
|
|
data[0].hint?.let { editText1.hint = getString(it) } |
|
|
|
data[0].hint?.let { editText1.hint = getString(it) } |
|
|
|
editText1.inputType = data[0].inputType ?: InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES |
|
|
|
editText1.inputType = data[0].inputType ?: InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES |
|
|
|
editText1.addTextChangedListener { |
|
|
|
editText1.addTextChangedListener { |
|
|
|
values[0] = it?.toString() ?: "" |
|
|
|
values[0] = it?.toString() ?: "" |
|
|
|
if (isEditingBlinds) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
val smallBlind = values[0].toDouble() |
|
|
|
|
|
|
|
editText2.setText((smallBlind * 2).round()) |
|
|
|
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
|
|
editText2.setText("") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data[1].hint?.let { editText2.hint = getString(it) } |
|
|
|
data[1].hint?.let { editText2.hint = getString(it) } |
|
|
|
editText2.inputType = data[1].inputType ?: InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES |
|
|
|
editText2.inputType = data[1].inputType ?: InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES |
|
|
|
editText2.addTextChangedListener { |
|
|
|
editText2.addTextChangedListener { |
|
|
|
values[1] = it?.toString() ?: "" |
|
|
|
values[1] = it?.toString() ?: "" |
|
|
|
|
|
|
|
if (isEditingBlinds) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
val bigBlind = values[1].toDouble() |
|
|
|
|
|
|
|
editText1.setText((bigBlind / 2.0).round()) |
|
|
|
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
|
|
editText1.setText("") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
editText1.setText((data[0].defaultValue ?: "").toString()) |
|
|
|
|
|
|
|
editText2.setText((data[1].defaultValue ?: "").toString()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editText2.setOnEditorActionListener { v, actionId, _ -> |
|
|
|
editText2.setOnEditorActionListener { v, actionId, _ -> |
|
|
|
if (actionId == EditorInfo.IME_ACTION_DONE) { |
|
|
|
if (actionId == EditorInfo.IME_ACTION_DONE) { |
|
|
|
|