目录(?)[+]
SeekBarEvents
Since AndroidAnnotations 2.7
SeekBar
view.
SeekBar
视图的指定的事件。
@SeekBarProgressChange
SeekBar.OnSeekBarChangeListener.onProgressChanged(SeekBar, int, boolean)
when the progress level of a
SeekBar
view has changed.
SeekBar
视图
的值改变时,加了注解的方法就可以接收由
SeekBar.OnSeekBarChangeListener.onProgressChanged(SeekBar, int, boolean)
定义的改变事件。
The annotation value should be one or several R.id.*
fields that refers to anandroid.widget.SeekBar
. If not set, the method name will be used as the R.id.*
field name.注解值应该是一个或多个引用了android.widget.SeekBar
的 R.id.*
字段。如果没有设置,那么会用方法名作为 R.id.*
。
The method may have multiple parameter :方法可以有多个参数:
- A
android.widget.SeekBar
parameter to determine which view has targeted this event - 一个
android.widget.SeekBar
参数来决定哪个视图被绑定到这个事件上 - An
int
parameter named progress to get the progress level of the SeekBar - 一个命名为progress的
int
值参数来获取SeekBar的值 - A
boolean
parameter named fromUser to determine if this event is triggered by the user - 一个命名为FromUser的
boolean
值参数来决定这个事件是否由用户触发。
All of those parameters are parameter are optional.所有的参数都是可选的。
Some usage examples of @SeekBarProgressChange
annotation:一些 @SeekBarProgressChange
注解的用例:
@SeekBarProgressChange(R.id.seekBar)void onProgressChangeOnSeekBar(SeekBar seekBar, int progress, boolean fromUser) { // Something Here}@SeekBarProgressChange(R.id.seekBar)void onProgressChangeOnSeekBar(SeekBar seekBar, int progress) { // Something Here}@SeekBarProgressChange({ R.id.seekBar1, R.id.seekBar2})void onProgressChangeOnSeekBar(SeekBar seekBar) { // Something Here}@SeekBarProgressChange({ R.id.seekBar1, R.id.seekBar2})void onProgressChangeOnSeekBar() { // Something Here}
@SeekBarTouchStart and @SeekBarTouchStop
Those annotations are intended to be used on methods to receive events defined bySeekBar.OnSeekBarChangeListener.onStartTrackingTouch(SeekBar seekBar)
andSeekBar.OnSeekBarChangeListener.onStopTrackingTouch(SeekBar seekBar)
when the user has started or finished to move the cursor of the targeted SeekBar
.这些注解表示,当用户开始或者结束移动 SeekBar
视图的光标时,加了注解的方法就可以接收由SeekBar.OnSeekBarChangeListener.onStartTrackingTouch(SeekBar seekBar)
和SeekBar.OnSeekBarChangeListener.onStopTrackingTouch(SeekBar 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.注解值应该是一个或多个引用了android.widget.SeekBar
的R.id.*
字段。如果没有设置,那么会用方法名作为 R.id.*
。
The method can have zero or one parameter of type SeekBar
.方法中可以无参或者有一个SeekBar
类型的参数。