mikewellback / android-wheel Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/android-wheel
Automatically exported from code.google.com/p/android-wheel
If gpu hardware acceleration is enabled (I enabled it globally in the manifest
application tag), the shadows are drawn only occasionally. If multiple wheels
are part of the same dialog, some may show a shadow, some may not, there may be
only one shadow (upper or lower) etc.
This might be more of a honeycomb issue than of android-wheel, but we cannot
change honeycomb ;)
As workaround for my app, I inserted "setLayerType(View.LAYER_TYPE_SOFTWARE,
null);" in the constructor of WheelView directly after the super() call
effectively disabling hardware acceleration for android-wheel.
What version of the product are you using? On what operating system?
- Android-wheel 2.1
- Acer Iconia Tab A500
- Honeycomb 3.0.1, Build-number Acer_A500_1.141.01_EMEA_CUS7.
- App theme=Theme.Holo.Light, targetSdkVersion=11, minSdkVersion=7, I use the
wheels in a custom dialog
Original issue reported on code.google.com by [email protected]
on 10 Jul 2011 at 4:40
What steps will reproduce the problem?
1. set the enabled field to false
2. run app and scroll the wheel
3.
What is the expected output? What do you see instead?
Wheel view should not allow scrolling or selection change from the user. At the
moment the user can change the selection and scroll the wheel
What version of the product are you using? On what operating system?
Release 16, on Android 2.2
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 Feb 2011 at 9:27
dhdth
Original issue reported on code.google.com by [email protected]
on 15 Mar 2012 at 10:58
Attachments:
After investigating the source code and android api docs I came out to
conclusion that WheelView should extend AdapterView class.
That class extends View itself and has a method setAdapter which is common
contract for every adapter-awared views.
See
http://developer.android.com/reference/android/widget/AdapterView.html
for details. Thus WheelAdapter.setViewAdapter is redundant and method
AdapterView.setAdapter must be used instead.
Original issue reported on code.google.com by [email protected]
on 3 Dec 2011 at 4:49
What steps will reproduce the problem?
1. Create a custom view for the elements (As per cities example but with a
single text view)
2. Set Ellipse to "Marquee"
What is the expected output? What do you see instead?
It simply truncates the tesxt instead of scrolling it
Original issue reported on code.google.com by [email protected]
on 1 Sep 2011 at 9:40
I a noob on Android, so I hope my question is not stupid...
I want to test the wheel with the most simple example.
1. I created a project and copied the TimeActivity.
2. I exported kankan.wheel.widget to a jar and added it to my project
When I run it, the wheel background are Canada and France flags.
Where can I change it to the gray background? What am I doing wrong?
Attached are the screenshot and my project.
Thanks,
Asaf.
Original issue reported on code.google.com by [email protected]
on 5 Jul 2011 at 8:57
Attachments:
What steps will reproduce the problem?
1. Add a WheelView below a ScrollView
What is the expected output? What do you see instead?
It should be possible to still move the WheelView. However, it does not change.
What version of the product are you using? On what operating system?
1.4
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 3 Dec 2010 at 8:33
Hi, please add follow locked item feature for wheel.
WheelView gets new method setLockedItem. If you setup this item, other items in
wheel before it can't be accessble for current value.
This feature is nessary, for example, to interdict user selecting time values
(mins, hours) which is before the current time.
Original issue reported on code.google.com by [email protected]
on 2 Dec 2011 at 9:39
Attachments:
What steps will reproduce the problem?
1. modify date_layout.xml to have 2 sets of wheel elements in list layout as
below.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="300dp"
android:layout_width="fill_parent"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:background="@drawable/layout_bg">
<TextView android:id="@+id/s_date" android:text="Start Date" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="70dp"
android:layout_width="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:id="@+id/start_date_wheel">
<widget.WheelView android:id="@+id/start_day"
android:layout_height="wrap_content"
android:layout_width="46dp"/>
<widget.WheelView android:id="@+id/start_month"
android:layout_height="wrap_content"
android:layout_width="100dp"/>
<widget.WheelView android:id="@+id/start_year"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</LinearLayout>
<TextView android:id="@+id/e_date" android:text="End Date" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="70dp"
android:layout_width="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:id="@+id/end_date_wheel">
<widget.WheelView android:id="@+id/end_day"
android:layout_height="wrap_content"
android:layout_width="46dp"/>
<widget.WheelView android:id="@+id/end_month"
android:layout_height="wrap_content"
android:layout_width="100dp"/>
<widget.WheelView android:id="@+id/end_year"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</LinearLayout>
</LinearLayout>
What is the expected output? What do you see instead?
I expect two wheels one under the "start date" label, and one under the "end
date" label, but instead, I got only 1 wheel under the "start date" label.
What version of the product are you using? On what operating system?
The latest version, and my OS is Windows 7.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 16 Jan 2012 at 1:13
The wheel does not seem to scroll on Galaxy S II devices with ICS, but works
fine on other devices and the emulator. I hope we see an update soon.
Original issue reported on code.google.com by [email protected]
on 29 Mar 2012 at 7:04
What steps will reproduce the problem?
>adb.exe install wheel.apk
825 KB/s (29602 bytes in 0.035s)
Can't dispatch DDM chunk 46454154: no handler defined
Can't dispatch DDM chunk 4d505251: no handler defined
pkg: /data/local/tmp/wheel.apk
Success
After this I can see the application icon, but I can't access the menu items
Cities, and others
What version of the product are you using? On what operating system?
Version of wheel demo: 1.2
Version of android sdk: r06 for windows
Eclipse: Galileo
OS: Vista Business
Original issue reported on code.google.com by [email protected]
on 11 Sep 2010 at 12:02
Attachments:
Hi! this is the list of changes I made to your code to adapt it for my needs,
with comments, you might be insterested to see them:
Index: src/kankan/wheel/widget/WheelView.java
===================================================================
--- src/kankan/wheel/widget/WheelView.java (revision 20)
+++ src/kankan/wheel/widget/WheelView.java (working copy)
@@ -22,14 +22,15 @@
import java.util.LinkedList;
import java.util.List;
-import kankan.wheel.R;
import kankan.wheel.widget.adapters.WheelViewAdapter;
import android.content.Context;
import android.database.DataSetObserver;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.GradientDrawable.Orientation;
+import android.graphics.drawable.LayerDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@@ -45,7 +46,7 @@
public class WheelView extends View {
/** Top and bottom shadows colors */
- private static final int[] SHADOWS_COLORS = new int[] { 0xFF111111,
+ private static final int[] SHADOWS_COLORS = new int[] { 0xEEEEEEEE,
0x00AAAAAA, 0x00AAAAAA };
/** Top and bottom items offset (to hide that) */
@@ -424,7 +425,10 @@
*/
private void initResourcesIfNecessary() {
if (centerDrawable == null) {
- centerDrawable =
getContext().getResources().getDrawable(R.drawable.wheel_val);
+ centerDrawable = new GradientDrawable(Orientation.BOTTOM_TOP, new
int[]{Color.argb(0x70,0x22, 0x22, 0x22), Color.argb(0x70,0xEE, 0xEE, 0xEE)});
+ ((GradientDrawable)centerDrawable).setStroke(1, Color.argb(0x70, 0x33,
0x33, 0x33));
+ ((GradientDrawable)centerDrawable).setGradientType(GradientDrawable.LINEAR_G
RADIENT);
+ ((GradientDrawable)centerDrawable).setGradientRadius(90);
}
if (topShadow == null) {
@@ -435,7 +439,26 @@
bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);
}
- setBackgroundResource(R.drawable.wheel_bg);
+ Drawable[] layers = new Drawable[3];
+
+ layers[0] = new GradientDrawable(Orientation.BOTTOM_TOP, new
int[]{Color.argb(0xFF,0x33, 0x33, 0x33), Color.argb(0xFF,0xDD, 0xDD, 0xDD)});
+ ((GradientDrawable)layers[0]).setStroke(1, Color.argb(0xFF, 0x33, 0x33,
0x33));
+
((GradientDrawable)layers[0]).setGradientType(GradientDrawable.LINEAR_GRADIENT);
+ ((GradientDrawable)layers[0]).setGradientRadius(90);
+
+ layers[1] = new GradientDrawable(Orientation.TOP_BOTTOM, new
int[]{Color.argb(0xFF,0xAA, 0xAA, 0xAA), Color.argb(0xFF,0xFF, 0xFF, 0xFF)});
+
((GradientDrawable)layers[1]).setGradientType(GradientDrawable.LINEAR_GRADIENT);
+ ((GradientDrawable)layers[1]).setGradientRadius(90);
+ layers[1].setBounds(getLeft() - 4, getTop() - 1, getRight() - 4,
getBottom() - 1 + getHeight()/2 );
+
+ layers[2] = new GradientDrawable(Orientation.BOTTOM_TOP, new
int[]{Color.argb(0xFF,0xAA, 0xAA, 0xAA), Color.argb(0xFF,0xFF, 0xFF, 0xFF)});
+
((GradientDrawable)layers[2]).setGradientType(GradientDrawable.LINEAR_GRADIENT);
+ ((GradientDrawable)layers[2]).setGradientRadius(90);
+ layers[2].setBounds(getLeft() - 4, getTop() - getHeight()/2 - 1,
getRight() - 4, getBottom() - 1 );
+
+ LayerDrawable ld = new LayerDrawable(layers);
+
+ setBackgroundDrawable(ld);
}
/**
@@ -622,7 +648,7 @@
distance -= getItemHeight() / 2;
}
int items = distance / getItemHeight();
- if (items != 0 && isValidItemIndex(currentItem + items)) {
+ if (isValidItemIndex(currentItem + items)) {
notifyClickListenersAboutClick(currentItem + items);
}
}
In main class I changed the shadow color to white (absolutely optional), added
programmatical generation of gradients instead of resource one - the case is,
jar does not contain those resources so the project is unusable unless you do
that directly importing the code. Click listeners will notify the selected item
click as well - I needed universal behaviour, and you can check in the listener
if it's the selected item and skip it, if you want
Index: src/kankan/wheel/widget/adapters/AbstractWheelTextAdapter.java
===================================================================
--- src/kankan/wheel/widget/adapters/AbstractWheelTextAdapter.java (revision 20)
+++ src/kankan/wheel/widget/adapters/AbstractWheelTextAdapter.java (working
copy)
@@ -177,7 +177,7 @@
* @param index the item index
* @return the text of specified items
*/
- protected abstract CharSequence getItemText(int index);
+ public abstract CharSequence getItemText(int index);
@Override
public View getItem(int index, View convertView, ViewGroup parent) {
Index: src/kankan/wheel/widget/adapters/AdapterWheel.java
===================================================================
--- src/kankan/wheel/widget/adapters/AdapterWheel.java (revision 20)
+++ src/kankan/wheel/widget/adapters/AdapterWheel.java (working copy)
@@ -54,7 +54,7 @@
}
@Override
- protected CharSequence getItemText(int index) {
+ public CharSequence getItemText(int index) {
return adapter.getItem(index);
}
The method getItemText has been made public, since some users might want to
implement the same behaviour for different wheels and might need the contained
strings for display in the list or wherever they want. This allows us to cast
the similar wheel adapters to abstract and use the strings
Original issue reported on code.google.com by [email protected]
on 14 Dec 2012 at 12:22
What steps will reproduce the problem?
1. How can i make same wheel horozontally?
Original issue reported on code.google.com by [email protected]
on 15 Jan 2013 at 1:19
In my use-case I need to display only the current item, not the previous item,
the current and the next.
Only when the user does scroll with the finger, then the previous and the next
appear, for the time that the user picks values.
When the user is done picking a value, the previous and next appear again.
This patch adds an option to do that.
NOTE: this patch and the one for bug #13 could be combined in a new API
setDisplayOptions(int bitmask)
with bitmask values:
DISPLAY_OPTION_DISPLAY_SHADOWS
DISPLAY_OPTION_DISPLAY_ONLY_CURRENT_ITEM_EXCEPT_ON_SCROLL (or something like
that)
Original issue reported on code.google.com by [email protected]
on 28 Feb 2011 at 2:30
Attachments:
I am using android-weel to use it for a km picker for a car application.
We created something to reproduce the android's IME functionality.
When you press on a button a Layout with the android-wheels appears with an
animation.
The layout is the following:
<LinearLayout android:id="@+id/kilometer_wheel"
android:layout_marginTop="24dp"
android:layout_gravity="center_horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:paddingLeft="5dp"
android:gravity="left|center_vertical"
android:background="@drawable/layout_bg">
<kankan.wheel.widget.WheelView android:id="@+id/km_1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/km_2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/km_3"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/km_4"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/km_5"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<kankan.wheel.widget.WheelView android:id="@+id/km_6"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingRight="15dp"/>
<ImageButton android:id="@+id/km_picker_ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ok_button"
android:layout_marginLeft="15dp"/>
</LinearLayout>
When I run the app in different devices the size is not consistent.
Let me attach some screenshots:
* 240 x 320 pixels, 2.8 inches (ldpi)
* 320 x 480 pixels, 3.1 inches (mdpi)
* 480 x 800 pixels, 3.7 inches (hdpi)
I saw that inside WheelView there are a lot of variables of type int. For
example: TEXT_SIZE.
I guess this size should depend on the density of the device. I tried to modify
the code using the following method:
private int dpToPx(float dp) {
Log.d("Wheel", "dpToPx with "+dp+ " returning " + (int) (dp * scale + 0.5f));
return (int) (dp * scale + 0.5f);
}
The src: http://pastebin.com/kvUgiErm
Unfortunately this doesn't work.
Any ideas?
Original issue reported on code.google.com by [email protected]
on 26 Dec 2010 at 3:23
Attachments:
What version of the product are you using? On what operating system?
I have tried Android 2.3.5, 3.2.1, 4.0.3, compiled with 2.3 SDK or 3.2 SDK.
Please provide any additional information below.
This is one of the amazing projects I ever seen in android!
Thanks the author!
Recently, I am trying to use this wheel widget in my own project.
But I encountered some problems about using this widget.
Issue 1:
The items in one wheel may disappear in the situation
of the height of wheel is too long.
For example, in the CitiesActivity of wheel-demo project,
I set the height of R.id.country for "210dp", at that time,
the wheel may disappear during moving the wheel over-scroll down.
A video to demonstrate this issue:
http://youtu.be/d4ClwKixdmE
About this issue, I have employed a workaround modification.
I skip the calling of "rebuildItems()" in the function of
updateView() in "WheelView.java" during MotionEvent.ACTION_MOVE.
That can solve this issue in my case, but I don't know whether
it is a good manner or not.
Issue 2:
I want to add marquee effect in the TextView in wheel widget.
For example, the R.id.city in CitiesActivity, I created a custom
adapter view which contains a TextView that have marquee attribute
enabling.
But it can't do what I want.
I tried to call "textView.requestFocus()" or other functions that
set some attributes of "textView" in AbstractWheelTextAdapter.getItem(),
but also in vain.
I also tried to call "textView.requestFocus()" in "WheelView.addViewItem()",
but also in vain,
I employed the same adapter layout in other normal ListView, it can perform the
marquee effect.
Following code is my layout:
<TextView
android:id="@+id/main_content_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:gravity="center_vertical|center_horizontal"
android:layout_centerVertical="true"
android:textSize="50dip"
android:ellipsize="marquee"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true" />
Thank for your any suggestions in advance!
Eric
Original issue reported on code.google.com by [email protected]
on 3 Feb 2012 at 4:39
1. Create wheel with array addapter
2. Array content ["1","2","3","4","5","60","70","80","900",]
3. if only one digit e.g. 1,2,3 are visible, wheel calculates width for 1
digit. Then if you scroll to 60,70... you will see only 6,7
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
2.1
Please provide any additional information below.
This bug can is also in demo -> Time 2 ->hours column
Original issue reported on code.google.com by [email protected]
on 21 Mar 2012 at 2:36
Hi All,
I want to display the Views such as Month|Date|Year in vertical views rather
displaying Horizontally.
How do I do that ?
Original issue reported on code.google.com by [email protected]
on 26 Sep 2011 at 9:00
To be used like this project:
https://github.com/jgilfelt/android-mapviewballoons
Original issue reported on code.google.com by [email protected]
on 5 Dec 2010 at 3:47
Current NumericWheelAdapter implementation only takes an integer, then convert
to string. It would be nice if it could allow formatted string i.e.
00,01,02,... as in minutes or even decimal.
It can be easily done by introducing an additional constructor to
NumericWheelAdapter:
private String format = null;
public NumericWheelAdapter(int minValue, int maxValue, String format) {
this.minValue = minValue;
this.maxValue = maxValue;
this.format = format;
}
// And modification to the getItem method:
public String getItem(int index) {
if (index >= 0 && index < getItemsCount()) {
if(this.format != null) {
return String.format(this.format, minValue+index);
} else {
return Integer.toString(minValue + index);
}
}
return null;
}
I'm attaching a new NumericWheelAdapter.java
Original issue reported on code.google.com by [email protected]
on 8 Nov 2010 at 3:01
Attachments:
Issue #5 is marked as fixed but as of Android 4.0 the behavior is back.
I have the latest version of the Wheel but running on a real device (Samsung
Galaxy SII) with Android 4.0.4 the Wheel scrolls inside a ScrollView but it is
VERY unresponsive. I need to make sure to click precisely in the center of the
wheel hold my position for a moment and slowly scroll. With the same wheel
outside of the ScrollView it functions flawlessly.
My layout:
--------------main layout
LinearLayout
ScrollView
LinearLayout
-----------------compound control layout
LinearLayout
WheelView
WheelView
WheelView
Not sure if it matters but the direct parent of the wheel is not the ScrollView
so the call to getParent().requestDisallowInterceptTouchEvent(true) might not
be working properly. The WheelView is inside a compound control and I believe
the parent LinearLayout is being merged into the next parent so the end result
overall is only 2 LinearLayouts not 3 (I could be mistaken about that).
I tried to put a while loop in its place that recursively went through all
parent checking for ScrollViews and making the appropriate call as needed but
this didn't work either.
Original issue reported on code.google.com by [email protected]
on 4 Feb 2013 at 6:31
Implement an ability to use custom views as wheel items.
Original issue reported on code.google.com by [email protected]
on 25 Dec 2010 at 7:19
I have an "issue".
The issue is the following:
I have 5 wheels, each one with 32 items, i have the item images both in mdpi
and hpdi, when i run my slot app in Samsung Galaxy Pro
(http://www.smart-gsm.com/moviles/samsung-galaxy-pro) wich screen is mdpi it
runs very smoothly, but when i run the same app in a Sony Ericcson Xperia Neo
(http://www.smart-gsm.com/moviles/sony-ericsson-xperia-neo) when scrolls it
doesn't seem so smooth like in the Samsung, and can't understand why because
the last celphone is better than the first one... Did it happen to you? any
suggestions???
Thanks in advice!!!
Original issue reported on code.google.com by [email protected]
on 1 Aug 2012 at 4:21
Process which I have followed for installing the application:
1. Firstly I have imported MY application.
2. Then I have imported the Kankan wheel application .
3. And I have deployed the wheel app and marked it as a library and imported
into MY application.
4. After running the MY application its showing the exception as either
โKankan wheel.widget.wheelviewโ class not found or Error in inflating the
binary xml.
Please provide me the solution as soon as possible
Original issue reported on code.google.com by [email protected]
on 18 Oct 2012 at 6:01
What steps will reproduce the problem?
1. Run an application with Text wheel
What is the expected output? What do you see instead?
What I would like to do, is highlight the selected item in a different color. I
looked at the date examples (which uses a different color for TODAY) and tried
changing the color is AbstractWheelTextAdapter, this didn't work as don't have
the notion of selected item. This would mean changing the color each time the
selection is changed, do you think this is feasible ? Is there an easy way to
do this ?
What version of the product are you using? On what operating system?
Wheel version 2.1
Android 2.3.3-4.04
Original issue reported on code.google.com by [email protected]
on 2 Apr 2013 at 12:30
What steps will reproduce the problem?
1. Open project with Android Wheel
2. Run Android Lint for the project
Lint now recommends to have Handler static, according to link below, it's not
such fatal issue when not using long-delayed Messages posted in queue to
Handler, but it's still design fault.
Could you please write a subclass for Handler, and fix this issue?
Link (1) :
http://stackoverflow.com/questions/11407943/this-handler-class-should-be-static-
or-leaks-might-occur-incominghandler
Link (2) :
http://stackoverflow.com/questions/11278875/handlers-and-memory-leaks-in-android
Original issue reported on code.google.com by [email protected]
on 3 Sep 2012 at 8:55
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 18 Sep 2011 at 1:32
Dear sir, first.thanks for your great work .I get a issue to report,maybe it
can make this view more helpful.
What steps will reproduce the problem?
1. setup two wheel view called level1 and level2
2. setup a change listener to level1,update the level2's adapter in the
listener's method
3. scroll up and down of level1 wheel, level2 not update (repaint)
What is the expected output? What do you see instead?
It should update the level2 wheel.
Code likes below:
this.level1ItemWheel = (WheelView) findViewById(R.id.level1Item);
this.level2ItemWheel = (WheelView) findViewById(R.id.level2Item);
level1ItemWheel.setAdapter(new ArrayWheelAdapter<String>(
new String[]{"level1A","level1B"}));
level1ItemWheel.setVisibleItems(5);
level1ItemWheel.setCurrentItem(0);
level2ItemWheel.setAdapter(new ArrayWheelAdapter<String>(
new String["child1_of_level1A","child2_of_level1A"]));
level2ItemWheel.setVisibleItems(5);
level2ItemWheel.setCurrentItem(0);
level1ItemWheel.addChangingListener(new OnWheelChangedListener(){
public void onChanged(WheelView wheel, int oldValue, int newValue) {
if (wheel == level1ItemWheel && newValue==1) { //when scroll to levelB,change it's child list.
String level1Item = wheel.getAdapter().getItem(newValue);
//not working!!!!!!!!!!!!!!!!here
level2ItemWheel.setAdapter(new ArrayWheelAdapter<String>( new String[]{"child1_of_level1B"} ));
level2ItemWheel.setVisibleItems(5);
level2ItemWheel.setCurrentItem(0);
return;
}
);
How to fix it:
I found that setCurrentItem of WheelView ,check the select index before
invalidate the ui.
public void setCurrentItem(int index, boolean forceInvalidate) {
if (index != currentItem) {
invalidateLayouts();
int old = currentItem;
currentItem = index;
notifyChangingListeners(old, currentItem);
invalidate();
}
}
This may cause the second wheel not update view in this situation. I overload a
new method:
public void setCurrentItem(int index, boolean forceInvalidate) {
if (forceInvalidate || index != currentItem) { //use can choose weather he want to update the ui to new adapter here
invalidateLayouts();
int old = currentItem;
currentItem = index;
notifyChangingListeners(old, currentItem);
invalidate();
}
}
And modify the code line in the change listener:
level2ItemWheel.setAdapter(new ArrayWheelAdapter<String>( new
String[]{"child1_of_level1B"} ));
level2ItemWheel.setVisibleItems(5);
level2ItemWheel.setCurrentItem(0,true);///And now it can work now!!!
Hope this can help....
Original issue reported on code.google.com by [email protected]
on 31 Oct 2010 at 12:06
Add support for interval / step in a numeric adapter
Original issue reported on code.google.com by [email protected]
on 4 Feb 2012 at 8:54
Attachments:
Inside a wheel I spin a whole custom view instead of text\pictures. So I've
found out that view buttons didn't work.
I tried OnWheelClickedListener, overrided onItemClicked, and after gettig
displayed View I get children items and perform click on buttons in case
coordinates of the TouchEvent are in button's bounds. You see my way isn't
graceful. Moreover buttons' animation doesn't work.
Could you please explain, what prevents displayed buttons from being pressed?
Original issue reported on code.google.com by [email protected]
on 5 Aug 2011 at 11:59
What steps will reproduce the problem?
1. The component not showed in a dialog.
What is the expected output? What do you see instead?
A dialog with the wheel for choose a quantity.
The dialog is shown but the wheel don't see.
What version of the product are you using? On what operating system?
Windows 7 Ultimate SP1 x64.
Android API 10.
Eclipse.
Android SDK r17.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 9 Apr 2012 at 5:37
Attachments:
There is one problem! Unable to android-wheel scroll in ListView. Turns the
list itself, not android-wheel. Help please. Sorry for my english.
Original issue reported on code.google.com by [email protected]
on 14 Apr 2013 at 4:20
What steps will reproduce the problem?
1. I have a problem with wheelView: when slot stops i need to setup animation
on single item. How can i do it?
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 16 Jan 2013 at 4:44
What steps will reproduce the problem?
1. built a month(3 characters)/day/year/hour/minute date picker and the text
got messed up on the month and year
2. changed WheelView.TEXT_SIZE (14) rebuilt and things were better
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 17 Dec 2010 at 6:55
This is a feature request.
I'd like the time wheels to be linked in a way that for example when I cross
the date barrier with the hour wheel, the date should increase or decrease
appropriatly.
The same should apply for the hour barrier and the minutes wheel.
Original issue reported on code.google.com by [email protected]
on 13 Sep 2011 at 12:51
Rename AbstractWheelAdapter.notifyDataChangedEvent to
BaseAdapter.notifyDataSetChanged
to conform common android adapter method coventions.
Original issue reported on code.google.com by [email protected]
on 24 Feb 2012 at 4:26
First - superb, excellent, brilliant and thanks so much for this, its very good
of you to provide this to the community.
What steps will reproduce the problem?
1. Set the height of the container, so that at text height 24 (the default),
there is not enough room to totally display 4 'display items' vertically (I was
using a simple number picker)
2. Observe that the display tries to fit 4 on the screen but cant centre the
numbers in the screen (I am using a simple number picker)
What is the expected output?
1
-
2
-
3
What do you see instead?
1
- 2
- 3
4
What version of the product are you using?
1.4
On what operating system?
Android 2.2
Please provide any additional information below.
I tried playing with text height, setting it to 16 seemed to work OK (but that
means I had to edit core code since text height is not a settable attribute,
mking upgrades in the future more difficult).
I think I might see the same issue when the screen size changes though, and
supporting multiple screen heights is exactly the thing that will prevent me
from explicitly setting the height of the container for the wheel.
Original issue reported on code.google.com by [email protected]
on 5 Dec 2010 at 12:53
Attachments:
Hello,
I have downloaded source file from svn but I am unable to find any
documentation that gives me step by step guide to link this widget with my app
or how to integrate it. Can you please write it down here or send me link where
it give step by step guide to plug it in the app.
Thanks
Ayaz Alavi
Original issue reported on code.google.com by [email protected]
on 13 Dec 2011 at 2:41
What steps will reproduce the problem?
1. Create a wheel with multiple elements some with a width of 2-3 char, some
with a width of 12 char
2. Set the wheel up such that on creation only elements of width 2-3 char are
visible
What is the expected output? What do you see instead?
The width of the wheel should match the width of the widest view in the series
of elements. Instead the width matches the widest view visible at the time of
creation of the wheel
What version of the product are you using? On what operating system?
2.1 on Android 2.2.
Please provide any additional information below.
I think I should be able to provide a patch but have not completed it as of
this stage.
I believe the desired functionality can be achieved by changing
calculateLayoutWidth(int widthSize, int mode) to loop through the elements of
viewAdapter and using the maximum value for width from all elements of the
adapter rather than itemsLayout.getMeasuredWidth().
Original issue reported on code.google.com by [email protected]
on 25 Mar 2011 at 7:11
I want to increase the scroll time when we manually select set number to a
wheel. The scroll time is okay at random scroll. I am expecting same
behaviour at setCurrent() method.
Original issue reported on code.google.com by [email protected]
on 28 Sep 2012 at 9:42
This is more a request for enhancement, with the iPhone equivalent (yes I know
android is not iPhone, but we can always 'steal' some of their usability
ideas), in a number picker (could be any item though), if you click on a number
that is not in the middle, that number is then pushed to the middle (as apposed
to just dragging it to the middle). Its a neat enhancement.
I didnt want to alter the core code to make upgrades possible in the future so
I extended the class with the below, but you could potentially add the
'(getHeight()/2) - event.getY())' bit into your action_up with some invalidates
and it would be done. Its your code so your call, just a sugestion. Anyway,
here is the important bits of the overriding class ...
public class TouchWheelView extends WheelView {
private boolean isScrollingPerformed;
private float clickDownY = 0.0F ;
/**
* Constructor
*/
public TouchWheelView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
/**
* Constructor
*/
public TouchWheelView(Context context, AttributeSet attrs) {
super(context, attrs);
}
/**
* Constructor
*/
public TouchWheelView(Context context) {
super(context);
this.onFinishInflate();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
// Add listeners to emulate the isScrollingPerformed behaviour
this.addScrollingListener(new OnWheelScrollListener() {
public void onScrollingStarted(WheelView wheel) {
isScrollingPerformed = true;
}
public void onScrollingFinished(WheelView wheel) {
isScrollingPerformed = false;
}
});
}
@Override
public boolean onTouchEvent(MotionEvent event) {
WheelAdapter adapter = getAdapter();
if (adapter == null) {
return true;
}
// for my event, if an item is click (when button goes up), if click is outside focus region, emulate a move
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
clickDownY = event.getY();
isScrollingPerformed = false ;
break;
}
case MotionEvent.ACTION_MOVE: {
isScrollingPerformed = true ;
break;
}
case MotionEvent.ACTION_UP:
if (!isScrollingPerformed) {
// Pretend to to a move
event.setAction(MotionEvent.ACTION_MOVE);
event.setLocation(event.getX(), clickDownY + ((getHeight()/2) - event.getY()));
super.onTouchEvent(event);
// Now reset back to what it was
event.setAction(MotionEvent.ACTION_UP);
event.setLocation(event.getX(), (getHeight()/2));
}
break;
}
return super.onTouchEvent(event);
}
}
Original issue reported on code.google.com by [email protected]
on 5 Dec 2010 at 1:01
What steps will reproduce the problem?
1.WheelView.setLable() method
2.
3.
What is the expected output? What do you see instead?
I need to set text label on current item
What version of the product are you using? On what operating system?
Revision.20
Please provide any additional information below.
Have any other method can instead setLabel()?
Original issue reported on code.google.com by [email protected]
on 22 Aug 2012 at 8:41
How to make wheel always win each mixWheel() function called?
Please help me, thanks you
Original issue reported on code.google.com by [email protected]
on 5 Nov 2012 at 8:50
It would be useful in some cases that the shadow is optional and not mandatory
as presently.
For that purpose I attach a patch so that the user gets an option to disable
the shadow.
Original issue reported on code.google.com by [email protected]
on 28 Feb 2011 at 1:58
Attachments:
Hello
please add the possibility to animate an item in the wheel when the scrolling
stops, or indicate possible way to achieve this. For example I have tried
already by using AnimatedDrawable as items but I can not get the items to
animate.
Original issue reported on code.google.com by [email protected]
on 12 Feb 2012 at 9:53
What steps will reproduce the problem?
1. slot machine smoothness
2.
3.
What is the expected output? What do you see instead?
When wheel moves, images doesn't move like in slot machine.it jumps and
replaced by the author. Please make it fine
What version of the product are you using? On what operating system?
2.1
Please provide any additional information below.
I need smoothness in wheel for slot machine
Original issue reported on code.google.com by [email protected]
on 31 Jan 2012 at 5:43
Add the possibility to set visible items count declaratively (in the XML layout
files) like this:
kankan.wheel.widget.WheelView android:id="@+id/day"
some_namespace_prefix:visibleItems="1"
Original issue reported on code.google.com by [email protected]
on 3 Dec 2011 at 10:10
Would you consider publishing wheel as a maven module?
I've attached a pom.xml file for wheel, and one for wheel-demo based on
revision 20.
Thanks
Original issue reported on code.google.com by [email protected]
on 22 Mar 2011 at 6:56
Attachments:
Hi, I would love to have the following missing animations:
a)
onFling animation. When I scroll too fast, it should go fast until it stops.
b)
Animate to the correct position.
When you select in the middle between two options instead of animateTo it just
place the correct one.
You can get some code that does the following here:
http://code.google.com/p/android-misc-widgets/source/browse/trunk/android-misc-w
idgets/src/org/miscwidgets/widget/Switcher.java
Thanks!
Original issue reported on code.google.com by [email protected]
on 8 Nov 2010 at 6:17
Hi,I have used Android wheel widget in my application,i have got some error
reports from the market, that is given bellow, Please tell me how this will
resolve,
Thanks
java.lang.RuntimeException: Canvas: trying to use a recycled bitmap
android.graphics.Bitmap@41f9cad8
at android.graphics.Canvas.throwIfRecycled(Canvas.java:1026)
at android.graphics.Canvas.drawBitmap(Canvas.java:1127)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:393)
at android.widget.ImageView.onDraw(ImageView.java:961)
at android.view.View.draw(View.java:13528)
at android.view.View.draw(View.java:13412)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13531)
at com.dstudios.wheelWidget.WheelView.drawItems(WheelView.java:574)
at com.dstudios.wheelWidget.WheelView.onDraw(WheelView.java:544)
at android.view.View.draw(View.java:13528)
at android.view.View.draw(View.java:13412)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13410)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13410)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13531)
at android.view.View.draw(View.java:13412)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13410)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13410)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13633)
at android.widget.FrameLayout.draw(FrameLayout.java:467)
at android.widget.ScrollView.draw(ScrollView.java:1567)
at android.view.View.draw(View.java:13412)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13531)
at android.view.View.draw(View.java:13412)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13410)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13410)
at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
at android.view.View.draw(View.java:13531)
at android.widget.FrameLayout.draw(FrameLayout.java:467)
at
com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:220
5)
at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2256)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2151)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2019)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1830)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4216)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4912)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Original issue reported on code.google.com by [email protected]
on 11 Dec 2012 at 6:01
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.