<commit_before>package de.avalax.fitbuddy.app.swipeBar;

import android.content.Context;
import android.support.v4.view.VelocityTrackerCompat;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;

public abstract class SwipeBarOnTouchListener implements View.OnTouchListener {
    private static int SWIPE_MIN_DISTANCE;
    private static int SWIPE_THRESHOLD_VELOCITY;

    private final GestureDetector gdt;

    public SwipeBarOnTouchListener(Context context, SwipeableBar swipeableBar, int swipeMoveMax) {
        final SwipeBarOnTouchListener touchListener = this;
	      final ViewConfiguration vc = ViewConfiguration.get(context);
	      SWIPE_MIN_DISTANCE = vc.getScaledPagingTouchSlop();
	      SWIPE_THRESHOLD_VELOCITY = vc.getScaledMinimumFlingVelocity();

	      Log.d("", "swipeMinDistance = " + SWIPE_MIN_DISTANCE);
	      Log.d("", "swipeThresholdVelocity = " + SWIPE_THRESHOLD_VELOCITY);

        gdt = new GestureDetector(context,new SwipeBarOnGestureListener(swipeMoveMax, swipeableBar, SWIPE_MIN_DISTANCE, SWIPE_THRESHOLD_VELOCITY) {
            @Override
            public void onFlingEvent(int moved) {
                touchListener.onFlingEvent(moved);
            }

            @Override
            public void onLongPressedLeftEvent() {
                touchListener.onLongPressedLeftEvent();
            }

            @Override
            public void onLongPressedRightEvent() {
                touchListener.onLongPressedRightEvent();
            }

        });
    }

    @Override
    public boolean onTouch(final View v, final MotionEvent event) {
        gdt.onTouchEvent(event);
        return true;
    }

    protected abstract void onFlingEvent(int moved);

    protected abstract void onLongPressedLeftEvent();

    protected abstract void onLongPressedRightEvent();
}<commit_msg>-refactoring -deleted logentries<commit_after>package de.avalax.fitbuddy.app.swipeBar;

import android.content.Context;
import android.support.v4.view.VelocityTrackerCompat;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;

public abstract class SwipeBarOnTouchListener implements View.OnTouchListener {
    private int minSwipeDistance;
    private int thresholdSwipeVelocity;
		private ViewConfiguration viewConfiguration;

    private final GestureDetector gdt;

    public SwipeBarOnTouchListener(Context context, SwipeableBar swipeableBar, int swipeMoveMax) {
        final SwipeBarOnTouchListener touchListener = this;
	      viewConfiguration = ViewConfiguration.get(context);
	      minSwipeDistance = viewConfiguration.getScaledPagingTouchSlop();
	      thresholdSwipeVelocity = viewConfiguration.getScaledMinimumFlingVelocity();

        gdt = new GestureDetector(context,new SwipeBarOnGestureListener(swipeMoveMax, swipeableBar, minSwipeDistance, thresholdSwipeVelocity) {
            @Override
            public void onFlingEvent(int moved) {
                touchListener.onFlingEvent(moved);
            }

            @Override
            public void onLongPressedLeftEvent() {
                touchListener.onLongPressedLeftEvent();
            }

            @Override
            public void onLongPressedRightEvent() {
                touchListener.onLongPressedRightEvent();
            }

        });
    }

    @Override
    public boolean onTouch(final View v, final MotionEvent event) {
        gdt.onTouchEvent(event);
        return true;
    }

    protected abstract void onFlingEvent(int moved);

    protected abstract void onLongPressedLeftEvent();

    protected abstract void onLongPressedRightEvent();
}
{'fraction_non_alphanumeric': 0.06987012987012987, 'fraction_numerical': 0.0005194805194805195, 'mean_word_length': 3.361268403171008, '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': '4558262', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1041, 'n_words': 213}