<commit_before>package net.somethingdreadful.MAL;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RatingBar;

public class SlidingRatingBar extends RatingBar {

    float prevX;
    Context c;

    IUpdateRatingText passer;

    public SlidingRatingBar(Context context) {
        super(context);

        c = context;
    }

    public SlidingRatingBar(Context context, AttributeSet aSet) {
        super(context, aSet);

        c = context;
    }

    public void setPasser(RatingPickerDialogFragment ratingPickerDialogFragment) {
        passer = ratingPickerDialogFragment;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        super.onTouchEvent(event);

        switch (event.getAction()) {
            case MotionEvent.ACTION_MOVE:
                if (isPressed()) {
                    final float x = event.getX();
                    final float THRESHOLD = (float)0.5;
                    if (Math.abs(x - prevX) > THRESHOLD) {
                        passer.updateRatingText(getProgress());

                    }
                    prevX = x;
                }
        }
        return true;
    }

    public interface IUpdateRatingText {
        void updateRatingText(int rating);
    }



}
<commit_msg>Fixed visual bug on touch instead of slide<commit_after>package net.somethingdreadful.MAL;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RatingBar;

public class SlidingRatingBar extends RatingBar {

    float prevX;
    Context c;

    IUpdateRatingText passer;

    public SlidingRatingBar(Context context) {
        super(context);

        c = context;
    }

    public SlidingRatingBar(Context context, AttributeSet aSet) {
        super(context, aSet);

        c = context;
    }

    public void setPasser(RatingPickerDialogFragment ratingPickerDialogFragment) {
        passer = ratingPickerDialogFragment;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        super.onTouchEvent(event);

        switch (event.getAction()) {
            case MotionEvent.ACTION_MOVE:
                if (isPressed()) {
                    final float x = event.getX();
                    final float THRESHOLD = (float)0.5;
                    if (Math.abs(x - prevX) > THRESHOLD) {
                        passer.updateRatingText(getProgress());

                    }
                    prevX = x;
                }
                break;
             case MotionEvent.ACTION_DOWN:
            	passer.updateRatingText(getProgress());
            	break;
        }
        return true;
    }

    public interface IUpdateRatingText {
        void updateRatingText(int rating);
    }



}

{'fraction_non_alphanumeric': 0.07894736842105263, 'fraction_numerical': 0.001422475106685633, 'mean_word_length': 1.9548319327731092, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3520820', 'n_tokens_mistral': 801, 'n_tokens_neox': 729, 'n_words': 166}