mirror of
https://github.com/LucasVbr/OutilCuisson.git
synced 2026-05-13 17:11:53 +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.EditText;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -104,13 +105,14 @@ public class AjouterFragment extends Fragment {
|
||||
try {
|
||||
activiteQuiMEcoute.recevoirCuisson(
|
||||
new Cuisson(txtPlat, hDuree, mDuree, temperature));
|
||||
Toast.makeText(getContext(), R.string.toast_ajout_ok, Toast.LENGTH_SHORT).show();
|
||||
} catch (Exception e) {
|
||||
new AlertDialog.Builder(getContext()).setTitle("Erreur")
|
||||
.setMessage(e.getMessage())
|
||||
.setPositiveButton(
|
||||
R.string.btn_valider,
|
||||
R.string.alert_positive_button,
|
||||
null)
|
||||
.show(); // TODO modif
|
||||
.show();
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
<string name="context_thermos">"Voir thermostat"</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 -->
|
||||
<string name="tab_afficher">"Afficher"</string>
|
||||
<string name="tab_ajouter">"Ajouter"</string>
|
||||
|
||||
Reference in New Issue
Block a user