Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created July 12, 2022 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeforfun-jp/8277a5cef26ae4b34a31a51bb4ce7c8f to your computer and use it in GitHub Desktop.
Save codeforfun-jp/8277a5cef26ae4b34a31a51bb4ce7c8f to your computer and use it in GitHub Desktop.
【Kotlin】How to Use SeekBar 4
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
/* 省略 */
// SeekBarイベント
seekbar.setOnSeekBarChangeListener(
object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
textView.text = "$p1"
}
override fun onStartTrackingTouch(p0: SeekBar?) {
}
override fun onStopTrackingTouch(p0: SeekBar?) {
}
}
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment