<commit_before>package lecho.lib.hellocharts.gesture;

import lecho.lib.hellocharts.Chart;
import android.content.Context;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;

public class PreviewChartTouchHandler extends ChartTouchHandler {

	public PreviewChartTouchHandler(Context context, Chart chart) {
		super(context, chart);
		this.chart = chart;
		gestureDetector = new GestureDetector(context, new ChartGestureListener());
		scaleGestureDetector = new ScaleGestureDetector(context, new ChartScaleGestureListener());
	}

	private class ChartScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {

		@Override
		public boolean onScale(ScaleGestureDetector detector) {
			float scale = detector.getCurrentSpan() / detector.getPreviousSpan();
			if (Float.isInfinite(scale)) {
				scale = 1;
			}
			return chartZoomer.scale(chart.getChartCalculator(), detector.getFocusX(), detector.getFocusY(), scale);
		}
	}

	private class ChartGestureListener extends GestureDetector.SimpleOnGestureListener {
		@Override
		public boolean onDown(MotionEvent e) {
			return chartScroller.startScroll(chart.getChartCalculator());
		}

		@Override
		public boolean onDoubleTap(MotionEvent e) {
			return chartZoomer.startZoom(e, chart.getChartCalculator());
		}

		@Override
		public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
			return chartScroller.scroll(-distanceX, -distanceY, chart.getChartCalculator());
		}

		@Override
		public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
			return chartScroller.fling((int) velocityX, (int) velocityY, chart.getChartCalculator());
		}
	}

}
<commit_msg>Disabled values clicking options for preview charts<commit_after>package lecho.lib.hellocharts.gesture;

import lecho.lib.hellocharts.Chart;
import android.content.Context;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;

public class PreviewChartTouchHandler extends ChartTouchHandler {

	public PreviewChartTouchHandler(Context context, Chart chart) {
		super(context, chart);
		this.chart = chart;
		gestureDetector = new GestureDetector(context, new ChartGestureListener());
		scaleGestureDetector = new ScaleGestureDetector(context, new ChartScaleGestureListener());

		// Disable value touch, not needed for preview chart.
		isValueTouchEnabled = false;
		isValueSelectionEnabled = false;
	}

	private class ChartScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {

		@Override
		public boolean onScale(ScaleGestureDetector detector) {
			float scale = detector.getCurrentSpan() / detector.getPreviousSpan();
			if (Float.isInfinite(scale)) {
				scale = 1;
			}
			return chartZoomer.scale(chart.getChartCalculator(), detector.getFocusX(), detector.getFocusY(), scale);
		}
	}

	private class ChartGestureListener extends GestureDetector.SimpleOnGestureListener {
		@Override
		public boolean onDown(MotionEvent e) {
			return chartScroller.startScroll(chart.getChartCalculator());
		}

		@Override
		public boolean onDoubleTap(MotionEvent e) {
			return chartZoomer.startZoom(e, chart.getChartCalculator());
		}

		@Override
		public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
			return chartScroller.scroll(-distanceX, -distanceY, chart.getChartCalculator());
		}

		@Override
		public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
			return chartScroller.fling((int) velocityX, (int) velocityY, chart.getChartCalculator());
		}
	}

}

{'fraction_non_alphanumeric': 0.08984481350394773, 'fraction_numerical': 0.002722570106180234, 'mean_word_length': 5.803703703703704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3876571', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1054, 'n_words': 240}