标签:integer write sequence onstop started pre button set touch
rg.setOnCheckedChangeListener{_,checkedId ->
when(checkedId){
R.id.radioButton ->{
Write[0]=1
Toast.makeText(this, radioButton.text.toString(),
Toast.LENGTH_SHORT).show()
}
R.id.radioButton2 ->{
Write[0]=2
Toast.makeText(this, radioButton2.text.toString(),
Toast.LENGTH_SHORT).show()
}
}
}
seekBar?.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
// Write code to perform some action when progress is changed.
editText.setText(seekBar.progress.toString())
}
override fun onStartTrackingTouch(seekBar: SeekBar) {
// Write code to perform some action when touch is started.
}
override fun onStopTrackingTouch(seekBar: SeekBar) {
// Write code to perform some action when touch is stopped.
Toast.makeText(this@MainActivity, seekBar.progress.toString() , Toast.LENGTH_SHORT).show()
}
})
editText.addTextChangedListener(object : TextWatcher{
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
override fun afterTextChanged(s: Editable?) {
seekBar.setProgress(Integer.parseInt(editText.text.toString()))
}
})
kotlin radiogroup,seekbar,edittext
标签:integer write sequence onstop started pre button set touch
原文地址:https://www.cnblogs.com/hunter0541/p/9038666.html