You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WonderCsabo edited this page Nov 10, 2014
·
13 revisions
Since AndroidAnnotations 2.7
You can bind methods to handle specific events from SeekBar view.
@SeekBarProgressChange
This annotation is intended to be used on methods to receive events defined by SeekBar.OnSeekBarChangeListener.onProgressChanged(SeekBar, int, boolean) when the progress level of a SeekBar view has changed.
The annotation value should be one or several R.id.* fields that refers to an android.widget.SeekBar. If not set, the method name will be used as the R.id.* field name.
The method may have multiple parameter :
A android.widget.SeekBar parameter to determine which view has targeted this event
An int parameter named progress to get the progress level of the SeekBar
A boolean parameter named fromUser to determine if this event is triggered by the user
All of those parameters are parameter are optional.
Some usage examples of @SeekBarProgressChange annotation:
@SeekBarProgressChange(R.id.seekBar)
voidonProgressChangeOnSeekBar(SeekBarseekBar, intprogress, booleanfromUser) {
// Something Here
}
@SeekBarProgressChange(R.id.seekBar)
voidonProgressChangeOnSeekBar(SeekBarseekBar, intprogress) {
// Something Here
}
@SeekBarProgressChange({R.id.seekBar1, R.id.seekBar2})
voidonProgressChangeOnSeekBar(SeekBarseekBar) {
// Something Here
}
@SeekBarProgressChange({R.id.seekBar1, R.id.seekBar2})
voidonProgressChangeOnSeekBar() {
// Something Here
}
@SeekBarTouchStart and @SeekBarTouchStop
Those annotations are intended to be used on methods to receive events defined by SeekBar.OnSeekBarChangeListener.onStartTrackingTouch(SeekBar seekBar) and SeekBar.OnSeekBarChangeListener.onStopTrackingTouch(SeekBar seekBar) when the user has started or finished to move the cursor of the targeted SeekBar.
The annotation value should be one or several R.id.* fields that refers to an android.widget.SeekBar. If not set, the method name will be used as the R.id.* field name.
The method can have zero or one parameter of type SeekBar.