mirror of
https://github.com/LucasVbr/OutilCuisson.git
synced 2026-05-19 10:53:18 +00:00
Modif AlertDialog et ajout Toast
This commit is contained in:
@@ -15,6 +15,7 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TimePicker;
|
import android.widget.TimePicker;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
@@ -104,13 +105,14 @@ public class AjouterFragment extends Fragment {
|
|||||||
try {
|
try {
|
||||||
activiteQuiMEcoute.recevoirCuisson(
|
activiteQuiMEcoute.recevoirCuisson(
|
||||||
new Cuisson(txtPlat, hDuree, mDuree, temperature));
|
new Cuisson(txtPlat, hDuree, mDuree, temperature));
|
||||||
|
Toast.makeText(getContext(), R.string.toast_ajout_ok, Toast.LENGTH_SHORT).show();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
new AlertDialog.Builder(getContext()).setTitle("Erreur")
|
new AlertDialog.Builder(getContext()).setTitle("Erreur")
|
||||||
.setMessage(e.getMessage())
|
.setMessage(e.getMessage())
|
||||||
.setPositiveButton(
|
.setPositiveButton(
|
||||||
R.string.btn_valider,
|
R.string.alert_positive_button,
|
||||||
null)
|
null)
|
||||||
.show(); // TODO modif
|
.show();
|
||||||
System.out.println(e.getMessage());
|
System.out.println(e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
<string name="context_thermos">"Voir thermostat"</string>
|
<string name="context_thermos">"Voir thermostat"</string>
|
||||||
<string name="context_cancel">"Annuler"</string>
|
<string name="context_cancel">"Annuler"</string>
|
||||||
|
|
||||||
|
<!-- AlertDialog Erreur Ajout -->
|
||||||
|
<string name="alert_positive_button">"OK"</string>
|
||||||
|
|
||||||
|
<!-- Toast Ajout OK -->
|
||||||
|
<string name="toast_ajout_ok">"Cuisson ajoutée avec succès"</string>
|
||||||
|
|
||||||
<!-- Tabs -->
|
<!-- Tabs -->
|
||||||
<string name="tab_afficher">"Afficher"</string>
|
<string name="tab_afficher">"Afficher"</string>
|
||||||
<string name="tab_ajouter">"Ajouter"</string>
|
<string name="tab_ajouter">"Ajouter"</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user