# Wheel widget for Android #
To include the wheel widget in the current layout, you should add in the layout xml this lines:
<it.sephiroth.android.wheel.view.Wheel
android:id="@+id/wheel"
xmlns:sephiroth="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
sephiroth:numRotations="6"
sephiroth:ticks="28" />
Where **numRotations** is the max number of rotations the wheel can perform and **ticks** is the total number of ticks the wheel will display.
In your activity you can add a **OnScrollListener** listener to the wheel widget, in this way:
mWheel = (Wheel) findViewById( R.id.wheel );
mWheel.setOnScrollListener( new OnScrollListener() {
@Override
public void onScrollStarted( Wheel view, float value, int roundValue ) {
}
@Override
public void onScrollFinished( Wheel view, float value, int roundValue ) {
}
@Override
public void onScroll( Wheel view, float value, int roundValue ) {
}
} );
Where **float value** is a value between -1.0 and 1.0 of the current indicator position and **int roundValue** is a value between -(ticks*numRotations) and (ticks*numRotations)
###Change the Wheel value
The wheel position and value chan be changed programmatically at runtime using the Wheel's method **setValue**:
public void setValue( float value, boolean fireScrollEvent );
- value is the new wheel value, a float between -1.0f and 1.0f, where 0.0f it's the center of the wheel.
- fireScrollEvent: if true, once this method is called the onScrollFinished method will be called.
## Screen Shots ##
![Wheel running on ICS](https://github.com/sephiroth74/AndroidWheel/raw/master/Screenshot_2012-01-28-13-33-04.png "Screenshot 1")
安卓源码 AndroidWheel Android Wheel支持城市、多种日期时间、密码、图片.zip
版权申诉
170 浏览量
2023-03-04
16:45:33
上传
评论
收藏 63KB ZIP 举报
![avatar](https://profile-avatar.csdnimg.cn/a1e22b8af6174f729054a946560f6bf4_s13166803785.jpg!1)
金枝玉叶9
- 粉丝: 143
- 资源: 7638
最新资源
- jmeter性能测试-测试 Web 应用程序&测试各种类型的服务,包括数据库、消息队列和其他服务
- Oracle-维护常用SQL语句.pdf
- NX二次开发UF-CURVE-edit-trim-curve 函数介绍
- python课程项目-学生成绩管理系统包括学生、课程、成绩记录等数据的管理和交互
- NX二次开发UF-CURVE-edit-trim 函数介绍
- Acunetix Web漏洞扫描工具
- NX二次开发UF-CURVE-edit-spline-thru-pts 函数介绍
- Python应用领域和职业发展实用教程+源码+说明文档+教程.zip
- 1718758871669485_file
- oracle-dba常用sql脚本分类文档.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)