mirror of
https://github.com/LucasVbr/OutilCuisson.git
synced 2026-05-13 17:11:53 +00:00
voir thermostat ok
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
package com.example.outilcuisson;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -156,13 +157,27 @@ public class AfficherFragment extends Fragment {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.supprContext:
|
||||
// TODO
|
||||
// cuissonAffichees.remove(information.position);
|
||||
break;
|
||||
case R.id.thermosContext:
|
||||
// TODO
|
||||
afficherThermos(cuissonAffichees.get(information.position));
|
||||
break;
|
||||
case R.id.cancelContext:
|
||||
break;
|
||||
}
|
||||
return super.onContextItemSelected(item);
|
||||
}
|
||||
|
||||
public void afficherThermos(String cuisson) {
|
||||
String content = getString(R.string.alert_content_thermos,
|
||||
Cuisson.extrairePlat(cuisson),
|
||||
Cuisson.extraireTemperature(cuisson),
|
||||
Cuisson.thermostat(Cuisson.extraireTemperature(cuisson)));
|
||||
new AlertDialog.Builder(getContext()).setTitle(R.string.alert_title_thermos)
|
||||
.setMessage(content)
|
||||
.setNeutralButton(
|
||||
R.string.alert_neutral_button,
|
||||
null)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,10 +107,10 @@ public class AjouterFragment extends Fragment {
|
||||
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(R.string.alert_error)
|
||||
.setMessage(e.getMessage())
|
||||
.setPositiveButton(
|
||||
R.string.alert_positive_button,
|
||||
new AlertDialog.Builder(getContext()).setTitle(R.string.alert_title_error)
|
||||
.setMessage(R.string.alert_content_error)
|
||||
.setNeutralButton(
|
||||
R.string.alert_neutral_button,
|
||||
null)
|
||||
.show();
|
||||
System.out.println(e.getMessage());
|
||||
|
||||
@@ -181,7 +181,7 @@ public class Cuisson implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le thermostat correspondant à la temperature arguemnt
|
||||
* Renvoie le thermostat correspondant à la temperature argument
|
||||
* (celle-ci doit être inférieure à TEMPERATURE_MAX)
|
||||
*
|
||||
* @param temperature température à convertir
|
||||
|
||||
@@ -13,11 +13,24 @@
|
||||
<string name="context_thermos">"Voir thermostat"</string>
|
||||
<string name="context_cancel">"Annuler"</string>
|
||||
|
||||
<!-- AlertDialog Erreur Ajout -->
|
||||
<string name="alert_positive_button">"OK"</string>
|
||||
<string name="alert_error">"Erreur"</string>
|
||||
<!-- AlertDialog -->
|
||||
<string name="alert_title_error">"Erreur de saisie"</string>
|
||||
<string name="alert_content_error">L\'une des informations saisies est
|
||||
incorrecte :
|
||||
\n- nom du plat vide ou contient \"|\"
|
||||
\n- durée de cuisson nulle ou trop élevée (> 9h)
|
||||
\n- température nulle ou trop élevée \n(> 300°C)
|
||||
\n\n
|
||||
Vérifiez les valeurs saisies !</string>
|
||||
<string name="alert_neutral_button">"Retour"</string>
|
||||
|
||||
<!-- Toast Ajout OK -->
|
||||
<string name="alert_title_thermos">"Equivalent thermostat"</string>
|
||||
<string name="alert_content_thermos">Cuisson du plat : %s
|
||||
\n\nPour obtenir la température de %d°, vous devez régler votre
|
||||
four sur le thermostat %d</string>
|
||||
|
||||
|
||||
<!-- Toast -->
|
||||
<string name="toast_ajout_ok">"Cuisson ajoutée avec succès"</string>
|
||||
|
||||
<!-- Tabs -->
|
||||
|
||||
Reference in New Issue
Block a user