ajout listener

This commit is contained in:
Haïssous Kayyissa 2023-04-04 10:26:04 +02:00
parent 6079ddb71f
commit 68edb7645c
2 changed files with 23 additions and 0 deletions

View File

@ -23,6 +23,7 @@ public class GameView extends View {
super(context); super(context);
this.saisie=saisie; this.saisie=saisie;
this.grille=grille; this.grille=grille;
this.setOnTouchListener(new TouchListener());
//on initialise les collections de pions //on initialise les collections de pions
initpions(); initpions();
this.circle = new Paint(); this.circle = new Paint();

View File

@ -0,0 +1,22 @@
package com.example.mastermind.game;
import android.view.MotionEvent;
import android.view.View;
public class TouchListener implements View.OnTouchListener{
public TouchListener(){}
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getActionMasked();
Float x = event.getX();
Float y = event.getY();
if (action==MotionEvent.ACTION_UP)
{
}
return true;
}
}