GithubHelp home page GithubHelp logo

wheelpicker's People

Contributors

aigestudio avatar cranberyxl avatar goushengli avatar manuelgon47 avatar nimatrueway avatar obllivion avatar szn001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wheelpicker's Issues

Double tab on scrolling wheel does not trigger onItemSelected anymore.

Hi there,

thank you very much for this really cool wheel picker library!

I found a bug, which is not reproduceable with the provided Demo.apk but can be reproduced with the Demo.apk build from the latest version:
If you double tab on the scrolling wheel, onItemSelected won't be called anymore. In the provided Demo.apk it will be called.

I uploaded two videos, showing the issue.

Would be really nice if you can fix this issue!

videos.zip

Best regards
Marco

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.

java.lang.IndexOutOfBoundsException: Invalid index 86, size is 57

IndexOutOfBounds after setYearRange, But it's not always happen;
ExceptionStackMsg:
java.lang.IndexOutOfBoundsException: Invalid index 86, size is 57
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at com.aigestudio.wheelpicker.core.AbstractWheelPicker.onSizeChanged(AbstractWheelPicker.java:234)
at com.aigestudio.wheelpicker.view.WheelCrossPicker.onSizeChanged(WheelCrossPicker.java:69)
at android.view.View.sizeChange(View.java:16135)

建议不要使用enum

安卓上尽量不要使用enum,可以结合@IntDef注解,使用int定义常量。

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

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

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

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

大婶好,有两个问题

1、现在是否支持横向的模式?
2、对于每一个item是否支持自定义UI样式?
多谢支持~

Implement adapter

Thanks for your great library, But still need to implement adapter to be able to make list item layout to display text with image, "Not only text."

wheelpicker滑动选择数据有时候会失败

问题:当使用同一个wheelpicker显示多个集合数据(集合A,集合B)的时候,如果集合A滑倒位置3显示是“apple”;此时将wheelpicker装载集合B,滑倒位置5如果也显示的是“apple”(和集合A最后选中的相同),那么它将不会出发onWheelSelected(int index, String data)回调。如果在装载集合B时调用WheelPicker.setItemIndex(0)方法,点击确定将会显示集合B的第0的位置的数据而不是“apple”。

问题原因:
WheelCrossPicker.java
private void confirmData() {
if (state != SCROLL_STATE_IDLE) {
return;
}
int curIndex = itemIndex - unitDeltaTotal / unit;
curIndex = Math.max(0, curIndex);
curIndex = Math.min(data.size() - 1, curIndex);
String curData = data.get(curIndex);
if (!this.curData.equals(curData)) { // 此处this.curData=="apple",curData=="apple"
this.curData = curData;
onWheelSelected(curIndex, curData);
}
}

解决办法:忽略掉if (!this.curData.equals(curData)) 的判断就行了。

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

求解答

我想问一下,现在是还没有添加像ios中的选中那一栏上下有横线的功能是么?

wheelpicker default decor

how to remove wheel picker default decor? I am getting black shaded box for selected item. please help

setdata()之后不会自动回滚

我设置一个size为10的data,然后滚动到第8个,然后再设置size为3的data,然后设置setIndex为0,但是wheelpicker没有回滚,要我手动滑动才能看到新设置的数据,请问当第二次数据少于前一次数据的时候,怎么样才能让wheelpicker能重新最新数据(不需要手动滑动)

Class couldn't be found

It was running perfectly.. Suddenly I started getting Problems while rendering which states

The following classes could not be found:
- com.aigestudio.wheelpicker.WheelPicker (Fix Build Path, Create Class)
Tip: Try to build the project.

I tried clean/rebuild project but still it doesn't work.

I was getting another error as well saying resource not found.

The following classes could not be instantiated:
- com.aigestudio.wheelpicker.WheelPicker (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE

android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F040003.

I dont know how to solve this problem as I am beginner in using this.

WheelDatePicker

WheelDatePicker调用setLabelTextSize后年月日会和lab挤在一起

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);

Get the new position while scrolling

Great library guys, only it lacks the possibility to get the new position while being scrolled.
setOnWheelChangeListener is not enough, for it triggers only when switching between states.
A useful listener would be a ChangingListener with onChanged method:

public interface OnWheelChangeListener {
    public void onChanged(View wheel, int oldPosition, int newPosition) ;
}

手指点击导致flying状态终止的时候, 不会重新选定item

大力(出奇迹)滚动, 在picker处于flying的时候, 手机按下使picker强行停止滚动, 然后手指抬起, 这个时候picker不会自动滚动到最近的item, 也许会处于2个item之间, 并且(重要的是), 虽然picker经历的滚动->停止这个过程, 但是并没有重新选定数值, 相当于这次滚动一直没有停止.

try it?

当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 ) { .... }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.