Correction bug > Choix d'un mot de passe avec une pièce vide alors que que non autorisée
This commit is contained in:
parent
901c514158
commit
cdc3597786
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -16,27 +16,33 @@ public class ChoixDuMotDePasse extends AppCompatActivity {
|
|||||||
|
|
||||||
private UnePiece un, deux, trois, quatre;
|
private UnePiece un, deux, trois, quatre;
|
||||||
|
|
||||||
|
private boolean vide;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_choix_du_mot_de_passe);
|
setContentView(R.layout.activity_choix_du_mot_de_passe);
|
||||||
|
|
||||||
|
this.vide = this.getIntent().getBooleanExtra("vide", false);
|
||||||
|
|
||||||
this.un=(UnePiece) this.findViewById(R.id.code1);
|
this.un=(UnePiece) this.findViewById(R.id.code1);
|
||||||
this.deux=(UnePiece) this.findViewById(R.id.code2);
|
this.deux=(UnePiece) this.findViewById(R.id.code2);
|
||||||
this.trois=(UnePiece) this.findViewById(R.id.code3);
|
this.trois=(UnePiece) this.findViewById(R.id.code3);
|
||||||
this.quatre=(UnePiece) this.findViewById(R.id.code4);
|
this.quatre=(UnePiece) this.findViewById(R.id.code4);
|
||||||
|
|
||||||
boolean t=this.getIntent().getBooleanExtra("vide", false);
|
this.un.setOnTouchListener(new MonOnTouchListener(this.un, this.vide));
|
||||||
this.un.setOnTouchListener(new MonOnTouchListener(this.un, t));
|
this.deux.setOnTouchListener(new MonOnTouchListener(this.deux, this.vide));
|
||||||
this.deux.setOnTouchListener(new MonOnTouchListener(this.deux, t));
|
this.trois.setOnTouchListener(new MonOnTouchListener(this.trois, this.vide));
|
||||||
this.trois.setOnTouchListener(new MonOnTouchListener(this.trois, t));
|
this.quatre.setOnTouchListener(new MonOnTouchListener(this.quatre, this.vide));
|
||||||
this.quatre.setOnTouchListener(new MonOnTouchListener(this.quatre, t));
|
|
||||||
|
|
||||||
this.findViewById(R.id.bouton_valider_code).setOnTouchListener(new OnTouchBoutonValider(this));
|
this.findViewById(R.id.bouton_valider_code).setOnTouchListener(new OnTouchBoutonValider(this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(){
|
public void start(){
|
||||||
|
if(!this.vide && (this.un.getColor()==6 || this.deux.getColor()==6 || this.trois.getColor()==6 || this.quatre.getColor()==6)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
Intent mastermind=new Intent(this, MasterMindActivity.class);
|
Intent mastermind=new Intent(this, MasterMindActivity.class);
|
||||||
Intent data=this.getIntent();
|
Intent data=this.getIntent();
|
||||||
mastermind.putExtra("vide", data.getBooleanExtra("vide", false));
|
mastermind.putExtra("vide", data.getBooleanExtra("vide", false));
|
||||||
|
@ -14,10 +14,8 @@ public class MonOnTouchListener implements View.OnTouchListener {
|
|||||||
public MonOnTouchListener(UnePiece p, boolean t){
|
public MonOnTouchListener(UnePiece p, boolean t){
|
||||||
this.detector=new GestureDetector(new MonGestureListener(p));
|
this.detector=new GestureDetector(new MonGestureListener(p));
|
||||||
this.detector.setOnDoubleTapListener(new MonOnDoubleTapListener(p));
|
this.detector.setOnDoubleTapListener(new MonOnDoubleTapListener(p));
|
||||||
if(t==false){
|
|
||||||
this.detector.setIsLongpressEnabled(t);
|
this.detector.setIsLongpressEnabled(t);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user