From cdc3597786dcb6c3bb69a5041edba9e7ba8e0858 Mon Sep 17 00:00:00 2001 From: chaignea Date: Sat, 8 Apr 2023 13:42:19 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20bug=20>=20Choix=20d'un=20mot=20de?= =?UTF-8?q?=20passe=20avec=20une=20pi=C3=A8ce=20vide=20alors=20que=20que?= =?UTF-8?q?=20non=20autoris=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../7.5/executionHistory/executionHistory.bin | Bin 975205 -> 975205 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/7.5/fileHashes/fileHashes.bin | Bin 72665 -> 72665 bytes .gradle/7.5/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../7.5/fileHashes/resourceHashesCache.bin | Bin 19789 -> 19857 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .../example/mastermind/ChoixDuMotDePasse.java | 18 ++++++++++++------ .../mastermind/MonOnTouchListener.java | 4 +--- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.gradle/7.5/executionHistory/executionHistory.bin b/.gradle/7.5/executionHistory/executionHistory.bin index 9272a048fc26a239cbdf8a316b519ccca0724289..f440dbbb6a70debb606136f293d57240eb884acc 100644 GIT binary patch delta 1545 zcmah}Yfw{16wbX#l-DjdAwmeoP^AchF%W{U)?yJ_tPn=Wu@aGhKph1Ip%z~e=*0@8 z6p*@tBI>9q;G?v5)(4`*NKt4l;0qn_i2_9wgs33Un>f=S@rV0s_w1Q(&wl6oPKSPO zhkkB4P0%FGra3g19!HO-t!Qi7hPI{cP66?h$uWL@aS8D;sTiRW$b>2_51EPKBQ0->m zjJCx?h`Tdk4vEA4!7VQDT3*q>qy5Q^hZkj))!2qa-bQ_Y+RegAp8yw9u3Os_+tO_l zy2o?%iM4J~vfiT=Sw8*B$FpdUFUC%cT;{-vwkSsS#MC zsB*9ZFFXoYbMU!9(0k;AL=awRz7}{PX&M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?j*G2{x3#2+7yNx zvX2zk)2PWDD(7DNNk_GB=HSMzQLp{hgNAPknU$!yaF=7AOIU2=mBeFj<+%-x$1{11 zwnshNBF4>L$bYO*uP*mdmZHhIFwW-u(6VSYay2m%9gY<%9Rhw}$aR9d9bF`Pu*TR5 z)tE!dcIrl*;1$WRAwy0=buU79A;qc1W*)PA7LN zU;y3}4Mzzqy9RAYR4Rczc*9NjoG{a@EPH$=cuRMg-O?*1?V%fqYE&r%AK?Ni{D8p4 zx8ZGqYrZ2%^Q+m5>i(D<`oU;!M%R>W&RCoTj0n^qgA_+I&IAMX$lx&~xetrb)h`(x z`YBM*0H$;_{XMJeTI8dnT@;^>ZEM0CVK<3UF*#lyJ_X-+r;{bf9<^Hhm$zttBs~_$xm|6Ddp@`}?7T)$|TK z{(egrKw+ssNZF<;x-Zv#T(a?9`gbpaB3n?{0E}ZlXUas)1JEt-o3+9B&*iSuZd-Rw z)||Mnf+_q$TgPQdrqJR1kk5RN$2*)E=!Y05*99*8l(j literal 17 UcmZQxXdCxzS@nKj1_&qv05)p`$p8QV diff --git a/.gradle/7.5/fileHashes/fileHashes.bin b/.gradle/7.5/fileHashes/fileHashes.bin index bd2886b039e2535927425857b2902d41a0f069bd..a5d9614bc68ed4a64f2aa36281ee3461166e623e 100644 GIT binary patch delta 579 zcmcb)o#p0smJJ)1D12QoZHZ@uq9dPqRd(c+J=Yi*7~2z8Woj^h0Y~ZNi%ZHB9?EJY zq}n~6?)?ao@!9U4G#((R7uI(yrO4AR$wS<^f-vLp?d3W-}R^iDu%Y|7IR@E<^9K75| z;pvg7QH_^oTy?!zyr}-7yeL%1CWsEUsLA`6tASLXn*4IPKJ%*jkCUZW_$c^R{;j?G zdwbBnvW;{19&Y;!(bd2L(Zzmna{G!%+g0^5A$-hEyLedi9lF*f=Prf~u7v59junVH7u?(V!&1LfaRVx&NuDJPUoX9$q(AUrXMQYA& zs7ZnlMeI{HFJB#(t*|`%V#?)LT)s0jGuCCR#2Y|VP0jCI`+Co?NwbszjOy%O1v$y4?kj9)}cZ)n|beCiHx? zobE5qC^gw}*$IX9UCGIlJr^B{_5KlH!fn?DQSmbYViae= zxsQU$eSxLMWs@5!ls@XSFgRO7byPrfuZ8oe`-N>ErIGfJ-K~Fq;1d7JP4n)7)a|G0|`waRs>;zlA^fotCNpb za`pbU+PkW;9csc=pd=6^8%;hqO?a}w%AX2GzGh!Ij%?RSdhlaux$Y03ZeS4pGpK_o zzDsVq_It-> zEm`kp0sI+7sOzOos%2Og{PkrXG~Vu_QX7a gWx6)EkoBCTfF1>Rh)ND=u*#svx3>pMFm^Bl0ETkPu>b%7 diff --git a/.gradle/7.5/fileHashes/fileHashes.lock b/.gradle/7.5/fileHashes/fileHashes.lock index 38d56ea78e9de0f9f41d8d29635ac64281f089c3..81566d439ba4f4968823e2397b8ac6610c56cb39 100644 GIT binary patch literal 17 VcmZQBSfRUsf03Rh0~jzn0RSf912zBv literal 17 VcmZQBSfRUsf03Rh0~j!C0RSe+10DbX diff --git a/.gradle/7.5/fileHashes/resourceHashesCache.bin b/.gradle/7.5/fileHashes/resourceHashesCache.bin index 52008dfe9b4c169467071983cd8da43c6e416033..cbdff21de2ca7074eeefa3a39238efbc87a6da15 100644 GIT binary patch delta 161 zcmX>*i*e#?#tkMCni>t)HhA>2U0Tin242ViLqU@oXVX)Yd?SdsukU78i5pA;DNADK z*H`wlKt=N>i%Rciytq;EhxkSV50TA|9z3ir#z09)AQl8+0iREr*Oq_te|Y)g^g8}0 er`G}n2U0Tin242TE$4cB_n(QmRnQ`Gp#UJ7u4Jt%7J9_Z2 F0s!ay5+eWr diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index b6c7fbc404a0bdc692f2e6378ca4df2722ef1692..552cbf039a541a8b59f54d68af25fe75874b1c2f 100644 GIT binary patch literal 17 VcmZP$F`c)6-~Z@+3}C={6aYEq1&#m! literal 17 VcmZP$F`c)6-~Z@+3}C>y9RNAl1%Lnm 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