Skip to content

Latest commit

 

History

History
25 lines (23 loc) · 744 Bytes

README.md

File metadata and controls

25 lines (23 loc) · 744 Bytes

NumberInputDialog

Provide a dialog for number input with range prompt.

Screen shot

Usage

fab.setOnClickListener { _ ->
            val input = Input("Title", textView.text.toString())
            input.max = 100.0 //max limit
            input.min = 0.0 //min limit
            val fragment = InputDialogFragment.newInstance(input, this)
            fragment.show(supportFragmentManager, "InputDialogFragment")
        }

don't forget to implements the InputCallback:

class MainActivity : AppCompatActivity(), InputCallback {
    ...
    override fun onInputFinished(value: Double) {
        textView.text = value.toString()
    }
    ...
}