Simple and fantastic wheel view in realistic effect for android.

Related tags

UI/UX WheelPicker
Overview

Banner


Overview

Download API License ![Size](https://img.shields.io/badge/Size-17 KB-e91e63.svg)

Contact

QQ QQGroup Mail Sina Twitter

Preview

Preview

Demo

WheelPicke.APK

Include

Compile

compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.3'

or

<dependency>
  <groupId>cn.aigestudio.wheelpicker</groupId>
  <artifactId>WheelPicker</artifactId>
  <version>1.1.3</version>
  <type>pom</type>
</dependency>

or

<dependency org='cn.aigestudio.wheelpicker' name='WheelPicker' rev='1.1.3'>
  <artifact name='$AID' ext='pom'></artifact>
</dependency>

Import aar

WheelPicker-1.1.3.aar

Import Module

1.Import moudle WheelPicker in your project.

2.Add module like below in your settings.gradle file of project:

include ':YourMoudle',':WheelPicker'

Notably, in some version of gradle you need to add module single line:

include ':WheelPicker'

click the "sycn now" when it appear on the top-right of IDE window.

3.Compile project like below in the dependencies in your build.gradle file of application module:

compile project(':WheelPicker')

Usage

WIKI | 帮助文档

Versions

1.0.0 beta

  • Preview for WheelPicker and support few function.

1.0.1 beta

  • BugFix:Cache in WheelCuredPicker can not clean...a stupid mistake.

1.0.2 beta

  • BugFix:MotionEvent lost when point outside of view in WheelCurvedPicker

1.0.3 beta

  • BugFix:Error parameter after scroll using setXXX method

1.1.0 Stable

  • Refactor project fix all known bug and some function additions
  • I will create a tag for old beta version but not be updated anymore
  • 重构项目发布稳定版修复测试版所有BUG以及新增功能
  • Beta版本会打上TAG方便老版本过渡但不再更新

1.1.1

  • BugFix:Scroll automatically when touch but not move on WheelPicker in some low resolution phone
  • BugFix:Scroll range incorrect when invoke setData twice and set data source's length less than last
  • BugFix:Wheel state do not refresh when invoke setData twice and set data source's length-1 less than last selected position
  • BugFix:Switch between click and scroll event
  • BugFix:Call OnItemSelectedListener more time when user want to scroll continuously
  • BugFix:Scroll range incorrect when set current selected item again
  • BugFix:Scroll will be triggered when click WheelPicker
  • Function:All the parameters of WheelPicker will be reset when you setData
  • ADD WheelYearPicker, WheelMonthPicker, WheelDayPicker
  • ADD WheelDatePicker
  • 修复某些低分辨率手机触摸不动时自滑动问题
  • 修复第二次调用setData设置长度比上次小的数据时滑动范围不改变的问题
  • 修复第二次调用setData设置长度位置小于上次选中位置时滚轮状态不刷新问题
  • 修复点击与滑动事件切换的问题
  • 修复当用户想连续滑动时出现多次回调的问题
  • 修复重新设置选择的数据项位置后滑动范围错位问题
  • 修复点击后触发滚动的问题
  • 重新设置数据源后会重置滚轮选择器相关参数
  • 新增年份、月份、日期选择器
  • 新增三级联动的日期选择器

1.1.2

  • BugFix:WheelPicker can not get the height in some layout
  • Support Android Nougat

1.1.3

  • BugFix:Divide by zero

Function

  • Data display circulation
  • Set visible item count
  • Get the current item data straight in stationary
  • Monitor status of scroll get selected item data and other parameter when wheel stop
  • Dynamic update data
  • Set text color of selected or non-selected item
  • Set item space
  • Support display indicator and set the indicator's size and color
  • Support display curtain and set the curtain's color
  • Enable atmospheric effect
  • Enable perspective effect
  • Curl the items base on mathematic models
  • Support item align when perspective or atmospheric enable
  • 循环显示数据项
  • 设置可见数据项条数
  • 在滚轮静止状态直接获取选中数据项
  • 滚动监听获取滚轮停止后选中项以及滚动各项参数
  • 动态更新数据源
  • 设置当前选中项文本颜色和非选中项文本颜色
  • 设置数据项之间间隔
  • 支持绘制指示器以及指定指示器颜色、尺寸
  • 支持绘制幕布以及指定幕布颜色
  • 可开启数据项空气感模拟
  • 可开启数据项模拟真实透视效果
  • 根据严格数学建模模拟滚轮弯曲效果
  • 在开启透视或弯曲效果后支持让数据项左右对齐

Widgets

WheelDatePicker

WheelDatePicker

Method

  • setVisibleItemCount
  • setCyclic
  • setSelectedItemTextColor
  • setItemTextColor
  • setItemTextSize
  • setItemSpace
  • setIndicator
  • setIndicatorColor
  • setIndicatorSize
  • setCurtain
  • setCurtainColor
  • setAtmospheric
  • setCurved
  • setItemAlignYear
  • setItemAlignDay
  • setYearFrame
  • setSelectedYear
  • setSelectedMonth
  • setSelectedDay
  • etc...

WheelYearPicker

WheelYearPicker

Method

  • All method of WheelPicker
  • setYearFrame
  • set/getYearStart
  • set/getYearEnd
  • set/getSelectedYear
  • getCurrentYear

WheelMonthPicker

WheelMonthPicker

Method

  • All method of WheelPicker
  • set/getSelectedMonth
  • getCurrentMonth

WheelDayPicker

WheelDayPicker

Method

  • All method of WheelPicker
  • set/getSelectedDay
  • getCurrentDay
  • setYearAndMonth
  • set/getYear
  • set/getMonth

WheelAreaPicker

中国行政区域划分根据国家统计局最新数据国家统计局行政区域划分


Donation

如果您觉得该项目帮助了您那不妨赏小弟一杯咖啡钱 :)

Pay

You can support the project and thank the author for his hard work :)


LICENSE

Copyright 2015-2017 AigeStudio

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.

Comments
  • WheelCurvedPicker 调用setItemIndex()方法 界面错乱

    WheelCurvedPicker 调用setItemIndex()方法 界面错乱

    使用WheelCurvedPicker,在没有上下滑动过的时候调用setItemIndex没有问题,但是有过上下滑动之后再调用就会出现乱跳现象。

    经过debug发现unitDeltaTotal变量没有制空导致的,所以我试了复写setItemIndex方法就好了。 @Override public void setItemIndex(int index) { super.setItemIndex(index); unitDeltaTotal = 0; }

    WheelCurvedPicker具体逻辑看上去非常复杂,不是很了解,所以没有提Pull request。

    opened by lesliesam 14
  •  divide by zero trying to change item space and size

    divide by zero trying to change item space and size

    I am trying to extend your wheel picker and change item spacing and text size.

    This case work OK:

    setItemSpace(18); setItemTextSize(54);

    java.lang.ArithmeticException: divide by zero at com.aigestudio.wheelpicker.WheelPicker.onDraw(WheelPicker.java:505) :

    setItemSpace(27); setItemTextSize(54);

    question 
    opened by yamelkaya 7
  • setItemIndex error

    setItemIndex error

    when i setItemIndex to the WheelHourPicker, the picker show the view error, for example, when i set WheelHourPicker.setCurrentHour(6); the picker show 3 but when first entry the activity,set setCurrentHour is true. Once i scroll the wheel picker, the method setcurrenthour will error

    opened by recwert 6
  • 当wheel的data为空时,滑动会崩溃.

    当wheel的data为空时,滑动会崩溃.

    08-31 10:05:22.225 4814-4814/? E/AndroidRuntime: FATAL EXCEPTION: main Process: cn.area, PID: 4814 java.lang.ArithmeticException: divide by zero at smartcity.view.WheelPicker.WheelPicker.run(WheelPicker.java:781)

    建议在run()方法中先检查data的是否有数据再执行滑动. @Override public void run() { _if(mData==null || mData.size()<=0){ return; }_ if (mScroller.isFinished() && !isForceFinishScroll ) { .... }}

    opened by mudao 3
  • setCurrentItem(#) not giving me particular position and not being called second time.

    setCurrentItem(#) not giving me particular position and not being called second time.

    I've tested below scenario on your latest demo 1.1.0.

    I've array of 20. What I need is if User select position 2 then I want spinner to rotate to 3rd position. So onItemSelected callback I've written as below.

    public void onItemSelected(WheelPicker picker, Object data, int position) { String text = ""; switch (picker.getId()) { case R.id.main_wheel_left: if (position == 2) { wheelLeft.setCurrentItem(1); } text = "Left: " + position + " :: "; break; case R.id.main_wheel_center: text = "Center:"; break; case R.id.main_wheel_right: text = "Right:"; break; } Toast.makeText(this, text + String.valueOf(data), Toast.LENGTH_SHORT).show(); }

    I'm stuck with Two Issues. It's not sending me to 1st position on call of setCurrentItem(1) and this condition not working for second time.

    opened by ccrazycoder 3
  • setSelectedItemPosition() method not working.

    setSelectedItemPosition() method not working.

    First I am setting data to wheel picker and then I called setSelectedItemPosition(pos) method, data is properly setting but it showing me on 0 index position.

    Here is my code(Kotlin).

    var datePos = 0
    val startDateView = view.findViewById(R.id.start_date_view) as WheelPicker
    startDateView.apply {
                datePos =
                    Calendar.getInstance().get(Calendar.DAY_OF_MONTH) - 1 // Get current date position
                setOnItemSelectedListener { picker: WheelPicker?, data1: Any?, position: Int ->
                    datePos = position
                }
                data = Constants.getDatesRange() // setting data to wheel picker
                setSelectedItemPosition(datePos)
            }
    

    XML Code

    <com.aigestudio.wheelpicker.WheelPicker
                                    android:id="@+id/start_date_view"
                                    android:layout_width="0dp"
                                    android:layout_weight=".3"
                                    android:layout_height="80dp"
                                    aigestudio:wheel_atmospheric="true"
                                    aigestudio:wheel_curved="true"
                                    aigestudio:wheel_cyclic="false"
                                    app:wheel_indicator="true"
                                    app:wheel_visible_item_count="4"
                                    app:wheel_indicator_size="1dp"
                                    app:wheel_indicator_color="@color/colorPrimary"
                                    aigestudio:wheel_item_align="center"
                                    aigestudio:wheel_item_text_color="@color/grey"
                                    aigestudio:wheel_item_text_size="16sp"
                                    aigestudio:wheel_selected_item_text_color="#000" />
    
    opened by siddheshpalkar2 1
  • 当WheelPicker只有一项时,怎么设置隐藏其他选项?

    当WheelPicker只有一项时,怎么设置隐藏其他选项?

    例如我显示的是两个WheelPicker, 一个是小时,一个是分钟, 但因为是弄课程表,有些时间段不可用,故会出现每个小时对应的分钟不一定一样,而有些小时对应的那个分钟列表只有一个元素,然后在视图上,上下部分都显示出这个元素了。。请问怎么隐藏?(例:8:00,8点只有一个00分,没有其他,所以分钟的WheelPicker里的元素只有一个, 但是视图上显示出很多个“00”,但我只需要显示一个。。)

    opened by wahyip 1
  • 用两个WheelPicker做一个工资范围的联动时,左右各滚几次会出现大量空白Item的BUG

    用两个WheelPicker做一个工资范围的联动时,左右各滚几次会出现大量空白Item的BUG

    RT,重点代码如下: ` minPicker.setOnWheelChangeListener(new WheelPicker.OnWheelChangeListener() { @Override public void onWheelScrolled(int offset) {

            }
    
            @Override
            public void onWheelSelected(int position) {
                for (int i = 0; i < numberList.size(); i++) {
                    if (numberList.get(i) == minNumberList.get(position)) {
                        maxNumberList.clear();
                        maxNumberList.addAll(numberList.subList(i, numberList.size()));
                        break;
                    }
                }
                maxPicker.setData(maxNumberList);
            }
    
            @Override
            public void onWheelScrollStateChanged(int state) {
    
            }
        });
    
        maxPicker.setOnWheelChangeListener(new WheelPicker.OnWheelChangeListener() {
            @Override
            public void onWheelScrolled(int offset) {
    
            }
    
            @Override
            public void onWheelSelected(int position) {
                for (int i = 0; i < numberList.size(); i++) {
                    if (numberList.get(i) == maxNumberList.get(position)) {
                        minNumberList.clear();
                        minNumberList.addAll(numberList.subList(0, i));
                        return;
                    }
                }
                minPicker.setData(minNumberList);
            }
    
            @Override
            public void onWheelScrollStateChanged(int state) {
    
            }
        });`
    
    opened by Legen7 1
  • Is this library dead?

    Is this library dead?

    this library is used in a react native package I'm trying to test, whenever i run the app after installing that package I'm getting the following error: Could not resolve cn.aigestudio.wheelpicker:WheelPicker:1.0.3. > Could not get resource 'https://www.jitpack.io/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom'. > Could not GET 'https://www.jitpack.io/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom'. Received status code 401 from server: Unauthorized

    Is there any solution for this issue, or is this library dead and I have to look for something else?

    opened by true-hamid 3
  • Could not find cn.aigestudio.wheelpicker:WheelPicker:1.0.3.

    Could not find cn.aigestudio.wheelpicker:WheelPicker:1.0.3.

    Hello,

    I am trying to use wheel Picker in my react native app. I am using a react-native-wheel-picker library that uses WheelPicker from AigeStudio for android.

    But I am getting the following error.

    Execution failed for task ':app:checkDebugAarMetadata'.
    > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
       > Could not find cn.aigestudio.wheelpicker:WheelPicker:1.0.3.
         Searched in the following locations:
           - https://repo.maven.apache.org/maven2/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom
           - file:/Users/sandeshvakale/.m2/repository/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom
           - file:/Users/sandeshvakale/Desktop/Projects/Maaf/node_modules/react-native/android/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom
           - file:/Users/sandeshvakale/Desktop/Projects/Maaf/node_modules/jsc-android/dist/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom
           - https://dl.google.com/dl/android/maven2/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom
           - https://www.jitpack.io/cn/aigestudio/wheelpicker/WheelPicker/1.0.3/WheelPicker-1.0.3.pom
         Required by:
             project :app > project :gregfrench_react-native-wheel-picker
    

    I also forced the library to use the latest 1.1.3 version by making changes in the library Gradle file.

    But I get the same error again.

    Is anyone facing the same issue?

    Thanks in advance for your help.

    opened by SandeshVakale 9
  • Added functionality to set font from font resources

    Added functionality to set font from font resources

    Font resource can be set through app:wheel_font_family attribute.

    Example: If you have a my_font family in your font resource directory, then you'll set:

    <com.aigestudio.wheelpicker.WheelPicker
        ...
        app:wheel_font_family="@font/my_font"
        ... />
    

    Note: font set from font resources will override fonts set from assets folder with app:wheel_font_path.

    opened by premacck 1
Owner
Aige
Why think separately of this life and next,when one is born from the last?Time is always too short for those who need it,but for those who love,it last forever
Aige
Custom wheel widget for android

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

Alessandro Crugnola 384 Nov 21, 2022
Just a Wheel——A easy way to setEmptyView to ListView、GridView or RecyclerView etc..

中文说明在这里 TEmptyView Just a Wheel—— A easier way to setEmptyView. Without having to write xml file every time. It supports AdapterView(ListView,GridView

Barry 454 Jan 9, 2023
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)

Android-PickerView English Document 注意事项、详请使用方式、更新日志等,请查看 Wiki文档 Wiki文档,Wiki文档,Wiki文档 !~ 重要的事情说三遍 对于使用上有任何疑问或优化建议等,欢迎加入QQ群讨论交流技术问题。 交流群1: 387051294(推荐

Bigkoo 13.2k Jan 6, 2023
View that imitates Ripple Effect on click which was introduced in Android L (for Android 2.3+)

RippleView View that imitates Ripple Effect on click which was introduced in Android L. Usage For a working implementation, Have a look at the Sample

Muthuramakrishnan Viswanathan 1.2k Dec 30, 2022
This is a android custom view , like a scratch card effect!

ScratchView This is a android custom view , like a scratch card effect! Last Update 采纳DearZack童鞋的优化思路,把计算擦除面积比例的操作放在手指离开屏幕时,以降低对CPU的占用。 Articles Scrat

D_clock爱吃葱花 316 Nov 29, 2022
Pop animation with circular dust effect for any view updation

Popview-Android Pop animation with circular dust effect for any view updation Getting Started In your build.gradle dependencies { compile 'rb.popv

R B Krishna 489 Dec 28, 2022
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content.

Swipecards Travis master: A Tinder-like cards effect as of August 2014. You can swipe left or right to like or dislike the content. The library create

Dionysis Lorentzos 2.3k Dec 9, 2022
Android ImageViews animated by Ken Burns Effect

KenBurnsView Android library that provides an extension to ImageView that creates an immersive experience by animating its drawable using the Ken Burn

Flávio Faria 2.7k Dec 23, 2022
A TagView library for Android. Customize your own & Drag effect.

AndroidTagView An Android TagView library. You can customize awesome TagView by using this library. Screenshots Usage Step 1 Add below dependency in y

lujun 1.7k Dec 29, 2022
JetCompose - Blur Effect in Android 12 with motion layout carousel

JetCompose Blur Effect in Android 12 with motion layout carousel

Vikas Singh 4 Jul 27, 2022
Glass-break effect for views

BrokenView Glass-break effect for views. Demo Download APK Usage Android Studio dependencies { compile 'com.zys:brokenview:1.0.3' } Eclipse Just pu

null 858 Jan 6, 2023
An Index Side Bar With Wave Effect

WaveSideBar You can use WaveSideBar in the contacts page of your application. Refer to AlexLiuSheng/AnimSideBar. Screenshot Include the WaveSideBar to

郭佳哲 1.3k Dec 12, 2022
Squishy button effect with kotlin

Squishy Usage Add squishy() modifier on your composable element. Text( text = "Squishhhhyyyyy", modifier = Modifier .size(200.dp, 100.dp

null 43 Jul 9, 2022
Android View for displaying and selecting values in a circle-shaped View, with animations and touch gestures.

CircleDisplay Android View for displaying and selecting (by touch) values / percentages in a circle-shaped View, with animations. Features Core featur

Philipp Jahoda 287 Nov 18, 2022
FloatingView can make the target view floating above the anchor view with cool animation

FloatingView FloatingView can make the target view floating above the anchor view with cool animation Links 中文版 README Blog about FloatingView demo.ap

UFreedom 1.8k Dec 27, 2022
用于做Path动画的自定义View。 I have a path.I have a view. (Oh~),Path(Anim)View.

PathAnimView 用于做Path动画的自定义View。 I have a path.I have a view. (Oh~),Path(Anim)View. 现已经找到图片->SVG->PATH的正确姿势, Now i have a pic.I have a view. Oh~,Path(A

张旭童 1.1k Oct 28, 2022
Snake View is a simple and animated linear chart for Android.

Snake View Snake library is a simple and animation line chart for Android. Latest Version How to use Configuring your project dependencies Add the lib

Txus Ballesteros 339 Dec 14, 2022
A simple, customizable and easy to use swipeable view stack for Android.

SwipeStack A simple, customizable and easy to use swipeable view stack for Android. QuickStart Include the Gradle dependency dependencies { compil

Frederik Schweiger 1.5k Dec 30, 2022