diff --git a/.gradle/7.5/executionHistory/executionHistory.bin b/.gradle/7.5/executionHistory/executionHistory.bin index 9272a04..f440dbb 100644 Binary files a/.gradle/7.5/executionHistory/executionHistory.bin and b/.gradle/7.5/executionHistory/executionHistory.bin differ diff --git a/.gradle/7.5/executionHistory/executionHistory.lock b/.gradle/7.5/executionHistory/executionHistory.lock index b3f8bd6..c3b7726 100644 Binary files a/.gradle/7.5/executionHistory/executionHistory.lock and b/.gradle/7.5/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.5/fileHashes/fileHashes.bin b/.gradle/7.5/fileHashes/fileHashes.bin index bd2886b..a5d9614 100644 Binary files a/.gradle/7.5/fileHashes/fileHashes.bin and b/.gradle/7.5/fileHashes/fileHashes.bin differ diff --git a/.gradle/7.5/fileHashes/fileHashes.lock b/.gradle/7.5/fileHashes/fileHashes.lock index 38d56ea..81566d4 100644 Binary files a/.gradle/7.5/fileHashes/fileHashes.lock and b/.gradle/7.5/fileHashes/fileHashes.lock differ diff --git a/.gradle/7.5/fileHashes/resourceHashesCache.bin b/.gradle/7.5/fileHashes/resourceHashesCache.bin index 52008df..cbdff21 100644 Binary files a/.gradle/7.5/fileHashes/resourceHashesCache.bin and b/.gradle/7.5/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index b6c7fbc..552cbf0 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java b/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java index ff86cdb..8e9f1b6 100644 --- a/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java +++ b/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java @@ -15,28 +15,34 @@ import java.util.Random; public class ChoixDuMotDePasse extends AppCompatActivity { private UnePiece un, deux, trois, quatre; + + private boolean vide; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); 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.deux=(UnePiece) this.findViewById(R.id.code2); this.trois=(UnePiece) this.findViewById(R.id.code3); this.quatre=(UnePiece) this.findViewById(R.id.code4); - - boolean t=this.getIntent().getBooleanExtra("vide", false); - this.un.setOnTouchListener(new MonOnTouchListener(this.un, t)); - this.deux.setOnTouchListener(new MonOnTouchListener(this.deux, t)); - this.trois.setOnTouchListener(new MonOnTouchListener(this.trois, t)); - this.quatre.setOnTouchListener(new MonOnTouchListener(this.quatre, t)); + + this.un.setOnTouchListener(new MonOnTouchListener(this.un, this.vide)); + this.deux.setOnTouchListener(new MonOnTouchListener(this.deux, this.vide)); + this.trois.setOnTouchListener(new MonOnTouchListener(this.trois, this.vide)); + this.quatre.setOnTouchListener(new MonOnTouchListener(this.quatre, this.vide)); this.findViewById(R.id.bouton_valider_code).setOnTouchListener(new OnTouchBoutonValider(this)); } 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 data=this.getIntent(); mastermind.putExtra("vide", data.getBooleanExtra("vide", false)); diff --git a/app/src/main/java/com/example/mastermind/controller/mastermind/MonOnTouchListener.java b/app/src/main/java/com/example/mastermind/controller/mastermind/MonOnTouchListener.java index 2347695..17f3d37 100644 --- a/app/src/main/java/com/example/mastermind/controller/mastermind/MonOnTouchListener.java +++ b/app/src/main/java/com/example/mastermind/controller/mastermind/MonOnTouchListener.java @@ -14,9 +14,7 @@ public class MonOnTouchListener implements View.OnTouchListener { public MonOnTouchListener(UnePiece p, boolean t){ this.detector=new GestureDetector(new MonGestureListener(p)); this.detector.setOnDoubleTapListener(new MonOnDoubleTapListener(p)); - if(t==false){ - this.detector.setIsLongpressEnabled(t); - } + this.detector.setIsLongpressEnabled(t); } @Override