aigestudio / wheelpicker Goto Github PK
View Code? Open in Web Editor NEWSimple and fantastic wheel view in realistic effect for android.
License: Apache License 2.0
Simple and fantastic wheel view in realistic effect for android.
License: Apache License 2.0
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.
显示的时候才计算,比如列表是1900到2300年,你就计算了400个文本的宽高
避免一次性计算全部文本的宽高(setData的方法要优化)
当每个item的内容超出长度的时候,没办法全部显示。
大力(出奇迹)滚动, 在picker处于flying的时候, 手机按下使picker强行停止滚动, 然后手指抬起, 这个时候picker不会自动滚动到最近的item, 也许会处于2个item之间, 并且(重要的是), 虽然picker经历的滚动->停止这个过程, 但是并没有重新选定数值, 相当于这次滚动一直没有停止.
try it?
I am using WheelCurvedPicker to create picker for my app, but when I set item index by a value greater than 0, I can not slide up again. Is it really a bug or something else ?
多次设置当前值不起作用?只有在第一次设置当前值才起作用,什么原因
RT!
The property wheel_selected_item_text_color in xml is not working.
我设置一个size为10的data,然后滚动到第8个,然后再设置size为3的data,然后设置setIndex为0,但是wheelpicker没有回滚,要我手动滑动才能看到新设置的数据,请问当第二次数据少于前一次数据的时候,怎么样才能让wheelpicker能重新最新数据(不需要手动滑动)
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."
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)
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.
能不能支持默认选中某个item
能不能把前面的显示全,后面的以...的形式显示呢?
請問,字和indicator的間距,有辦法有距離一點嗎
1、现在是否支持横向的模式?
2、对于每一个item是否支持自定义UI样式?
多谢支持~
发现一个小的bug,调用完setSelectedItemPosition()后setOnItemSelectedListener()监听接口并没有接收到变化的回调!
目前只能滑动到需要的item位置,如果点击item也能滚动过去就好了
如果没有scrollview 或者有scrollview但是不滑动,数据正常显示。一旦滑动,数据就会只显示选中行。
how to remove wheel picker default decor? I am getting black shaded box for selected item. please help
使用WheelCurvedPicker,在没有上下滑动过的时候调用setItemIndex没有问题,但是有过上下滑动之后再调用就会出现乱跳现象。
经过debug发现unitDeltaTotal变量没有制空导致的,所以我试了复写setItemIndex方法就好了。
@OverRide
public void setItemIndex(int index) {
super.setItemIndex(index);
unitDeltaTotal = 0;
}
WheelCurvedPicker具体逻辑看上去非常复杂,不是很了解,所以没有提Pull request。
想使用省市区三级联动,不知道您说的WheelAreaPicker在哪里可用
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
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);
安卓上尽量不要使用enum,可以结合@IntDef
注解,使用int定义常量。
强烈建议OnWheelChangeListener.onWheelSelected(int index, String data)中的data设置成泛型,个人觉得即使是Object类型都比String更通用
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!
Best regards
Marco
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 ) { .... }}
1.当手指滑动WheelPicker时,在不设置无限滚动的情况下,将最后一个数据滑出屏幕,不会自动回滚到选中最后一条
2.一个WheelPicker不设置无限滚动,设置的数据超过24个后,继续往上滑动,会自动回滚到第23的位置(从0-23),当设置无限滚动后没有该问题
WheelDatePicker调用setLabelTextSize后年月日会和lab挤在一起
我想问一下,现在是还没有添加像ios中的选中那一栏上下有横线的功能是么?
Is there a way to get the selected text while the wheel is scrolling?
Somethnig like this gif
给一个list初始化A到Z,如果在initData()里调用 picker.setData(list)没有异常,如果在initData( )里面发送msg,在handler里再去setData( ),则会发生回弹,具体问题是下拉到A以外的任意字母,都会立即回弹到A,这是什么情况?
怎样才能循环滑动,试了下实在搞不定
setOnKeyListenter无效
WheelDatePicker没有实例
On v.1.0.3 you give us possibility to set horizontal orientation for WheelPicker. Are you going to return it back?
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) ;
}
打tag版本上一下jcenter方便android studio用户使用
setData()后应该computeFlingLimitY()重新计算滑动的最小最大坐标
看了下控件公开的方法里全部都是set,而找不到get方法
希望能同提供一些get方法来获取一些值,比如获取当前选中的position、data.
希望使用WheelYearPicker 的 setYearRange修改年份的范围,但是WheelDatePicker 无法获取内部的 WheelYearPicker。
I need to left align text in picker. How it can be made?
这库做得很不错。
问题:当使用同一个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)) 的判断就行了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.