|
@@ -29,6 +29,7 @@ import android.util.Log
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
+import android.widget.EditText
|
|
|
import android.widget.Toast
|
|
|
import androidx.appcompat.app.AlertDialog
|
|
|
import androidx.fragment.app.DialogFragment
|
|
@@ -89,6 +90,9 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
|
|
|
|
|
setupListeners()
|
|
|
setupStateObserver()
|
|
|
+
|
|
|
+ viewModel.addOption()
|
|
|
+ viewModel.addOption()
|
|
|
}
|
|
|
|
|
|
private fun setupListeners() {
|
|
@@ -159,6 +163,14 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
|
|
viewModel.optionsItemTextChanged()
|
|
|
}
|
|
|
|
|
|
+ override fun requestFocus(textField: EditText) {
|
|
|
+ if (binding.pollCreateQuestion.text.isBlank()) {
|
|
|
+ binding.pollCreateQuestion.requestFocus()
|
|
|
+ } else {
|
|
|
+ textField.requestFocus()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Fragment creator
|
|
|
*/
|