WheelView
=========
Android滚动选择控件
<img src='https://raw.githubusercontent.com/wangjiegulu/WheelView/master/image/image01.png' height='500px'/>
<img src='https://raw.githubusercontent.com/wangjiegulu/WheelView/master/image/image02.png' height='500px'/>
<img src='https://raw.githubusercontent.com/wangjiegulu/WheelView/master/image/image03.png' height='500px'/>
实现Android竖直滚动选择功能
注意:
1. 此demo中注解、日志等功能使用了AndroidInject(https://github.com/wangjiegulu/androidInject)
和AndroidBucket(https://github.com/wangjiegulu/AndroidBucket)项目
2. 此demo中每一个滑动的选项都是一个View,未使用View的缓存,待优化!
使用方式:
/**
* Author: wangjie
* Email: tiantian.china.2@gmail.com
* Date: 7/1/14.
*/
@AILayout(R.layout.main)
public class MainActivity extends AIActivity {
public static final String TAG = MainActivity.class.getSimpleName();
private static final String[] PLANETS = new String[]{"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Uranus", "Neptune", "Pluto"};
@AIView(R.id.main_wv)
private WheelView wva;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
wva.setOffset(1);
wva.setItems(Arrays.asList(PLANETS));
wva.setOnWheelViewListener(new WheelView.OnWheelViewListener() {
@Override
public void onSelected(int selectedIndex, String item) {
Logger.d(TAG, "selectedIndex: " + selectedIndex + ", item: " + item);
}
});
}
@AIClick({R.id.main_show_dialog_btn})
public void onClickCallbackSample(View view) {
switch (view.getId()) {
case R.id.main_show_dialog_btn:
View outerView = LayoutInflater.from(context).inflate(R.layout.wheel_view, null);
WheelView wv = (WheelView) outerView.findViewById(R.id.wheel_view_wv);
wv.setOffset(2);
wv.setItems(Arrays.asList(PLANETS));
wv.setSeletion(3);
wv.setOnWheelViewListener(new WheelView.OnWheelViewListener() {
@Override
public void onSelected(int selectedIndex, String item) {
Logger.d(TAG, "[Dialog]selectedIndex: " + selectedIndex + ", item: " + item);
}
});
new AlertDialog.Builder(context)
.setTitle("WheelView in Dialog")
.setView(outerView)
.setPositiveButton("OK", null)
.show();
break;
}
}
}
License
=======
Copyright 2014 Wang Jie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-WheelView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1433)
没有合适的资源?快使用搜索试试~ 我知道了~
[Android]竖直滑动选择器WheelView的实现
共85个文件
class:41个
png:11个
xml:11个
3星 · 超过75%的资源 需积分: 49 154 下载量 57 浏览量
2015-09-14
19:04:37
上传
评论 4
收藏 1.34MB RAR 举报
温馨提示
[Android]竖直滑动选择器WheelView的实现,效果类似android4.0以上原生的DatePicker这种,可以实现自定义的字符串数组竖直滑动显示
资源推荐
资源详情
资源评论
收起资源包目录
滚轮效果设计.rar (85个子文件)
滚轮效果设计
WheelDate
bin
classes.dex 60KB
res
crunch
drawable-ldpi
ic_launcher.png 3KB
drawable-hdpi
ic_launcher.png 9KB
drawable-xhdpi
ic_launcher.png 14KB
drawable-xxhdpi
ic_launcher.png 17KB
drawable-mdpi
ic_launcher.png 5KB
WheelDate.apk 444KB
jarlist.cache 346B
R.txt 30KB
dexedLibs
android-support-v7-appcompat-9567215204372aaf8a76382dfbab7d3a.jar 166B
classes
android
support
v7
appcompat
R$layout.class 2KB
R$bool.class 763B
R$id.class 2KB
R$drawable.class 5KB
R$dimen.class 1KB
R$attr.class 5KB
R.class 1015B
R$styleable.class 6KB
R$string.class 1KB
R$integer.class 445B
R$color.class 594B
R$anim.class 629B
R$style.class 9KB
com
newworld
crush
CrashHandler$1.class 990B
CrashApplication.class 766B
CrashHandler.class 7KB
wangjie
wheelview
BuildConfig.class 351B
R$layout.class 2KB
R$bool.class 742B
R$id.class 3KB
R$drawable.class 5KB
WheelView$2.class 1KB
WheelView.class 9KB
R$dimen.class 2KB
sample
MainActivity.class 2KB
MainActivity$2.class 2KB
MainActivity$1.class 866B
MainActivity$2$1.class 883B
R$attr.class 5KB
WheelView$3.class 740B
R.class 917B
R$styleable.class 7KB
WheelView$OnWheelViewListener.class 589B
WheelView$1.class 2KB
WheelView$1$1.class 1KB
R$string.class 1KB
R$integer.class 424B
WheelView$1$2.class 1KB
R$color.class 573B
R$anim.class 608B
R$style.class 9KB
resources.ap_ 400KB
AndroidManifest.xml 838B
res
drawable-ldpi
ic_launcher.png 3KB
values-v11
styles.xml 331B
values-v14
styles.xml 388B
drawable-hdpi
ic_launcher.png 9KB
drawable-xhdpi
ic_launcher.png 14KB
drawable-xxhdpi
ic_launcher.png 24KB
values
strings.xml 111B
styles.xml 699B
dimens.xml 220B
drawable-mdpi
ic_launcher.png 5KB
layout
main.xml 730B
wheel_view.xml 479B
values-w820dp
dimens.xml 381B
proguard-project.txt 781B
ic_launcher-web.png 50KB
build.xml 4KB
assets
gen
android
support
v7
appcompat
R.java 40KB
com
wangjie
wheelview
BuildConfig.java 163B
R.java 177KB
.settings
org.eclipse.core.resources.prefs 57B
src
com
newworld
crush
CrashHandler.java 6KB
CrashApplication.java 424B
wangjie
wheelview
sample
MainActivity.java 2KB
WheelView.java 11KB
.project 845B
WheelView.iml 848B
.classpath 475B
local.properties 430B
project.properties 619B
README.md 4KB
AndroidManifest.xml 838B
libs
android-support-v4.jar 741KB
共 85 条
- 1
资源评论
- Garrsion2016-01-22挺好用的啊
- 妄尊2016-05-23各种报错,醉了
longtao330523
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功