Groom  1.1
BTS SNIR LaSalle Avignon 2021
IHMGroom.java
Aller à la documentation de ce fichier.
1 package com.example.groom;
2 
3 import android.annotation.SuppressLint;
4 import android.app.NotificationChannel;
5 import android.app.NotificationManager;
6 import android.app.PendingIntent;
7 import android.bluetooth.BluetoothDevice;
8 import android.content.Context;
9 import android.content.DialogInterface;
10 import android.content.Intent;
11 import android.content.SharedPreferences;
12 import android.os.Build;
13 import android.os.Bundle;
14 
15 import androidx.appcompat.app.AlertDialog;
16 import androidx.appcompat.app.AppCompatActivity;
17 import androidx.appcompat.widget.Toolbar;
18 import androidx.core.app.NotificationCompat;
19 import androidx.core.content.ContextCompat;
20 import androidx.webkit.WebSettingsCompat;
21 import androidx.webkit.WebViewFeature;
22 
23 import android.os.CountDownTimer;
24 import android.os.Handler;
25 import android.os.Message;
26 import android.util.Base64;
27 import android.util.Log;
28 import android.view.Gravity;
29 import android.view.LayoutInflater;
30 import android.view.View;
31 
32 import android.view.Menu;
33 import android.view.MenuItem;
34 import android.webkit.WebSettings;
35 import android.webkit.WebView;
36 import android.widget.AdapterView;
37 import android.widget.ArrayAdapter;
38 import android.widget.Button;
39 import android.widget.EditText;
40 import android.widget.ImageView;
41 import android.widget.RadioButton;
42 import android.widget.Spinner;
43 import android.widget.TextView;
44 import android.widget.Toast;
45 
46 import java.util.ArrayList;
47 
60 public class IHMGroom extends AppCompatActivity
61 {
62  // Constantes
63  private static final String TAG = "_IHMGroom";
64  private static final int ETAT_LIBRE = 0;
65  private static final int ETAT_ABSENT = 1;
66  private static final int ETAT_OCCUPE = 2;
67  private static final int ETAT_ENTRER = 3;
68  private static final int SONNETTE_ON = 1;
69  private static final int SONNETTE_OFF = 0;
70  private static final int DETECTEUR_ON = 1;
71  private static final int DETECTEUR_OFF = 0;
72  private static final String messageSonnette = "On sonne à l'entrée !";
73 
74  // Attibuts
75  private Occupant occupant;
76  private String nomOccupant;
77  private String prenomOccupant;
78  private String fonctionOccupant;
79  private String nouvelUrl;
80 
81  private int etatOccupant;
82  private int etatModeSonnette;
83  private int etatModeDetecteur;
84 
86  private int choixGroom = -1;
87 
88  private NotificationManager notificationManager = null;
89  private int numeroNotification = 1;
90 
91  // connexionIdentification
92  private TextView titreConnexion;
93  private TextView texteNomOccupant;
94  private Spinner listeAppareilsBluetooth;
95  private Button boutonConnexion;
96  private RadioButton etatConnexion;
97  private Button boutonAjoutOccupant;
98  private Button boutonEnvoieOccupant;
99  private EditText texteNomFonction;
100 
101  // zoneMessageOccupant
102  private TextView titreMessageOccupant;
103  private EditText texteMessageOccupant;
104  private Button envoyerMessageOccupant;
105 
106  // zoneEtat
107  private TextView titreEtat;
108  private RadioButton boutonRadioLibre;
109  private RadioButton boutonRadioOccupe;
110  private RadioButton boutonRadioAbsent;
111 
112  // zoneEntrerSonnette
113  private Button boutonEntrer;
114  private Button boutonSonnette;
115  private ImageView imageClochette;
116  private ImageView imagePresence;
117 
118  //zonePresence
119  private Button boutonPresence;
120  private RadioButton boutonRadioActivationPresence;
121  private RadioButton boutonRadioEtatPresence;
122 
123  private Button boutonAjoutUrl;
124  private AlertDialog.Builder modificationUrl;
125  private View layout;
126  private Toast toast;
127  private AlertDialog.Builder modificationOccupant;
128 
129  // Stockage local des informations sur l'occupant
130  SharedPreferences sharedPreferences;
131  public static final String PREFERENCES = "groom";
132  public static final String PREFERENCES_NOM_OCCUPANT = "NomOccupant";
133  public static final String PREFERENCES_PRENOM_OCCUPANT = "PrenomOccupant";
134  public static final String PREFERENCES_FONCTION = "FonctionOccupant";
135 
139  @Override
140  protected void onCreate(Bundle savedInstanceState)
141  {
142  super.onCreate(savedInstanceState);
143  setContentView(R.layout.activity_main);
144  Log.d(TAG, "onCreate()");
145  //Log.d(TAG, "version API = " + Build.VERSION.SDK_INT);
146 
147  setTitle(getString(R.string.app_name) + " v" + BuildConfig.VERSION_NAME);
148 
149  // Pour le stockage local des informations sur l'occupant
150  sharedPreferences = getBaseContext().getSharedPreferences(PREFERENCES, MODE_PRIVATE);
151 
153 
155 
157 
158  //etatOccupant = ETAT_ABSENT;
161 
162  Toolbar toolbar = findViewById(R.id.toolbar);
163  setSupportActionBar(toolbar);
164 
165  nouvelUrl = "<iframe src=\"https://calendar.google.com/calendar/embed?src=robertutilisateur84%40gmail.com&ctz=Europe%2FParis\" style=\"border: 0\" width=\"760\" height=\"500\" frameborder=\"0\" scrolling=\"no\"></iframe>";
167  }
168 
172  @Override
173  protected void onStart()
174  {
175  super.onStart();
176  Log.d(TAG, "onStart()");
177  }
178 
182  @Override
183  protected void onResume()
184  {
185  super.onResume();
186  Log.d(TAG, "onResume()");
187  }
188 
193  @Override
194  protected void onPause()
195  {
196  super.onPause();
197  Log.d(TAG, "onPause()");
198  }
199 
203  @Override
204  protected void onStop()
205  {
206  super.onStop();
207  Log.d(TAG, "onStop()");
208  }
209 
214  @Override
215  protected void onDestroy()
216  {
217  super.onDestroy();
218  Log.d(TAG, "onDestroy()");
219  if(communicationGroom != null)
221  }
222 
227  {
228  // On récupère l'élément si il existe
229  if (sharedPreferences.contains(PREFERENCES_NOM_OCCUPANT))
230  {
231  nomOccupant = sharedPreferences.getString(PREFERENCES_NOM_OCCUPANT, "COPIN"); // null ou une valeur par défaut
232  }
233 
234  if (sharedPreferences.contains(PREFERENCES_PRENOM_OCCUPANT))
235  {
236  prenomOccupant = sharedPreferences.getString(PREFERENCES_PRENOM_OCCUPANT, "Olivier"); // null ou une valeur par défaut
237  }
238 
239  if (sharedPreferences.contains(PREFERENCES_FONCTION))
240  {
241  fonctionOccupant = sharedPreferences.getString(PREFERENCES_FONCTION, "DDFPT"); // null ou une valeur par défaut
242  }
243 
244  // Crée l'objet occupant avec les informations récupérées localement
246  }
247 
251  private void initialiserWidgets()
252  {
253  titreConnexion = (TextView) findViewById(R.id.titreConnexion);
254  texteNomOccupant = (TextView) findViewById(R.id.texteNomOccupant);
255  listeAppareilsBluetooth = (Spinner) findViewById(R.id.listeAppareilsBluetooth);
256 
257  boutonConnexion = (Button) findViewById(R.id.boutonConnexion);
258  boutonConnexion.setOnClickListener(new View.OnClickListener()
259  {
260  @Override
261  public void onClick(View v)
262  {
263  Log.d(TAG, "onClick() boutonConnexion : " + boutonConnexion.getText().toString());
264  if(boutonConnexion.getText().toString().equals("Connecter"))
265  {
266  if(communicationGroom != null)
267  {
269  }
270  }
271  else
272  {
273  if(communicationGroom != null)
274  {
276  }
277  }
278  }
279  });
280  etatConnexion = (RadioButton) findViewById(R.id.etatConnexion);
281 
282  boutonAjoutOccupant = (Button) findViewById(R.id.boutonAjoutOccupant);
283  boutonAjoutOccupant.setOnClickListener(new View.OnClickListener()
284  {
285  @Override
286  public void onClick(View v)
287  {
288  Log.d(TAG, "onClick() boutonAjoutOccupant");
290  }
291  });
292  boutonEnvoieOccupant = (Button) findViewById(R.id.boutonEnvoieOccupant);
293  boutonEnvoieOccupant.setOnClickListener(new View.OnClickListener()
294  {
295  @Override
296  public void onClick(View v)
297  {
298  if(communicationGroom != null)
299  communicationGroom.envoyer("$AFFICHAGE;" + occupant.getNom() + ";" + occupant.getPrenom() + ";" + occupant.getFonction() + "\r\n");
300  Log.d(TAG, "onClick() boutonEnvoieOccupant");
301  }
302  });
303  texteNomFonction = (EditText) findViewById(R.id.texteNomFonction);
304  if(!occupant.getNom().isEmpty())
305  texteNomFonction.setText(occupant.getNom() + " " + occupant.getPrenom() + " - " + occupant.getFonction());
306  texteNomFonction.setEnabled(false);
307 
308  // zoneMessageOccupant
309  titreMessageOccupant = (TextView) findViewById(R.id.titreMessageOccupant);
310  texteMessageOccupant = (EditText) findViewById(R.id.texteMessageOccupant);
311  envoyerMessageOccupant = (Button) findViewById(R.id.envoyerMessageOccupant);
312  envoyerMessageOccupant.setOnClickListener(new View.OnClickListener()
313  {
314  @Override
315  public void onClick(View v)
316  {
317  if(communicationGroom != null)
318  communicationGroom.envoyer("$MSGPERSO;" + texteMessageOccupant.getText() + "\r\n");
319  Log.d(TAG, "onClick() envoyerMessageOccupant");
320  }
321  });
322 
323  // zoneEtat
324  titreEtat = (TextView) findViewById(R.id.titreEtat);
325  boutonRadioLibre = (RadioButton) findViewById(R.id.boutonRadioLibre);
326  boutonRadioLibre.setOnClickListener(new View.OnClickListener()
327  {
328  @Override
329  public void onClick(View v)
330  {
331  Log.d(TAG, "onClick() boutonRadioLibre");
333  if(communicationGroom != null)
334  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
335  boutonSonnette.setEnabled(true);
336  boutonPresence.setEnabled(true);
337  }
338  });
339  boutonRadioOccupe = (RadioButton) findViewById(R.id.boutonRadioOccupe);
340  boutonRadioOccupe.setOnClickListener(new View.OnClickListener()
341  {
342  @Override
343  public void onClick(View v)
344  {
345  Log.d(TAG, "onClick() boutonRadioOccupe");
348  boutonSonnette.setEnabled(false);
349  boutonPresence.setEnabled(true);
350  boutonSonnette.setText("Activer Sonnette");
351  if(communicationGroom != null)
352  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
353  }
354  });
355  boutonRadioAbsent = (RadioButton) findViewById(R.id.boutonRadioAbsent);
356  boutonRadioAbsent.setOnClickListener(new View.OnClickListener()
357  {
358  @Override
359  public void onClick(View v)
360  {
361  Log.d(TAG, "onClick() boutonRadioAbsent");
365  boutonPresence.setText("Activer");
367  boutonPresence.setEnabled(false);
368  boutonSonnette.setEnabled(false);
369  boutonSonnette.setText("Activer Sonnette");
370  if(communicationGroom != null)
371  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
372  }
373  });
374 
375  // zoneEntrerSonnette
376  boutonEntrer = (Button) findViewById(R.id.boutonEntrer);
377  boutonEntrer.setOnClickListener(new View.OnClickListener()
378  {
379  @Override
380  public void onClick(View v)
381  {
382  Log.d(TAG, "onClick() boutonEntrer");
385  if(communicationGroom != null)
386  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
387  boutonSonnette.setEnabled(false);
388  boutonSonnette.setText("Activer Sonnette");
389  }
390  });
391  boutonSonnette = (Button) findViewById(R.id.boutonSonnette);
392  boutonSonnette.setOnClickListener(new View.OnClickListener()
393  {
394  @Override
395  public void onClick(View v)
396  {
397  if(boutonSonnette.getText().toString().equals("Activer Sonnette"))
398  {
399  Log.d(TAG, "onClick() boutonSonnette");
402  boutonSonnette.setText("Désactiver Sonnette");
403  if(communicationGroom != null)
404  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
405  }
406  else
407  {
408  Log.d(TAG, "onClick() boutonSonnette");
411  boutonSonnette.setText("Activer Sonnette");
412  if(communicationGroom != null)
413  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
414  }
415  }
416  });
417 
418  // Donne le focus
419  boutonSonnette.setFocusableInTouchMode(true);
420  boutonSonnette.requestFocus();
421 
422  boutonPresence= (Button) findViewById(R.id.boutonPresence);
423  boutonPresence.setOnClickListener(new View.OnClickListener(){
424  public void onClick(View v)
425  {
426  Log.d(TAG, "onClick() boutonPresence :" + boutonPresence.getText().toString());
427  if(boutonPresence.getText().toString().equals("Desactiver"))
428  {
430  boutonPresence.setText("Activer");
432  if(communicationGroom != null)
433  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
434  }
435  else
436  {
438  boutonPresence.setText("Désactiver");
440  if(communicationGroom != null)
441  communicationGroom.envoyer("$CMD;" + etatOccupant + ";" + etatModeSonnette + ";" + etatModeDetecteur + "\r\n");
442  }
443  }
444  });
445 
446  boutonRadioActivationPresence = (RadioButton) findViewById(R.id.boutonRadioActivationPresence);
447  boutonRadioEtatPresence = (RadioButton) findViewById(R.id.boutonRadioEtatPresence);
448 
449  boutonAjoutUrl = (Button) findViewById(R.id.boutonAjoutUrl);
450  boutonAjoutUrl.setOnClickListener(new View.OnClickListener()
451  {
452  @Override
453  public void onClick(View v)
454  {
455  Log.d(TAG, "onClick() boutonAjoutUrl");
456  modifierUrl();
457  }
458  });
459 
461 
463  }
464 
468  private void initialiserListeGroom()
469  {
470  ArrayList<String> listePeripheriques = new ArrayList<String>();
471  for (BluetoothDevice device : CommunicationGroom.getListeGrooms())
472  {
473  listePeripheriques.add(device.getName());
474  }
475  ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, listePeripheriques);
476 
477  listeAppareilsBluetooth.setAdapter(adapter);
478  listeAppareilsBluetooth.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
479  {
480  @Override
481  public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
482  {
483  Log.d(TAG, "onItemSelected() position : " + position + " -> " + CommunicationGroom.getListeGrooms().get(position).getName() + " [" + CommunicationGroom.getListeGrooms().get(position).getAddress() + "]");
484  if(choixGroom != position)
485  {
486  choixGroom = position;
487  communicationGroom = new CommunicationGroom(CommunicationGroom.getListeGrooms().get(position), handler);
488  }
489  }
490 
491  @Override
492  public void onNothingSelected(AdapterView<?> parent)
493  {
494 
495  }
496  });
497  }
498 
502  private void modifierOccupant()
503  {
504  Log.d(TAG, "modifierOccupant()");
505  modificationOccupant = new AlertDialog.Builder(this);
506 
507  modificationOccupant.setTitle("GROOM");
508  modificationOccupant.setMessage("Modifier les informations de l'occupannt : ");
509  //dialogueModificationOccupant.setView(R.layout.dialogue_modification_occupant);
510  // ou :
511  LayoutInflater factory = LayoutInflater.from(this);
512  final View ajoutJoueurView = factory.inflate(R.layout.dialogue_modification_occupant, null);
513  modificationOccupant.setView(ajoutJoueurView);
514 
515  modificationOccupant.setPositiveButton("Modifier", new DialogInterface.OnClickListener()
516  {
517  @Override
518  public void onClick(DialogInterface dialog, int which)
519  {
520  // Récupère les informations saisies
521  EditText editNomOccupant =
522  (EditText) ((AlertDialog) dialog).findViewById(R.id.nomOccupant);
523  EditText editPrenomOccupant =
524  (EditText) ((AlertDialog) dialog).findViewById(R.id.prenomOccupant);
525  EditText editFonctionOccupant =
526  (EditText) ((AlertDialog) dialog).findViewById(R.id.fonctionOccupant);
527  Log.v(TAG,
528  "Modification occupant : " + "Nom = " + editNomOccupant.getText().toString() + " - " + "Prénom = " + editPrenomOccupant.getText().toString() + " - " + "Fonction = " + editFonctionOccupant.getText().toString());
529 
530  // Modifie et affiche les nouvelles informations de l'occupant
531  occupant.setNom(editNomOccupant.getText().toString());
532  occupant.setPrenom(editPrenomOccupant.getText().toString());
533  occupant.setFonction(editFonctionOccupant.getText().toString());
534  texteNomFonction.setText(occupant.getNom() + " " + occupant.getPrenom() + " - " + occupant.getFonction());
535 
536  // On sauvegarde localement les nouvelles informations d l'occupant
537  sharedPreferences.edit().putString(PREFERENCES_NOM_OCCUPANT, occupant.getNom()).apply(); // ou .commit()
538  sharedPreferences.edit().putString(PREFERENCES_PRENOM_OCCUPANT, occupant.getPrenom()).apply();
539  sharedPreferences.edit().putString(PREFERENCES_FONCTION, occupant.getFonction()).apply();
540  }
541  });
542  modificationOccupant.setNegativeButton("Annuler", new DialogInterface.OnClickListener()
543  {
544  @Override
545  public void onClick(DialogInterface dialog, int which)
546  {
547  }
548  });
549 
550  AlertDialog dialogueModificationOccupant = modificationOccupant.create();
551  dialogueModificationOccupant.show();
552 
553  // Affiche les informations actuelles de l'occupant
554  EditText nom =
555  (EditText) ((AlertDialog) dialogueModificationOccupant).findViewById(R.id.nomOccupant);
556  nom.setText(occupant.getNom());
557  EditText prenom =
558  (EditText) ((AlertDialog) dialogueModificationOccupant).findViewById(R.id.prenomOccupant);
559  prenom.setText(occupant.getPrenom());
560  EditText fonction =
561  (EditText) ((AlertDialog) dialogueModificationOccupant).findViewById(R.id.fonctionOccupant);
562  fonction.setText(occupant.getFonction());
563 
564  }
565 
566  private void modifierUrl()
567  {
568  Log.d(TAG, "modifierUrl()");
569  modificationUrl = new AlertDialog.Builder(this);
570 
571  modificationUrl.setTitle("GROOM");
572  modificationUrl.setMessage("Modifier l'agenda");
573  //dialogueModificationUrl.setView(R.layout.dialogue_modification_calendrier);
574  // ou :
575  LayoutInflater factory = LayoutInflater.from(this);
576  final View ajoutModificationUrlView = factory.inflate(R.layout.dialogue_modification_calendrier, null);
577  modificationUrl.setView(ajoutModificationUrlView);
578 
579  modificationUrl.setPositiveButton("Modifier", new DialogInterface.OnClickListener()
580  {
581  @Override
582  public void onClick(DialogInterface dialog, int which)
583  {
584  // Récupère les informations saisies
585  EditText editEntreeUrl =
586  (EditText) ((AlertDialog) dialog).findViewById(R.id.entreeUrl);
587 
588  editEntreeUrl.getText().toString();
589 
590  nouvelUrl = editEntreeUrl.getText().toString();
591 
592  WebView myWebView = (WebView) findViewById(R.id.calendrierGroom);
593  WebSettings webSettings = myWebView.getSettings();
594  webSettings.setJavaScriptEnabled(true);
595 
596  String unencodedHtml = nouvelUrl;
597  String encodedHtml = Base64.encodeToString(unencodedHtml.getBytes(), Base64.NO_PADDING);
598  myWebView.loadData(encodedHtml, "text/html", "base64");
599  if(WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK))
600  {
601  WebSettingsCompat.setForceDark(myWebView.getSettings(), WebSettingsCompat.FORCE_DARK_ON);
602  }
603  }
604  });
605  modificationUrl.setNegativeButton("Annuler", new DialogInterface.OnClickListener()
606  {
607  @Override
608  public void onClick(DialogInterface dialog, int which)
609  {
610  }
611  });
612 
613  AlertDialog dialogueModificationUrl = modificationUrl.create();
614  dialogueModificationUrl.show();
615 
616  }
617 
618  @Override
619  public boolean onCreateOptionsMenu(Menu menu)
620  {
621  Log.d(TAG, "onCreateOptionsMenu()");
622  getMenuInflater().inflate(R.menu.menu_main, menu);
623  return true;
624  }
625 
626  @Override
627  public boolean onOptionsItemSelected(MenuItem item)
628  {
629  int id = item.getItemId();
630  Log.d(TAG, "onOptionsItemSelected() " + "id = " + id);
631 
632  //if (id == R.id.action_settings)
633  //{
634  // return true;
635  //}
636 
637  return super.onOptionsItemSelected(item);
638  }
639 
643  final private Handler handler = new Handler()
644  {
645  @SuppressLint("HandlerLeak")
646  public void handleMessage(Message msg)
647  {
648  super.handleMessage(msg);
649 
650  switch (msg.what)
651  {
653  Log.d(TAG, "ERREUR_GROOM");
654  afficherErreur();
655  break;
657  Log.d(TAG, "CONNEXION_GROOM");
658  afficherConnexionGroom();
659  initialiserEtatGroom();
660  break;
662  Log.d(TAG, "DECONNEXION_GROOM");
663  afficherDeconnexionGroom();
664  break;
666  String trame = msg.obj.toString();
667  Log.d(TAG, "RECEPTION_GROOM -> " + trame);
668 
669  String champs[] = trame.split(";");
670  // Debug
671  for(int i=0;i<champs.length;++i)
672  {
673  Log.d(TAG, " champ " + i + " -> " + champs[i]);
674  }
675 
676  int etat = Integer.parseInt(champs[CommunicationGroom.CHAMP_ETAT]);
677 
678  switch (etat)
679  {
680  case IHMGroom.ETAT_LIBRE:
681  Log.d(TAG, " ETAT_LIBRE");
682  boutonRadioLibre.setChecked(true);
683  boutonSonnette.setEnabled(true);
684  afficherEtatLibre();
685  break;
686  case IHMGroom.ETAT_ABSENT:
687  Log.d(TAG, " ETAT_ABSENT");
688  boutonRadioAbsent.setChecked(true);
689  afficherEtatAbsent();
690  break;
691  case IHMGroom.ETAT_OCCUPE:
692  Log.d(TAG, " ETAT_OCCUPE");
693  boutonRadioOccupe.setChecked(true);
694  afficherEtatOccupe();
695  break;
696  case IHMGroom.ETAT_ENTRER:
697  Log.d(TAG, "ETAT_ENTRER");
698  afficherEtatEntrer();
699  break;
700  }
701 
702  if(champs[CommunicationGroom.CHAMP_SONNETTE].equals("1"))
703  {
704  Log.d(TAG, " Appui sonnette !");
705  afficherCloche();
706  afficherNotification();
707  }
708  else
709  {
710  Log.d(TAG, " Pas d'appui sonnette !");
711  }
712 
713  if(champs[CommunicationGroom.CHAMP_PRESENCE].equals("1"))
714  {
715  Log.d(TAG, " Présence personne détectée !");
716  activerPresence();
717  }
718  else
719  {
720  Log.d(TAG, " Pas de présence personne détectée !");
721  desactiverPresence();
722  }
723 
724  if(champs[CommunicationGroom.CHAMP_MODE_PRESENCE].equals("1"))
725  {
726  Log.d(TAG, " Détecteur_de présence activé !");
727  boutonPresence.setText("Desactiver");
728  affichageActiverModePresence();
729  //mettre l'affichage du mode presence active une fois le capteur de présence fonctionnel
730  }
731  else
732  {
733  Log.d(TAG, " Détecteur_de présence désactivé !");
734  boutonPresence.setText("Activer");
735  affichageDesactiverModePresence();
736  //mettre l'affichage du mode presence desactive une fois le capteur de présence fonctionnel
737  }
738 
739  if(champs[CommunicationGroom.CHAMP_MODE_SONNETTE].equals("1"))
740  {
741  Log.d(TAG, " Sonnette activée !");
742  boutonSonnette.setText("Désactiver Sonnette");
743  }
744  else
745  {
746  Log.d(TAG, " Sonnette désactivée !");
747  boutonSonnette.setText("Activer Sonnette");
748  }
749 
750  break;
751  }
752  }
753 
754 
755 
756 
757  };
758 
762  private void afficherErreur()
763  {
764  Context context = getApplicationContext();
765  CharSequence text = "Erreur communication !\nVérifier l'appairage et le branchement du groom.";
766  int duration = Toast.LENGTH_LONG;
767  Toast toast = Toast.makeText(context, text, duration);
768  toast.show();
769  toast.setGravity(Gravity.LEFT,600,-600);
770  }
771 
775  private void afficherEtatLibre()
776  {
777  Context context = getApplicationContext();
778  CharSequence text = "Libre !";
779  int duration = Toast.LENGTH_LONG;
780  Toast toast = Toast.makeText(context, text, duration);
781  toast.show();
782  toast.setGravity(Gravity.LEFT,300,-150);
783  }
784 
788  private void afficherEtatOccupe()
789  {
790  Context context = getApplicationContext();
791  CharSequence text = "Occupé !";
792  int duration = Toast.LENGTH_LONG;
793  Toast toast = Toast.makeText(context, text, duration);
794  toast.show();
795  toast.setGravity(Gravity.LEFT,300,-70);
796  }
797 
801  private void afficherEtatAbsent()
802  {
803  Context context = getApplicationContext();
804  CharSequence text = "Absent !";
805  int duration = Toast.LENGTH_SHORT;
806  Toast toast = Toast.makeText(context, text, duration);
807  toast.show();
808  toast.setGravity(Gravity.LEFT,300,0);
809  }
810 
814  private void afficherEtatEntrer()
815  {
816  Context context = getApplicationContext();
817  CharSequence text = "Entrer !";
818  int duration = Toast.LENGTH_SHORT;
819  Toast toast = Toast.makeText(context, text, duration);
820  toast.show();
821  }
822 
827  {
828  // On crée un "gestionnaire de notification"
829  notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
830  }
831 
835  private void afficherNotification()
836  {
837  CharSequence name = getString(R.string.app_name);
838  String description = "Gestion GROOM";
839  int importance = NotificationManager.IMPORTANCE_DEFAULT;
840  NotificationChannel channel = new NotificationChannel("GROOM", name, importance);
841  channel.setDescription(description);
842  notificationManager.createNotificationChannel(channel);
843 
844  // On définit le titre de la notification
845  String titreNotification = getString(R.string.app_name);
846  Log.d(TAG, "afficherNotification() titre = " + titreNotification + " - message = " + messageSonnette + " - numeroNotification = " + numeroNotification);
847 
848  // On crée la notification
849  NotificationCompat.Builder notification = new NotificationCompat.Builder(this, "GROOM")
850  .setSmallIcon(R.mipmap.ic_launcher)
851  .setContentTitle(titreNotification)
852  .setContentText(messageSonnette)
853  .setPriority(NotificationCompat.PRIORITY_DEFAULT);
854 
855  PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);
856  notification.setContentIntent(pendingIntent);
857  notification.setAutoCancel(true);
858 
859  // On affiche la notification
860  notificationManager.notify(numeroNotification++, notification.build());
861  }
862 
863 
864 
868  private void initialiserEtatGroom()
869  {
870  if(communicationGroom != null)
871  communicationGroom.envoyer("$ETAT\r\n");
872  }
873 
877  private void activerPresence()
878  {
879  boutonRadioEtatPresence.setText("Il y a quelqu'un à l'entrée !");
880  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
881  {
882  boutonRadioEtatPresence.setButtonTintList(ContextCompat.getColorStateList(this, R.color.vert));
883  }
884  LayoutInflater inflater = this.getLayoutInflater();
885 
886  layout = inflater.inflate(R.layout.toast_presence, findViewById(R.id.layout_toast_presence));
887  // TextView in layout_custom_toast.
888  imagePresence = (ImageView) findViewById(R.id.imagePresence);
889  // Create Toast
890  toast = new Toast(getApplicationContext());
891  toast.setDuration(Toast.LENGTH_LONG);
892  toast.setGravity(Gravity.TOP,-130,280);
893  toast.setView(layout);
894  toast.show();
895 
896  }
897 
901  private void desactiverPresence()
902  {
903  boutonRadioEtatPresence.setText("Il n'y a personne à l'entrée");
904  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
905  {
906  boutonRadioEtatPresence.setButtonTintList(ContextCompat.getColorStateList(this, R.color.rouge));
907  }
908  }
909 
914  {
915  //Log.d(TAG, "affichageDesactiverModePresence()");
916  boutonRadioActivationPresence.setText("Désactivé");
917  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
918  {
919  boutonRadioActivationPresence.setButtonTintList(ContextCompat.getColorStateList(this, R.color.rouge));
920  }
921  }
922 
927  {
928  //Log.d(TAG, "affichageActiverModePresence()");
929  boutonRadioActivationPresence.setText("Activé");
930  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
931  {
932  boutonRadioActivationPresence.setButtonTintList(ContextCompat.getColorStateList(this, R.color.vert));
933  }
934  }
935 
939  private void afficherCloche()
940  {
941  LayoutInflater inflater = this.getLayoutInflater();
942 
943  layout = inflater.inflate(R.layout.toast_image, findViewById(R.id.layout_image_clochette));
944  // TextView in layout_custom_toast.
945  imageClochette = (ImageView) findViewById(R.id.imageClochette);
946  // Create Toast
947  toast = new Toast(getApplicationContext());
948  toast.setDuration(Toast.LENGTH_LONG);
949  toast.setGravity(Gravity.RIGHT,100,-30);
950  toast.setView(layout);
951  toast.show();
952  }
953 
958  {
959  boutonPresence.setText("Activer");
960  }
961 
966  {
967  boutonPresence.setText("Désactiver");
968  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
969  {
970  boutonRadioActivationPresence.setButtonTintList(ContextCompat.getColorStateList(this, R.color.vert));
971  }
972  }
973 
978  {
979  Log.d(TAG, "afficherDeconnexionGroom()");
980 
981  if(CommunicationGroom.getListeGrooms().size() > 0)
982  {
983  choixGroom = (int)listeAppareilsBluetooth.getSelectedItemId();
984  communicationGroom = new CommunicationGroom(CommunicationGroom.getListeGrooms().get((int)listeAppareilsBluetooth.getSelectedItemId()), handler);
985  boutonConnexion.setEnabled(true);
986  listeAppareilsBluetooth.setEnabled(true);
987  }
988  else
989  {
990  boutonConnexion.setEnabled(false);
991  listeAppareilsBluetooth.setEnabled(false);
992  }
993 
994  boutonConnexion.setText("Connecter");
995  etatConnexion.setText("Déconnecté");
996  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
997  {
998  etatConnexion.setButtonTintList(ContextCompat.getColorStateList(this, R.color.rouge));
999  }
1000  boutonRadioLibre.setEnabled(false);
1001  boutonRadioAbsent.setEnabled(false);
1002  boutonRadioOccupe.setEnabled(false);
1003  boutonEntrer.setEnabled(false);
1004  boutonSonnette.setEnabled(false);
1005  boutonAjoutOccupant.setEnabled(true);
1006  envoyerMessageOccupant.setEnabled(false);
1007  texteMessageOccupant.setEnabled(false);
1008  boutonEnvoieOccupant.setEnabled(true);
1009  boutonEnvoieOccupant.setEnabled(false);
1010  boutonPresence.setEnabled(false);
1011  afficherPresenceDesactiveGroom();
1012  boutonSonnette.setText("Activer Sonnette");
1013  boutonRadioAbsent.setChecked(false);
1014  boutonRadioOccupe.setChecked(false);
1015  boutonRadioLibre.setChecked(false);
1016  }
1017 
1021  private void afficherConnexionGroom()
1022  {
1023  Log.d(TAG, "afficherConnexionGroom()");
1024 
1025  listeAppareilsBluetooth.setEnabled(false);
1026  boutonConnexion.setEnabled(true);
1027  boutonConnexion.setText("Déconnecter");
1028  etatConnexion.setText("Connecté");
1029  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
1030  {
1031  etatConnexion.setButtonTintList(ContextCompat.getColorStateList(this, R.color.vert));
1032  }
1033  boutonRadioLibre.setEnabled(true);
1034  boutonRadioAbsent.setEnabled(true);
1035  boutonRadioOccupe.setEnabled(true);
1036  boutonEntrer.setEnabled(true);
1037  boutonSonnette.setEnabled(false);
1038  boutonAjoutOccupant.setEnabled(true);
1039  envoyerMessageOccupant.setEnabled(true);
1040  texteMessageOccupant.setEnabled(true);
1041  boutonEnvoieOccupant.setEnabled(true);
1042  boutonEnvoieOccupant.setEnabled(true);
1043  boutonPresence.setEnabled(true);
1044  boutonSonnette.setText("Activer Sonnette");
1045  }
1046 
1050  private void chargerCalendrier()
1051  {
1052  WebView myWebView = (WebView) findViewById(R.id.calendrierGroom);
1053  WebSettings webSettings = myWebView.getSettings();
1054  webSettings.setJavaScriptEnabled(true);
1055 
1056  String unencodedHtml = "<iframe src=\"https://calendar.google.com/calendar/embed?src=robertutilisateur84%40gmail.com&ctz=Europe%2FParis\" style=\"border: 0\" width=\"760\" height=\"495\" frameborder=\"0\" scrolling=\"no\"></iframe>";;
1057  String encodedHtml = Base64.encodeToString(unencodedHtml.getBytes(), Base64.NO_PADDING);
1058  myWebView.loadData(encodedHtml, "text/html", "base64");
1059  if(WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK))
1060  {
1061  WebSettingsCompat.setForceDark(myWebView.getSettings(), WebSettingsCompat.FORCE_DARK_ON);
1062  }
1063 
1064  new CountDownTimer(300000, 1000)
1065  {
1066  public void onTick(long millisUntilFinished)
1067  {
1068  }
1069  public void onFinish()
1070  {
1071  String encodedHtml = Base64.encodeToString(nouvelUrl.getBytes(), Base64.NO_PADDING);
1072  myWebView.loadData(encodedHtml, "text/html", "base64");
1073  if(WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK))
1074  {
1075  WebSettingsCompat.setForceDark(myWebView.getSettings(), WebSettingsCompat.FORCE_DARK_ON);
1076  }
1077  this.start();
1078  }
1079  }.start();
1080  }
1081 }
com.example.groom.IHMGroom.nomOccupant
String nomOccupant
nom de l'occupant
Definition: IHMGroom.java:76
com.example.groom.IHMGroom.PREFERENCES
static final String PREFERENCES
clé pour le titre du stockage
Definition: IHMGroom.java:131
com.example.groom.IHMGroom.onOptionsItemSelected
boolean onOptionsItemSelected(MenuItem item)
Definition: IHMGroom.java:627
com.example.groom.IHMGroom.affichageActiverModePresence
void affichageActiverModePresence()
Changement fait lors de l'activation du mode présence.
Definition: IHMGroom.java:926
com.example.groom.CommunicationGroom.CHAMP_PRESENCE
static final int CHAMP_PRESENCE
le champ numéro 3 concernant la présence
Definition: CommunicationGroom.java:39
com.example.groom.CommunicationGroom.getListeGrooms
static ArrayList< BluetoothDevice > getListeGrooms()
Récupère la liste des grooms appairés.
Definition: CommunicationGroom.java:124
com.example.groom.IHMGroom.numeroNotification
int numeroNotification
Definition: IHMGroom.java:89
com.example.groom.IHMGroom.desactiverPresence
void desactiverPresence()
lorsque la présence est désactive, le bouton radio etat presence change en rouge et informe qu'il y a...
Definition: IHMGroom.java:901
com.example.groom.CommunicationGroom.CONNEXION_GROOM
static final int CONNEXION_GROOM
connexion du groom
Definition: CommunicationGroom.java:33
com.example.groom.IHMGroom.boutonRadioEtatPresence
RadioButton boutonRadioEtatPresence
affichage de la presence a l'entree
Definition: IHMGroom.java:121
com.example.groom.IHMGroom.boutonRadioAbsent
RadioButton boutonRadioAbsent
boton pour choisir l'etat absent
Definition: IHMGroom.java:110
com.example.groom.IHMGroom.etatModeDetecteur
int etatModeDetecteur
etat du mode de detection
Definition: IHMGroom.java:83
com.example.groom.CommunicationGroom
Definition: CommunicationGroom.java:27
com.example.groom.IHMGroom.TAG
static final String TAG
TAG pour les logs.
Definition: IHMGroom.java:63
com.example.groom.IHMGroom.texteNomOccupant
TextView texteNomOccupant
texte montrant le nom de l'occupant
Definition: IHMGroom.java:93
com.example.groom.IHMGroom.modifierOccupant
void modifierOccupant()
Gère la boîte de dialogue permettant de modifier les information de l'occupant.
Definition: IHMGroom.java:502
com.example.groom.IHMGroom.afficherNotification
void afficherNotification()
affiche la notification dans la barre de notification
Definition: IHMGroom.java:835
com.example.groom.IHMGroom.communicationGroom
CommunicationGroom communicationGroom
Definition: IHMGroom.java:85
com.example.groom.IHMGroom.nouvelUrl
String nouvelUrl
modification de l'URL pour l'agenda
Definition: IHMGroom.java:79
com.example.groom.IHMGroom.boutonAjoutOccupant
Button boutonAjoutOccupant
bouton ajout d'un occupant
Definition: IHMGroom.java:97
com.example.groom.IHMGroom.afficherDeconnexionGroom
void afficherDeconnexionGroom()
Actions à réaliser lorsque l'application est déconnectée.
Definition: IHMGroom.java:977
com.example.groom.IHMGroom.ETAT_OCCUPE
static final int ETAT_OCCUPE
L'état Occupe.
Definition: IHMGroom.java:66
com.example.groom.CommunicationGroom.envoyer
void envoyer(String trame)
Permet d'envoyer une trame au module bluetooth du groom.
Definition: CommunicationGroom.java:151
com.example.groom.IHMGroom.SONNETTE_OFF
static final int SONNETTE_OFF
Etat sonnette eteinte.
Definition: IHMGroom.java:69
com.example.groom.IHMGroom.DETECTEUR_ON
static final int DETECTEUR_ON
Etat detecteur allumee.
Definition: IHMGroom.java:70
com.example.groom.IHMGroom.boutonPresence
Button boutonPresence
activation/desactivation du mode de presence
Definition: IHMGroom.java:119
com.example.groom.IHMGroom.texteNomFonction
EditText texteNomFonction
Definition: IHMGroom.java:99
com.example.groom.IHMGroom.boutonEnvoieOccupant
Button boutonEnvoieOccupant
bouton d'envoie du nom prenom et fonction de l'occupant
Definition: IHMGroom.java:98
com.example.groom.Occupant.getPrenom
String getPrenom()
récupère le prénom de l'occupant
Definition: Occupant.java:74
com.example.groom.IHMGroom.choixGroom
int choixGroom
Definition: IHMGroom.java:86
com.example.groom.IHMGroom.ETAT_ENTRER
static final int ETAT_ENTRER
L'état entrer.
Definition: IHMGroom.java:67
com.example.groom.IHMGroom.boutonAjoutUrl
Button boutonAjoutUrl
Definition: IHMGroom.java:123
com.example.groom.IHMGroom.PREFERENCES_FONCTION
static final String PREFERENCES_FONCTION
clé pour la fonction de l'occupant
Definition: IHMGroom.java:134
com.example.groom.IHMGroom.messageSonnette
static final String messageSonnette
Definition: IHMGroom.java:72
com.example.groom.IHMGroom.afficherEtatLibre
void afficherEtatLibre()
affiche l'état de l'ESP 32, ici il est libre
Definition: IHMGroom.java:775
com.example.groom.IHMGroom.SONNETTE_ON
static final int SONNETTE_ON
Etat sonnette allumee.
Definition: IHMGroom.java:68
com.example.groom.IHMGroom.toast
Toast toast
Definition: IHMGroom.java:126
com.example.groom.CommunicationGroom.DECONNEXION_GROOM
static final int DECONNEXION_GROOM
déconnexion du groom
Definition: CommunicationGroom.java:35
com.example.groom.Occupant.getNom
String getNom()
récupère le nom de l'occupant
Definition: Occupant.java:56
com.example.groom.IHMGroom.chargerCalendrier
void chargerCalendrier()
Affichage du calendrier google via une WebView.
Definition: IHMGroom.java:1050
com.example.groom.IHMGroom.modifierUrl
void modifierUrl()
Definition: IHMGroom.java:566
com.example.groom.IHMGroom.onDestroy
void onDestroy()
Méthode appelée à la destruction de l'application (après onStop() et détruite par le système Android)
Definition: IHMGroom.java:215
com.example.groom.IHMGroom.initialiserSystemeNotification
void initialiserSystemeNotification()
initialiser la notification
Definition: IHMGroom.java:826
com.example.groom.Occupant.getFonction
String getFonction()
récupère la fonction de l'occupant
Definition: Occupant.java:92
com.example.groom.Occupant
Informations sur l'occupant du bureau.
Definition: Occupant.java:17
com.example.groom.IHMGroom.etatConnexion
RadioButton etatConnexion
affichage de la connexion
Definition: IHMGroom.java:96
com.example.groom.IHMGroom.onPause
void onPause()
Méthode appelée après qu'une boîte de dialogue s'est affichée (on reprend sur un onResume()) ou avant...
Definition: IHMGroom.java:194
com.example.groom.CommunicationGroom.ERREUR_GROOM
static final int ERREUR_GROOM
erreur avec groom
Definition: CommunicationGroom.java:32
com.example.groom.IHMGroom.afficherEtatAbsent
void afficherEtatAbsent()
affiche l'état de l'ESP 32, ici il est absent
Definition: IHMGroom.java:801
com.example.groom.IHMGroom.titreMessageOccupant
TextView titreMessageOccupant
titre pour indiquer la zone du message occupant
Definition: IHMGroom.java:102
com.example.groom.IHMGroom.ETAT_LIBRE
static final int ETAT_LIBRE
L'état Libre.
Definition: IHMGroom.java:64
com.example.groom.IHMGroom.afficherEtatOccupe
void afficherEtatOccupe()
affiche l'état de l'ESP 32, ici il est occupe
Definition: IHMGroom.java:788
com.example.groom.IHMGroom.boutonEntrer
Button boutonEntrer
bouton pour choisir l'etat entrer
Definition: IHMGroom.java:113
com.example.groom.CommunicationGroom.CHAMP_SONNETTE
static final int CHAMP_SONNETTE
le champ numéro 2 concernant la sonnette
Definition: CommunicationGroom.java:38
com.example.groom.IHMGroom.recupererInformationsOccupant
void recupererInformationsOccupant()
Récupère et crée l'objet occupant avec les informations stockées localement.
Definition: IHMGroom.java:226
com.example.groom.IHMGroom.imageClochette
ImageView imageClochette
image pour afficher la notification d'un visiteur qui sonne
Definition: IHMGroom.java:115
com.example.groom.IHMGroom.onStop
void onStop()
Méthode appelée lorsque l'activité n'est plus visible.
Definition: IHMGroom.java:204
com.example.groom.IHMGroom.layout
View layout
Definition: IHMGroom.java:125
com.example.groom.IHMGroom.boutonRadioLibre
RadioButton boutonRadioLibre
bouton pour choisir l'etat libre
Definition: IHMGroom.java:108
com.example.groom.IHMGroom.afficherCloche
void afficherCloche()
Affichage de la cloche sur l'IHM lors de l'appui du bouton sonnette sur le module.
Definition: IHMGroom.java:939
com.example.groom.IHMGroom.listeAppareilsBluetooth
Spinner listeAppareilsBluetooth
Affichage du peripherique actuellement et anciennement connecte.
Definition: IHMGroom.java:94
com.example.groom.IHMGroom.modificationOccupant
AlertDialog.Builder modificationOccupant
Fenêtre de dialogue pour modifier un.
Definition: IHMGroom.java:127
com.example.groom.CommunicationGroom.RECEPTION_GROOM
static final int RECEPTION_GROOM
réception du groom
Definition: CommunicationGroom.java:34
com.example.groom.IHMGroom
L'activité principale de l'application Groom.
Definition: IHMGroom.java:60
com.example.groom.IHMGroom.initialiserListeGroom
void initialiserListeGroom()
Initialise la liste des périphériques Groom.
Definition: IHMGroom.java:468
com.example.groom.IHMGroom.boutonRadioActivationPresence
RadioButton boutonRadioActivationPresence
affichage de l'etat du mode de presence
Definition: IHMGroom.java:120
com.example.groom.IHMGroom.fonctionOccupant
String fonctionOccupant
fonction de l'occupant
Definition: IHMGroom.java:78
com.example.groom.IHMGroom.initialiserWidgets
void initialiserWidgets()
Initialise les widgets de l'IHM.
Definition: IHMGroom.java:251
com.example.groom.IHMGroom.texteMessageOccupant
EditText texteMessageOccupant
zone ou entrer le message personnel
Definition: IHMGroom.java:103
com.example.groom.CommunicationGroom.CHAMP_MODE_SONNETTE
static final int CHAMP_MODE_SONNETTE
le champ numéro 4 concernant le mode de la sonnette
Definition: CommunicationGroom.java:40
com.example.groom.CommunicationGroom.CHAMP_MODE_PRESENCE
static final int CHAMP_MODE_PRESENCE
le champ numéro 5 concernant le mode de la présence
Definition: CommunicationGroom.java:41
com.example.groom.IHMGroom.ETAT_ABSENT
static final int ETAT_ABSENT
L'état Absent.
Definition: IHMGroom.java:65
com.example.groom.IHMGroom.boutonSonnette
Button boutonSonnette
bouton pour activer/desactiver le mode sonnette
Definition: IHMGroom.java:114
com.example.groom.IHMGroom.boutonConnexion
Button boutonConnexion
bouton de connexion
Definition: IHMGroom.java:95
com.example.groom.IHMGroom.onCreate
void onCreate(Bundle savedInstanceState)
Méthode appelée à la création de l'activité
Definition: IHMGroom.java:140
com.example.groom.IHMGroom.onStart
void onStart()
Méthode appelée au démarrage après le onCreate() ou un restart après un onStop()
Definition: IHMGroom.java:173
com.example.groom.IHMGroom.occupant
Occupant occupant
constructeur occupant
Definition: IHMGroom.java:75
com.example.groom.IHMGroom.onCreateOptionsMenu
boolean onCreateOptionsMenu(Menu menu)
Definition: IHMGroom.java:619
com.example.groom.CommunicationGroom.connecter
void connecter()
Permet la connexion au module bluetooth.
Definition: CommunicationGroom.java:187
com.example.groom.IHMGroom.afficherErreur
void afficherErreur()
affiche une erreur avec l'ESP 32
Definition: IHMGroom.java:762
com.example.groom.IHMGroom.titreConnexion
TextView titreConnexion
titre pour indiquer la zone de connexion
Definition: IHMGroom.java:92
com.example.groom.IHMGroom.titreEtat
TextView titreEtat
titre pour indiquer la zone des etats de l'occupant du bureau
Definition: IHMGroom.java:107
com.example.groom.IHMGroom.activerPresence
void activerPresence()
lorsque la présence est active, le bouton radio etat présence change en vert et informe qu'il y a une...
Definition: IHMGroom.java:877
com.example.groom.IHMGroom.afficherPresenceDesactiveGroom
void afficherPresenceDesactiveGroom()
affichage de la présence lorsqu'il n'y a personne
Definition: IHMGroom.java:957
com.example.groom.CommunicationGroom.deconnecter
void deconnecter()
Permet la déconnexion du module bluetooth.
Definition: CommunicationGroom.java:231
com.example.groom.IHMGroom.initialiserEtatGroom
void initialiserEtatGroom()
Récupère l'état affiché sur le module à la connexion.
Definition: IHMGroom.java:868
com.example.groom.IHMGroom.PREFERENCES_PRENOM_OCCUPANT
static final String PREFERENCES_PRENOM_OCCUPANT
clé pour le prénom de l'occupant
Definition: IHMGroom.java:133
com.example.groom.IHMGroom.afficherPresenceActiveGroom
void afficherPresenceActiveGroom()
affichage de la présence lorsqu'il y a quelqu'un
Definition: IHMGroom.java:965
com.example.groom.IHMGroom.onResume
void onResume()
Méthode appelée après onStart() ou après onPause()
Definition: IHMGroom.java:183
com.example.groom.IHMGroom.imagePresence
ImageView imagePresence
image pour afficher la notification d'un visiteur qui est détecté
Definition: IHMGroom.java:116
com.example.groom.IHMGroom.PREFERENCES_NOM_OCCUPANT
static final String PREFERENCES_NOM_OCCUPANT
clé pour le nom de l'occupant
Definition: IHMGroom.java:132
com.example.groom.IHMGroom.DETECTEUR_OFF
static final int DETECTEUR_OFF
Etat detecteur eteinte.
Definition: IHMGroom.java:71
com.example.groom.IHMGroom.prenomOccupant
String prenomOccupant
prenom de l'occupant
Definition: IHMGroom.java:77
com.example.groom.IHMGroom.envoyerMessageOccupant
Button envoyerMessageOccupant
bouton d'envoie du message
Definition: IHMGroom.java:104
com.example.groom.IHMGroom.affichageDesactiverModePresence
void affichageDesactiverModePresence()
Changement fait lors de la désactivation du mode présence.
Definition: IHMGroom.java:913
com.example.groom.IHMGroom.modificationUrl
AlertDialog.Builder modificationUrl
Definition: IHMGroom.java:124
com.example.groom.IHMGroom.etatModeSonnette
int etatModeSonnette
etat du mode de la sonnette
Definition: IHMGroom.java:82
com.example.groom.IHMGroom.etatOccupant
int etatOccupant
etat de l'occupant
Definition: IHMGroom.java:81
com.example.groom.IHMGroom.afficherConnexionGroom
void afficherConnexionGroom()
Actions à réaliser lorsque l'application est connectée.
Definition: IHMGroom.java:1021
com.example.groom.IHMGroom.afficherEtatEntrer
void afficherEtatEntrer()
affiche l'état de l'ESP 32, ici il est entrer
Definition: IHMGroom.java:814
com.example.groom.IHMGroom.boutonRadioOccupe
RadioButton boutonRadioOccupe
bouton pour choisir l'etat occupe
Definition: IHMGroom.java:109
com.example.groom.CommunicationGroom.CHAMP_ETAT
static final int CHAMP_ETAT
le champ numéro 1 concernant l'état
Definition: CommunicationGroom.java:37
com.example.groom.IHMGroom.notificationManager
NotificationManager notificationManager
Definition: IHMGroom.java:88