package fr.iutfbleau.grille;

import android.graphics.Color;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;

public class ControleurGestureCase implements GestureDetector.OnGestureListener {

    private final View composant;

    public ControleurGestureCase(View composant) {
        this.composant = composant;
    }

    @Override
    public boolean onDown(MotionEvent e) {
        return true;
    }

    @Override
    public boolean onFling(MotionEvent e1, MotionEvent e2, float x, float y) {
        this.composant.setBackgroundColor(Color.TRANSPARENT);
        return true;
    }

    @Override
    public void onLongPress(MotionEvent e) {
        this.composant.setBackgroundColor(Color.YELLOW);
    }

    @Override
    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
        return false;
    }

    @Override
    public void onShowPress(MotionEvent e) {
    }

    @Override
    public boolean onSingleTapUp(MotionEvent e) {
        return false;
    }
}
