mirror of
https://github.com/LucasVbr/OutilCuisson.git
synced 2026-05-14 09:05:32 +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
|
||||
|
||||
Reference in New Issue
Block a user