public abstract class ChartTouchListener<T extends Chart<?>>
extends android.view.GestureDetector.SimpleOnGestureListener
implements android.view.View.OnTouchListener
| Modifier and Type | Class and Description |
|---|---|
static class |
ChartTouchListener.ChartGesture |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DRAG |
protected T |
mChart
the chart the listener represents
|
protected android.view.GestureDetector |
mGestureDetector
the gesturedetector used for detecting taps and longpresses, ...
|
protected ChartTouchListener.ChartGesture |
mLastGesture
the last touch gesture that has been performed
|
protected Highlight |
mLastHighlighted
the last highlighted object (via touch)
|
protected int |
mTouchMode
integer field that holds the current touch-state
|
protected static int |
NONE |
protected static int |
PINCH_ZOOM |
protected static int |
POST_ZOOM |
protected static int |
ROTATE |
protected static int |
X_ZOOM |
protected static int |
Y_ZOOM |
| Constructor and Description |
|---|
ChartTouchListener(T chart) |
| Modifier and Type | Method and Description |
|---|---|
protected static float |
distance(float eventX,
float startX,
float eventY,
float startY)
returns the distance between two points
|
void |
endAction(android.view.MotionEvent me)
Calls the OnChartGestureListener to do the end callback
|
ChartTouchListener.ChartGesture |
getLastGesture()
Returns the last gesture that has been performed on the chart.
|
int |
getTouchMode()
returns the touch mode the listener is currently in
|
protected void |
performHighlight(Highlight h,
android.view.MotionEvent e)
Perform a highlight operation.
|
void |
setLastHighlighted(Highlight high)
Sets the last value that was highlighted via touch.
|
void |
startAction(android.view.MotionEvent me)
Calls the OnChartGestureListener to do the start callback
|
onContextClick, onDoubleTap, onDoubleTapEvent, onDown, onFling, onLongPress, onScroll, onShowPress, onSingleTapConfirmed, onSingleTapUpprotected ChartTouchListener.ChartGesture mLastGesture
protected static final int NONE
protected static final int DRAG
protected static final int X_ZOOM
protected static final int Y_ZOOM
protected static final int PINCH_ZOOM
protected static final int POST_ZOOM
protected static final int ROTATE
protected int mTouchMode
protected Highlight mLastHighlighted
protected android.view.GestureDetector mGestureDetector
public ChartTouchListener(T chart)
public void startAction(android.view.MotionEvent me)
me - public void endAction(android.view.MotionEvent me)
me - public void setLastHighlighted(Highlight high)
high - public int getTouchMode()
public ChartTouchListener.ChartGesture getLastGesture()
protected void performHighlight(Highlight h, android.view.MotionEvent e)
e - protected static float distance(float eventX,
float startX,
float eventY,
float startY)
eventX - startX - eventY - startY -