Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData<
private boolean mScaleXEnabled = true;
private boolean mScaleYEnabled = true;

/**
* if true, fling gesture is enabled for the chart
*/
private boolean mFlingEnabled = false;

/**
* paint object for the (by default) lightgrey background of the grid
*/
Expand Down Expand Up @@ -1169,6 +1174,22 @@ public boolean isScaleYEnabled() {
return mScaleYEnabled;
}

/**
* Set this to true to enable fling gesture for the chart
*
* @param enabled
*/
public void setFlingEnabled(boolean enabled) { this.mFlingEnabled = enabled; }

/**
* Returns true if fling gesture is enabled for the chart, false if not.
*
* @return
*/
public boolean isFlingEnabled() {
return mFlingEnabled;
}

/**
* Set this to true to enable zooming in by double-tap on the chart.
* Default: enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public boolean onTouch(View v, MotionEvent event) {
}
}

if (mTouchMode == NONE) {
if (mChart.isFlingEnabled()) {
mGestureDetector.onTouchEvent(event);
}

Expand Down