• Stars
    star
    1,021
  • Rank 45,070 (Top 0.9 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android滚轮控件,基于ListView实现,可以自定义样式。

WheelView

Android Arsenal API

Android滚轮控件,基于ListView实现,可以自定义样式。

Features

  • 支持自定义滚轮样式
  • 支持common和holo两种皮肤
  • 支持文本和图文混排两中数据模版
  • 支持循环显示数据
  • 支持选中项添加附加文本
  • 支持设置滚轮刻度
  • 支持联动功能
  • 支持嵌入滚动控件中(NestedScrollView)
  • 支持滚轮对话框
  • 支持滚轮选中项点击事件

ScreenShot

Usage

Gradle:
compile 'com.wx.wheelview:wheelview:1.3.3'
导入Eclipse:

下载jar包

Demo

Use the WheelView as a View, Java and XML are both supported.

Java:
    public class MainActivity extends Activity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main)

            WheelView wheelView = (WheelView) findViewById(R.id.wheelview);
            wheelView.setWheelAdapter(new ArrayWheelAdapter(this)); // 文本数据源
            wheelView.setSkin(WheelView.Skin.Common); // common皮肤
            wheelView.setWheelData( ?);  // 数据集合

        }
    }
XML:
    <com.wx.wheelview.widget.WheelView
            android:id="@+id/wheelview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
Methods:
method 方法 description 描述
void setWheelAdapter(BaseWheelAdapter adapter) 设置滚轮数据源适配器(required)
void setWheelData(List list) 设置滚轮数据(required)
void setLoop(boolean loop) 设置滚轮是否循环滚动
void setWheelSize(int wheelSize) 设置滚轮个数
void setSkin(Skin skin) 设置皮肤风格
Skin getSkin() 获得皮肤风格
void setStyle(WheelViewStyle style) 设置滚轮样式
WheelViewStyle getStyle() 获得滚轮样式
void setWheelClickable(boolean clickable) 设置滚轮选中项是否可点击
void setSelection(final int selection) 设置滚轮位置
int getSelection() 获取滚轮位置
void join(WheelView wheelView) 连接副WheelView(联动设置)
void joinDatas(HashMap<String, List> map) 副WheelView数据(联动设置)
int getCurrentPosition() 获取当前滚轮位置
T getSelectionItem() 获取当前滚轮位置的数据
void setExtraText(String text, int textColor, int textSize, int margin) 设置选中行附加文本
int getWheelCount() 获得滚轮数据总数
void setOnWheelItemSelectedListener(OnWheelItemSelectedListener onWheelItemSelectedListener) 设置滚轮滑动停止时事件,监听滚轮选中项
void setOnWheelItemClickListener(OnWheelItemClickListener onWheelItemClickListener) 设置滚轮选中项点击事件
WheelViewDialog setDialogStyle(int color) 设置Dialog外观颜色

History

  • 1.0.0(2016-03-24)
    • 完成滚轮控件
  • 1.1.0(2016-03-28)
    • 支持联动功能
  • 1.2.3(2016-04-14)
    • 支持嵌入滚动控件
  • 1.3.0(2016-04-15)
    • 支持滚轮对话框
  • 1.3.1(2016-04-18)
    • 增加滚轮选中项点击事件

About

License

Copyright (C) 2016 [email protected]

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.

More Repositories

1

BezierMaker

🔥 通过de Casteljau算法绘制贝塞尔曲线,并计算它的切线,实现1-7阶贝塞尔曲线的形成动画。
Java
1,408
star
2

GoodView

🔥 Android点赞+1效果,支持文本和图像
Java
1,286
star
3

decompile-apk

🔥 Decompile APK(反编译APK)
Shell
736
star
4

AndroidNote

🔥 Android 进阶笔记,包含常用的技术框架、博客社区、书籍等。
679
star
5

AppUninstall

Android App监听自身卸载,反馈统计
C++
497
star
6

AndroidCommon

🔥 一个简单的开源Android工具类库,提供许多常用的类帮助我们开发程序
Java
124
star
7

wechat-lightapp

微信小程序(应用号)开发工具+Demo+教程
JavaScript
118
star
8

CheckPasswordStrength

🔥 一个检测密码强度的Java工具库。
Java
60
star
9

RoundImageView

圆角图片控件,支持圆形边框和椭圆边框
Java
48
star
10

MultiWindow

Android N 多窗口支持
Java
47
star
11

gradle-bintray-upload

Upload Android Project's gradle script files used in Android Studio
31
star
12

TouchRegion

增大触摸点击区域
Java
12
star
13

apksig

the source code of apksig(Mirror Repo), keeping up-to-date with the official update.
Java
10
star
14

MVX

an Android MVC & MVP & MVVM demo
Java
3
star
15

json2model

This library generates a model object corresponding to a JSON string by executing commands in code
Dart
2
star
16

fork_repository_for_private

The public repositories provided by Github do not allow the creation of private branches, and the method of creating a private branch by copying the repository is documented here.
Shell
1
star