diff --git a/app/src/main/java/com/example/maximeglod/fbta/DAO.java b/app/src/main/java/com/example/maximeglod/fbta/DAO.java index 40840ec..fe3fe37 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/DAO.java +++ b/app/src/main/java/com/example/maximeglod/fbta/DAO.java @@ -30,7 +30,7 @@ public long ajoutePersonne(Inscription inscription) { v.put("poids", inscription.getPoids()); v.put("activité", inscription.getSport()); v.put("objectif", inscription.getObjectif()); - return maBase.insert("personne", null, v); + return maBase.insert("personne", null, v); } } \ No newline at end of file diff --git a/app/src/main/java/com/example/maximeglod/fbta/Evolution.java b/app/src/main/java/com/example/maximeglod/fbta/Evolution.java index 697d2fb..b371065 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/Evolution.java +++ b/app/src/main/java/com/example/maximeglod/fbta/Evolution.java @@ -11,33 +11,23 @@ import android.widget.RelativeLayout; import com.github.mikephil.charting.charts.LineChart; -import com.github.mikephil.charting.components.AxisBase; import com.github.mikephil.charting.components.Legend; import com.github.mikephil.charting.components.XAxis; import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.data.Entry; import com.github.mikephil.charting.data.LineData; import com.github.mikephil.charting.data.LineDataSet; -import com.github.mikephil.charting.formatter.IAxisValueFormatter; import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; -import com.github.mikephil.charting.utils.ColorTemplate; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; + import java.time.LocalDate; import java.time.Period; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; import java.util.Iterator; -import java.util.List; import java.util.Map; -import static com.example.maximeglod.fbta.SaisiePoids.poidsMap; -import static com.example.maximeglod.fbta.SaisiePoids.recup_date; public class Evolution extends Activity { private RelativeLayout Evolution; @@ -50,7 +40,6 @@ public void onCreate(Bundle savedInstanceState) { // On retire la barre de notifications pour afficher l'application en plein écran this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); - //Définission le contenu de la vue APRES les instructions précédentes pour éviter un crash super.onCreate(savedInstanceState); @@ -73,9 +62,10 @@ public void onCreate(Bundle savedInstanceState) { mChart.setScaleEnabled(true); mChart.setDrawGridBackground(false); //On autorise le zoom sur les axes différents - mChart.setPinchZoom(true); + mChart.setPinchZoom(false); //Alternative color background mChart.setBackgroundColor(Color.BLACK); + mChart.animateXY(1200, 1200); //Maintenant on travail sur les données @@ -93,22 +83,26 @@ public void onCreate(Bundle savedInstanceState) { xl.setTextColor(Color.WHITE); xl.setDrawGridLines(false); xl.setAvoidFirstLastClipping(true); + xl.setGranularity(1f); + xl.setAxisMinimum(-10f); + xl.setAxisMaximum(10f); + xl.setDrawAxisLine(true); YAxis yl = mChart.getAxisLeft(); yl.setTextColor(Color.WHITE); - yl.setAxisMaxValue(120f); + // yl.setAxisMaxValue(120f); yl.setDrawGridLines(false); - + mChart.setAutoScaleMinMaxEnabled(false); YAxis yl2 = mChart.getAxisRight(); yl2.setEnabled(false); - final List list_x_axis_name = new ArrayList<>(); + mChart.getAxisLeft().setStartAtZero(false); mChart.getAxisRight().setStartAtZero(false); ArrayList yValues = new ArrayList<>(); - Integer result = poidsMap.get("18/02/2019"); + //Implémentation fonction différence date ////////// @@ -117,7 +111,7 @@ public void onCreate(Bundle savedInstanceState) { mChart.getAxisRight().setStartAtZero(false); //Boucle While + iterator Iterator iterator = poidsMap.entrySet().iterator(); - Integer a = 0; + while (iterator.hasNext()) { mChart.getAxisLeft().setStartAtZero(false); mChart.getAxisRight().setStartAtZero(false); @@ -147,19 +141,40 @@ public void onCreate(Bundle savedInstanceState) { Period period = Period.between(date1, date2); - Integer b = a + 1; - Integer getdays = period.getDays(); + Integer comparaison = date1.compareTo(date2); + if (comparaison <= -1) { + Integer getdays = (period.getDays()) * -1; + + yValues.add(new Entry(getdays, i2)); + + + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } else { + + + Integer getdays = (period.getDays()) * -1; + yValues.add(new Entry(getdays, i2)); + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } - yValues.add(new Entry(getdays, i2)); - //yValues.add(new Entry(1,63)); - LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids"); - ArrayList dataSets = new ArrayList<>(); - dataSets.add(set1); - LineData data2 = new LineData(dataSets); - //LineData data3 = new LineDataSet(null,"Evolution du poids"); - mChart.getAxisLeft().setStartAtZero(false); - mChart.getAxisRight().setStartAtZero(false); - mChart.setData(data2); } else { mChart.getAxisLeft().setStartAtZero(false); @@ -173,19 +188,36 @@ public void onCreate(Bundle savedInstanceState) { Period period = Period.between(date1, date2); - Integer b = a + 1; - Integer getdays = period.getDays(); + Integer comparaison = date1.compareTo(date2); + if (comparaison <= -1) { + Integer getdays = (period.getDays()) * -1; + + yValues.add(new Entry(getdays, i2)); + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } else { + + + Integer getdays = (period.getDays()) * -1; + yValues.add(new Entry(getdays, i2)); + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } - yValues.add(new Entry(getdays, i2)); - //yValues.add(new Entry(1,63)); - LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids"); - ArrayList dataSets = new ArrayList<>(); - dataSets.add(set1); - LineData data2 = new LineData(dataSets); - //LineData data3 = new LineDataSet(null,"Evolution du poids"); - mChart.getAxisLeft().setStartAtZero(false); - mChart.getAxisRight().setStartAtZero(false); - mChart.setData(data2); } @@ -204,21 +236,35 @@ public void onCreate(Bundle savedInstanceState) { LocalDate date2 = LocalDate.parse(heures, format); Period period = Period.between(date1, date2); - - - Integer b = a + 1; - Integer getdays = period.getDays(); - - yValues.add(new Entry(getdays, i2)); - //yValues.add(new Entry(1,63)); - LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids"); - ArrayList dataSets = new ArrayList<>(); - dataSets.add(set1); - LineData data2 = new LineData(dataSets); - //LineData data3 = new LineDataSet(null,"Evolution du poids"); - mChart.getAxisLeft().setStartAtZero(false); - mChart.getAxisRight().setStartAtZero(false); - mChart.setData(data2); + Integer comparaison = date1.compareTo(date2); + if (comparaison <= -1) { + Integer getdays = (period.getDays()) * -1; + + yValues.add(new Entry(getdays, i2)); + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } else { + + + Integer getdays = (period.getDays()) * -1; + yValues.add(new Entry(getdays, i2)); + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } } else { mChart.getAxisLeft().setStartAtZero(false); @@ -232,24 +278,38 @@ public void onCreate(Bundle savedInstanceState) { Period period = Period.between(date1, date2); - Integer b = a + 1; - Integer getdays = period.getDays(); - - yValues.add(new Entry(getdays, i2)); - //yValues.add(new Entry(1,63)); - LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids"); - ArrayList dataSets = new ArrayList<>(); - dataSets.add(set1); - LineData data2 = new LineData(dataSets); - //LineData data3 = new LineDataSet(null,"Evolution du poids"); - mChart.getAxisLeft().setStartAtZero(false); - mChart.getAxisRight().setStartAtZero(false); - mChart.setData(data2); + Integer comparaison = date1.compareTo(date2); + if (comparaison <= -1) { + Integer getdays = (period.getDays()) * -1; + + yValues.add(new Entry(getdays, i2)); + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } else { + + Integer getdays = (period.getDays()) * -1; + yValues.add(new Entry(getdays, i2)); + //yValues.add(new Entry(1,63)); + LineDataSet set1 = new LineDataSet(yValues, "Evolution de votre poids en kg en fonction des jours"); + ArrayList dataSets = new ArrayList<>(); + dataSets.add(set1); + LineData data2 = new LineData(dataSets); + //LineData data3 = new LineDataSet(null,"Evolution du poids"); + mChart.getAxisLeft().setStartAtZero(false); + mChart.getAxisRight().setStartAtZero(false); + mChart.setData(data2); + } } } - //final String heures = (cal.get(Calendar.DAY_OF_MONTH) + "/" + ds + "/" + cal.get(Calendar.YEAR)); } @@ -259,26 +319,6 @@ public void onCreate(Bundle savedInstanceState) { } - //Ajout des données au graph - - //Méthode to create set - private LineDataSet createSet() { - LineDataSet set = new LineDataSet(null, "Evolution du poids"); - set.setCubicIntensity(0.2f); - set.setAxisDependency(YAxis.AxisDependency.LEFT); - set.setColor(ColorTemplate.getHoloBlue()); - set.setCircleColor(ColorTemplate.getHoloBlue()); - set.setLineWidth(2f); - set.setCircleSize(4f); - set.setFillAlpha(65); - set.setFillColor(ColorTemplate.getHoloBlue()); - set.setValueTextSize(10f); - - - return set; - - } - public static Map poidsMap = SaisiePoids.poidsMap; } \ No newline at end of file diff --git a/app/src/main/java/com/example/maximeglod/fbta/Inscription.java b/app/src/main/java/com/example/maximeglod/fbta/Inscription.java index 346fb8e..b349d2e 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/Inscription.java +++ b/app/src/main/java/com/example/maximeglod/fbta/Inscription.java @@ -75,7 +75,7 @@ protected void onCreate(Bundle savedInstanceState) { liste.add("Détente"); liste.add("Modéré"); liste.add("Intense"); - ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item,liste); + ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, liste); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); this.sport = spinner.getSelectedItem().toString(); @@ -92,39 +92,30 @@ public void onClick(View v) { Intent i = new Intent(getApplicationContext(), validInscription.class); if (et_prenom.getText().toString().length() < 1) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre prénom", Toast.LENGTH_LONG).show(); - } - else { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre prénom", Toast.LENGTH_LONG).show(); + } else { if (et_nom.getText().toString().length() < 1) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre nom", Toast.LENGTH_LONG).show(); - } - else { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre nom", Toast.LENGTH_LONG).show(); + } else { if (et_age.getText().toString().length() < 1) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre date de naissance", Toast.LENGTH_LONG).show(); - } - else if (et_age.getText().toString().length() < 10) { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre date de naissance", Toast.LENGTH_LONG).show(); + } else if (et_age.getText().toString().length() < 10) { Toast.makeText(getApplicationContext(), "Veuillez renseigner correctement votre date de naissance", Toast.LENGTH_LONG).show(); - } - else { + } else { if (et_sexe.getText().toString().length() < 1) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre sexe", Toast.LENGTH_LONG).show(); - } - else if (et_sexe.getText().toString().equals("M") || et_sexe.getText().toString().equals("F")) { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre sexe", Toast.LENGTH_LONG).show(); + } else if (et_sexe.getText().toString().equals("M") || et_sexe.getText().toString().equals("F")) { if (et_taille.getText().toString().length() < 1) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre taille", Toast.LENGTH_LONG).show(); - } - else if (et_taille.getText().toString().length() == 3) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre taille en m", Toast.LENGTH_LONG).show(); - } - else { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre taille", Toast.LENGTH_LONG).show(); + } else if (et_taille.getText().toString().length() == 3) { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre taille en m", Toast.LENGTH_LONG).show(); + } else { if (et_poids.getText().toString().length() < 1) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre poids", Toast.LENGTH_LONG).show(); - } - else { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre poids", Toast.LENGTH_LONG).show(); + } else { if (et_objectif.getText().toString().length() < 1) { - Toast.makeText(getApplicationContext(),"Veuillez renseigner votre objectif de poids", Toast.LENGTH_LONG).show(); - } - else { + Toast.makeText(getApplicationContext(), "Veuillez renseigner votre objectif de poids", Toast.LENGTH_LONG).show(); + } else { i.putExtra("Prénom", et_prenom.getText().toString()); i.putExtra("Nom", et_nom.getText().toString()); i.putExtra("Naissance", et_age.getText().toString()); @@ -137,9 +128,8 @@ else if (et_taille.getText().toString().length() == 3) { } } } - } - else { - Toast.makeText(getApplicationContext(),"Veuillez renseigner correctement votre sexe", Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(getApplicationContext(), "Veuillez renseigner correctement votre sexe", Toast.LENGTH_LONG).show(); } } } @@ -152,7 +142,6 @@ else if (et_taille.getText().toString().length() == 3) { } - public String getPoids() { return this.poids; } @@ -181,5 +170,7 @@ public String getSport() { return this.sport; } - public String getObjectif() {return this.objectif;} + public String getObjectif() { + return this.objectif; + } } \ No newline at end of file diff --git a/app/src/main/java/com/example/maximeglod/fbta/MainActivity.java b/app/src/main/java/com/example/maximeglod/fbta/MainActivity.java index b6a9d34..5d076df 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/MainActivity.java +++ b/app/src/main/java/com/example/maximeglod/fbta/MainActivity.java @@ -212,61 +212,6 @@ public void onClick(View view) { } -// } private Handler myHandler; -// private final Runnable myRunnable = new Runnable() { -// @Override -// public void run() { -// // Code à éxécuter de façon périodique -// -// //initialisation de la somme -// //Parcours du Hashmap pour sommer toutes les valeurs caloriques et ainsi récupérer le totalcalorique -// //dans la variable sum -// //récupération du champ de date -// TextView dateView2 = (TextView) findViewById(R.id.currentdate); -// final String heures3 = dateView2.getText().toString(); -// int sum = 0; -// for (int f : (caltolMap.get(heures3)).values()) { -// sum += f; -// } -// -// //On récupère le champ totalcalories de la vue -// TextView totalcalories = (TextView) findViewById(R.id.totalcalories); -// String sumtotal = Integer.toString(sum); -// //On met à jour le text de totalcalories avec la valeur calculée -// totalcalories.setText(sumtotal); -// -// //Changement de la couleur d'un élément si l'objectif n'est pas respecté -// TextView objectifcalories = (TextView) findViewById(R.id.objectif); -// int objectif = Integer.parseInt(objectifcalories.getText().toString()); -// -// if (sum <= objectif) { -// Button b1 = (Button) findViewById(R.id.verif); -// b1.setBackgroundResource(R.drawable.rounded_button_ok); -// b1.setText("V"); -// b1.setTextColor(Color.BLACK); -// } else { -// -// //On tolère une marge de 5% par rapport à l'objectif (Changement de couleur) -// if (sum <= objectif + (objectif * 0.05)) { -// Button b2 = (Button) findViewById(R.id.verif); -// b2.setBackgroundResource(R.drawable.rounded_button_mid); -// b2.setText("~"); -// b2.setTextColor(Color.WHITE); -// } else { -// Button b1 = (Button) findViewById(R.id.verif); -// b1.setBackgroundResource(R.drawable.rounded_button_false); -// b1.setText("X"); -// b1.setTextColor(Color.WHITE); -// } -// -// } -// -// -// myHandler.postDelayed(this, 5); -// -// } -// }; - public static Map> caltolMap = new HashMap<>(); } \ No newline at end of file diff --git a/app/src/main/java/com/example/maximeglod/fbta/MyXAxisValueFormatter.java b/app/src/main/java/com/example/maximeglod/fbta/MyXAxisValueFormatter.java deleted file mode 100644 index 8a3c501..0000000 --- a/app/src/main/java/com/example/maximeglod/fbta/MyXAxisValueFormatter.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.maximeglod.fbta; - -import com.github.mikephil.charting.components.AxisBase; -import com.github.mikephil.charting.formatter.IAxisValueFormatter; - -public class MyXAxisValueFormatter implements IAxisValueFormatter { - - private String[] mValues; - - public MyXAxisValueFormatter(String[] values) { - this.mValues = values; - } - - @Override - public String getFormattedValue(float value, AxisBase axis) { - // "value" represents the position of the label on the axis (x or y) - return mValues[(int) value]; - } - - -} \ No newline at end of file diff --git a/app/src/main/java/com/example/maximeglod/fbta/Personne.java b/app/src/main/java/com/example/maximeglod/fbta/Personne.java index 8ca5fc5..a372bec 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/Personne.java +++ b/app/src/main/java/com/example/maximeglod/fbta/Personne.java @@ -55,11 +55,10 @@ public String getSport() { } public int getObjectifs() { - return objectif ; + return objectif; } - Inscription i = new Inscription(); diff --git a/app/src/main/java/com/example/maximeglod/fbta/SaisiePoids.java b/app/src/main/java/com/example/maximeglod/fbta/SaisiePoids.java index 7fcdedd..6f89ce1 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/SaisiePoids.java +++ b/app/src/main/java/com/example/maximeglod/fbta/SaisiePoids.java @@ -51,7 +51,7 @@ public void onClick(View v) { Intent myIntent = new Intent(getBaseContext(), MainActivity.class); Toast.makeText(getApplicationContext(), "La saisie de votre poids a bien été sauvegardée", Toast.LENGTH_LONG).show(); Integer poidscurrent = Integer.parseInt(poids.getText().toString()); - //On va plutôt stocker dans le hashmap la différence entre la date sélectionné et la date actuelle car on ne peut pas mettre de string pour l'axe des x dans evolution + //Stockage du poids dans un hashmap poidsMap.put(recup_date, poidscurrent); poidsMap.get(recup_date); startActivityForResult(myIntent, 0); diff --git a/app/src/main/java/com/example/maximeglod/fbta/SplashScreen.java b/app/src/main/java/com/example/maximeglod/fbta/SplashScreen.java index 2df5b12..6b982be 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/SplashScreen.java +++ b/app/src/main/java/com/example/maximeglod/fbta/SplashScreen.java @@ -38,8 +38,6 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_splash); - - //Code qui commence avec le timer et lance les actions ensuite new Handler().postDelayed(new Runnable() { @Override diff --git a/app/src/main/java/com/example/maximeglod/fbta/validInscription.java b/app/src/main/java/com/example/maximeglod/fbta/validInscription.java index 6827a67..97cc6b5 100644 --- a/app/src/main/java/com/example/maximeglod/fbta/validInscription.java +++ b/app/src/main/java/com/example/maximeglod/fbta/validInscription.java @@ -75,7 +75,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onClick(View v) { Intent e = new Intent(getApplicationContext(), MainActivity.class); - Toast.makeText(getApplicationContext(), lePrenom + " " + leNom + " enregistré",Toast.LENGTH_LONG).show(); + Toast.makeText(getApplicationContext(), lePrenom + " " + leNom + " enregistré", Toast.LENGTH_LONG).show(); startActivity(e); } @@ -85,6 +85,7 @@ public void onClick(View v) { AddData(); } + // AJOUT DES DONNEES DANS LA BASE DE DONNEES SUR LE CLIC DU BOUTON DE VALIDINSCRIPTION public void AddData() { btn_inscrire.setOnClickListener(new View.OnClickListener() { @@ -94,15 +95,15 @@ public void onClick(View view) { BDHelper bdHelper = new BDHelper(getBaseContext(), "fbta", null, 1); //LISTE DES PARAMETRES A AJOUTER A LA BDD - HashMap params = new HashMap<>(); - params.put(BDD.TABLE_NAME_COL_2,lePrenom); - params.put(BDD.TABLE_NAME_COL_3,leNom); - params.put(BDD.TABLE_NAME_COL_4,laNaissance); - params.put(BDD.TABLE_NAME_COL_5,leSexe); - params.put(BDD.TABLE_NAME_COL_6,laTaille); - params.put(BDD.TABLE_NAME_COL_7,lePoids); - params.put(BDD.TABLE_NAME_COL_8,lActivite); - params.put(BDD.TABLE_NAME_COL_9,lObjectif); + HashMap params = new HashMap<>(); + params.put(BDD.TABLE_NAME_COL_2, lePrenom); + params.put(BDD.TABLE_NAME_COL_3, leNom); + params.put(BDD.TABLE_NAME_COL_4, laNaissance); + params.put(BDD.TABLE_NAME_COL_5, leSexe); + params.put(BDD.TABLE_NAME_COL_6, laTaille); + params.put(BDD.TABLE_NAME_COL_7, lePoids); + params.put(BDD.TABLE_NAME_COL_8, lActivite); + params.put(BDD.TABLE_NAME_COL_9, lObjectif); //OUVERTURE DE LA BDD bdHelper.open(); @@ -110,8 +111,8 @@ public void onClick(View view) { //AFFICHAGE RAPIDE //LES DONNEES NE SONT PAS MISE DANS LA BDD - if (!retour){ - Toast.makeText(validInscription.this,"SA MARCHE PAS", Toast.LENGTH_LONG).show(); + if (!retour) { + Toast.makeText(validInscription.this, "SA MARCHE PAS", Toast.LENGTH_LONG).show(); } bdHelper.close(); } diff --git a/app/src/main/res/layout/activity_saisie_poids.xml b/app/src/main/res/layout/activity_saisie_poids.xml index 32cc05d..eb99739 100644 --- a/app/src/main/res/layout/activity_saisie_poids.xml +++ b/app/src/main/res/layout/activity_saisie_poids.xml @@ -4,8 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".SaisiePoids" - android:background="@color/colorDark"> + android:background="@color/colorDark" + tools:context=".SaisiePoids"> -