|
|
@ -28,6 +28,7 @@ import android.view.LayoutInflater
|
|
|
|
import android.view.View
|
|
|
|
import android.view.View
|
|
|
|
import android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
|
|
|
|
import android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
|
|
|
|
import android.view.inputmethod.EditorInfo
|
|
|
|
import android.view.inputmethod.EditorInfo
|
|
|
|
|
|
|
|
import android.view.inputmethod.InputMethodManager
|
|
|
|
import android.widget.EditText
|
|
|
|
import android.widget.EditText
|
|
|
|
import android.widget.NumberPicker
|
|
|
|
import android.widget.NumberPicker
|
|
|
|
import android.widget.TextView
|
|
|
|
import android.widget.TextView
|
|
|
@ -110,8 +111,7 @@ class NumberPickerFactory
|
|
|
|
.create()
|
|
|
|
.create()
|
|
|
|
|
|
|
|
|
|
|
|
dialog.setOnShowListener {
|
|
|
|
dialog.setOnShowListener {
|
|
|
|
picker.getChildAt(0)?.requestFocus()
|
|
|
|
showSoftInput(dialog, pickerInputText)
|
|
|
|
dialog.window?.setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
InterfaceUtils.setupEditorAction(
|
|
|
|
InterfaceUtils.setupEditorAction(
|
|
|
@ -141,6 +141,13 @@ class NumberPickerFactory
|
|
|
|
f.isAccessible = true
|
|
|
|
f.isAccessible = true
|
|
|
|
return f.get(picker) as EditText
|
|
|
|
return f.get(picker) as EditText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun showSoftInput(dialog: AlertDialog, v: View) {
|
|
|
|
|
|
|
|
dialog.window?.setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
|
|
|
|
|
|
|
v.requestFocus()
|
|
|
|
|
|
|
|
val inputMethodManager = context.getSystemService(InputMethodManager::class.java)
|
|
|
|
|
|
|
|
inputMethodManager?.showSoftInput(v, 0)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class SeparatorWatcherInputFilter(private val nextPicker: NumberPicker) : InputFilter {
|
|
|
|
class SeparatorWatcherInputFilter(private val nextPicker: NumberPicker) : InputFilter {
|
|
|
|