mirror of
https://github.com/LucasVbr/OutilCuisson.git
synced 2026-05-19 10:53:18 +00:00
Tout est validé -> faut refactor et ajouter des string
Co-Authored-By: Alexandre3417 <81689383+Alexandre3417@users.noreply.github.com> Co-Authored-By: NonoL3Robot <75622909+NonoL3Robot@users.noreply.github.com>
This commit is contained in:
@@ -78,8 +78,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
*
|
||||
* @param cuisson Objet cuisson a ajouter dans la liste
|
||||
*/
|
||||
public void addCuisson(Cuisson cuisson) {
|
||||
if (estDansCuisson(cuisson)) throw new IllegalArgumentException("Il existe deja un plat avec ce nom");
|
||||
public void addCuisson(Cuisson cuisson) throws CuissonDejaExistanteException {
|
||||
if (estDansCuisson(cuisson)) throw new CuissonDejaExistanteException();
|
||||
|
||||
listeCuisson.add(cuisson);
|
||||
|
||||
@@ -174,6 +174,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
.setMessage(R.string.alert_content_reinit)
|
||||
.setNeutralButton(R.string.alert_neutral_button, null)
|
||||
.setPositiveButton(R.string.btn_valider, (dialogInterface, i) -> {
|
||||
listeCuisson.clear();
|
||||
AfficherFragment.adapterCuissons.clear();
|
||||
AfficherFragment.adapterCuissons.notifyDataSetChanged();})
|
||||
.show();
|
||||
|
||||
Reference in New Issue
Block a user