In my program I would like to use two sets of wheels like the following:
hours = (WheelView) findViewById(R.id.hour);
NumericWheelAdapter hourAdapter = new NumericWheelAdapter(this, 0, 23, "%02d");
hourAdapter.setItemResource(R.layout.wheel_text_item);
hourAdapter.setItemTextResource(R.id.text);
hours.setViewAdapter(hourAdapter);
hours.setCyclic(true);
These wheels have a scrollinglistener hours.addScrollingListener(scrolledListener);
The scrollinglistener looks like this:
// Wheel scrolled listener
OnWheelScrollListener scrolledListener = new OnWheelScrollListener() {
public void onScrollingStarted(WheelView wheel) {
}
public void onScrollingFinished(WheelView wheel) {
update();
}
};
I would like to set one wheel with the value of the other but when I instantiate two listeners and scroll the first one it goes on setting wheel one and then wheel two and then wheel one again.
Is it possible to disable a one of the two scrolledListener?
I've tried this:
hours.addScrollingListener(null);
hours.setEnabled(false);
But this gave an error and the program had to be stopped.
Thanks for your help!
PS: the wheels are from * Android Wheel Control. * https://code.google.com/p/android-wheel/