|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkankan.wheel.widget.WheelScroller
public class WheelScroller
Scroller class handles scrolling events and updates the
Nested Class Summary | |
---|---|
static interface |
WheelScroller.ScrollingListener
Scrolling listener interface |
Field Summary | |
---|---|
private Handler |
animationHandler
|
private Context |
context
|
private GestureDetector |
gestureDetector
|
private SimpleOnGestureListener |
gestureListener
|
private boolean |
isScrollingPerformed
|
private int |
lastScrollY
|
private float |
lastTouchedY
|
private WheelScroller.ScrollingListener |
listener
|
private int |
MESSAGE_JUSTIFY
|
private int |
MESSAGE_SCROLL
|
static int |
MIN_DELTA_FOR_SCROLLING
Minimum delta for scrolling |
private Scroller |
scroller
|
private static int |
SCROLLING_DURATION
Scrolling duration |
Constructor Summary | |
---|---|
WheelScroller(Context context,
WheelScroller.ScrollingListener listener)
Constructor |
Method Summary | |
---|---|
private void |
clearMessages()
Clears messages from queue |
(package private) void |
finishScrolling()
Finishes scrolling |
private void |
justify()
Justifies wheel |
boolean |
onTouchEvent(MotionEvent event)
Handles Touch event |
void |
scroll(int distance,
int time)
Scroll the wheel |
void |
setInterpolator(Interpolator interpolator)
Set the the specified scrolling interpolator |
private void |
setNextMessage(int message)
Set next message to queue. |
private void |
startScrolling()
Starts scrolling |
void |
stopScrolling()
Stops scrolling |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int SCROLLING_DURATION
public static final int MIN_DELTA_FOR_SCROLLING
private WheelScroller.ScrollingListener listener
private Context context
private GestureDetector gestureDetector
private Scroller scroller
private int lastScrollY
private float lastTouchedY
private boolean isScrollingPerformed
private SimpleOnGestureListener gestureListener
private final int MESSAGE_SCROLL
private final int MESSAGE_JUSTIFY
private Handler animationHandler
Constructor Detail |
---|
public WheelScroller(Context context, WheelScroller.ScrollingListener listener)
context
- the current contextlistener
- the scrolling listenerMethod Detail |
---|
public void setInterpolator(Interpolator interpolator)
interpolator
- the interpolatorpublic void scroll(int distance, int time)
distance
- the scrolling distancetime
- the scrolling durationpublic void stopScrolling()
public boolean onTouchEvent(MotionEvent event)
event
- the motion event
private void setNextMessage(int message)
message
- the message to setprivate void clearMessages()
private void justify()
private void startScrolling()
void finishScrolling()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |