77import android .os .Bundle ;
88import android .view .View ;
99import android .widget .TextView ;
10+ import android .widget .Toast ;
1011
1112import com .example .mealer .models .MenuModel ;
1213import com .example .mealer .R ;
@@ -18,6 +19,7 @@ public class ClientVotreCommandeActivity extends AppCompatActivity {
1819 commandeModel c ;
1920 String b ;
2021 static int pos ;
22+ TextView status ;
2123 @ Override
2224 protected void onCreate (Bundle savedInstanceState ) {
2325 super .onCreate (savedInstanceState );
@@ -27,11 +29,11 @@ protected void onCreate(Bundle savedInstanceState) {
2729 b =String .valueOf (c .getStatutDeLaCommande ());
2830 //Toast.makeText(this, b, Toast.LENGTH_SHORT).show();
2931
30- TextView status = findViewById (R .id .StatutCommande );
32+ status = findViewById (R .id .StatutCommande );
3133 String a ="" ;
3234 int aa = c .getStatutDeLaCommande ();
3335 if (aa ==-1 ){
34- status .setText ("Désolé votre commande a été rejeté " );
36+ status .setText ("Désolé votre commande a été rejetée " );
3537 }
3638 else if (aa ==0 ){
3739 status .setText ("En attente d'une réponse du cuisinier" );
@@ -96,10 +98,18 @@ public static void setPos(int position){
9698
9799
98100 public void onGotoDialogu (View view ) {
101+ if (status .getText ().equals ("Désolé votre commande a été rejetée" )){
102+ Toast .makeText (this , "Vous ne pouvez pas evaluer car votre commande est rejétée" , Toast .LENGTH_SHORT ).show ();
103+ }
104+ else if (status .getText ().equals ("En attente d'une réponse du cuisinier" )){
105+ Toast .makeText (this , "Votre commande doit être acceptée pour pouvoir l'evaluer" , Toast .LENGTH_SHORT ).show ();
106+
107+ }
108+ else {
99109 RateDialogu rateDialogu =new RateDialogu (ClientVotreCommandeActivity .this , c );
100110 rateDialogu .getWindow ().setBackgroundDrawable (new ColorDrawable (getResources ().getColor (android .R .color .transparent )));
101111 rateDialogu .setCancelable (true );
102- rateDialogu .show ();
112+ rateDialogu .show ();}
103113
104114 //Intent intent =new Intent(getApplicationContext(),RateDialogu.class);
105115 //startActivityForResult(intent, 0);
0 commit comments