Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
L
LEPL1509-Projet
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Arthur Schamroth
LEPL1509-Projet
Validations
13c6ae3b
Valider
13c6ae3b
rédigé
2 years ago
par
Arthur Schamroth
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Correction of the modification exo popup
parent
b5bfc35f
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
1 requête de fusion
!33
Arthur
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
app/src/main/java/be/lepl1509group13/workoutwarrior/ProgramCreationActivity.java
+65
-19
65 ajouts, 19 suppressions
...pl1509group13/workoutwarrior/ProgramCreationActivity.java
app/src/main/res/layout/modify_exercice_popup.xml
+2
-1
2 ajouts, 1 suppression
app/src/main/res/layout/modify_exercice_popup.xml
avec
67 ajouts
et
20 suppressions
app/src/main/java/be/lepl1509group13/workoutwarrior/ProgramCreationActivity.java
+
65
−
19
Voir le fichier @
13c6ae3b
...
...
@@ -7,6 +7,7 @@ import android.graphics.Color;
import
android.graphics.Typeface
;
import
android.os.Bundle
;
import
android.provider.ContactsContract
;
import
android.text.InputType
;
import
android.widget.AdapterView
;
import
android.content.Context
;
import
android.os.Bundle
;
...
...
@@ -30,6 +31,7 @@ import android.widget.AutoCompleteTextView;
import
androidx.annotation.NonNull
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
...
...
@@ -66,9 +68,11 @@ public class ProgramCreationActivity extends AppCompatActivity {
// Déclaration variables
AutoCompleteTextView
input_exo
;
// Champ de texte pour rechercher les exercices
Integer
nbre_day
=
0
;
// Liste d'exos dynamique à remplir depuis la DB
public
Exercise
actual_exo
;
public
String
img_actual_exo
;
private
static
ArrayList
<
String
>
EXOS
=
new
ArrayList
<>();
// Liste des exercices de la base de données
CheckBox
cb_lundi
,
cb_mardi
,
cb_mercredi
,
cb_jeudi
,
cb_vendredi
,
cb_samedi
,
cb_dimanche
;
private
ArrayList
<
CheckBox
>
cb_list
=
new
ArrayList
<>();
...
...
@@ -83,7 +87,7 @@ public class ProgramCreationActivity extends AppCompatActivity {
ListExercicesAdapter
exercisesListAdapter
;
String
descriptionText
=
""
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -238,6 +242,27 @@ public class ProgramCreationActivity extends AppCompatActivity {
TextView
timer_text
=
dialog
.
findViewById
(
R
.
id
.
timer_text
);
TextView
break_text
=
dialog
.
findViewById
(
R
.
id
.
exercice_break
);
ConstraintLayout
form_layout
=
dialog
.
findViewById
(
R
.
id
.
constraintLayout2
);
form_layout
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
description_text
.
hasFocus
())
{
description_text
.
clearFocus
();
}
}
});
description_text
.
setOnFocusChangeListener
(
new
View
.
OnFocusChangeListener
()
{
@Override
public
void
onFocusChange
(
View
v
,
boolean
hasFocus
)
{
if
(!
hasFocus
)
{
description_text
.
setInputType
(
InputType
.
TYPE_CLASS_TEXT
|
InputType
.
TYPE_TEXT_FLAG_CAP_SENTENCES
);
}
else
{
description_text
.
setInputType
(
InputType
.
TYPE_CLASS_TEXT
|
InputType
.
TYPE_TEXT_FLAG_MULTI_LINE
|
InputType
.
TYPE_TEXT_FLAG_CAP_SENTENCES
);
}
}
});
if
(
description
!=
null
){
description_text
.
setText
(
description
);
}
...
...
@@ -273,27 +298,34 @@ public class ProgramCreationActivity extends AppCompatActivity {
Button
save_btn
=
dialog
.
findViewById
(
R
.
id
.
btn_save_modif
);
save_btn
.
setOnClickListener
(
w
->
{
EditText
description_text
=
dialog
.
findViewById
(
R
.
id
.
exercise_description
);
String
description_str
=
description_text
.
getText
().
toString
();
EditText
break_text
=
dialog
.
findViewById
(
R
.
id
.
exercice_break
);
String
string_break
=
break_text
.
getText
().
toString
();
Integer
break_time
=
Integer
.
parseInt
(
string_break
);
EditText
timer_edit
=
dialog
.
findViewById
(
R
.
id
.
exercise_timer
);
String
string_timer
=
timer_edit
.
getText
().
toString
();
if
(
string_timer
.
equals
(
""
)){
actual_exo
=
new
Exercise
(
exercise_searched
,
description_str
,
break_time
,
"@drawable/developpe_couche_barre"
,
0
);
}
else
{
Integer
timer_int
=
Integer
.
parseInt
(
string_timer
);
actual_exo
=
new
Exercise
(
exercise_searched
,
description_str
,
break_time
,
"@drawable/developpe_couche_barre"
,
timer_int
);
if
(
nbre_day
>
0
){
EditText
description_text
=
dialog
.
findViewById
(
R
.
id
.
exercise_description
);
String
description_str
=
description_text
.
getText
().
toString
();
EditText
break_text
=
dialog
.
findViewById
(
R
.
id
.
exercice_break
);
String
string_break
=
break_text
.
getText
().
toString
();
Integer
break_time
=
Integer
.
parseInt
(
string_break
);
EditText
timer_edit
=
dialog
.
findViewById
(
R
.
id
.
exercise_timer
);
String
string_timer
=
timer_edit
.
getText
().
toString
();
if
(
string_timer
.
equals
(
""
)){
actual_exo
=
new
Exercise
(
exercise_searched
,
description_str
,
break_time
,
"@drawable/developpe_couche_barre"
,
0
);
}
else
{
Integer
timer_int
=
Integer
.
parseInt
(
string_timer
);
actual_exo
=
new
Exercise
(
exercise_searched
,
description_str
,
break_time
,
"@drawable/developpe_couche_barre"
,
timer_int
);
}
addToProgram
(
actual_exo
,
new
ArrayList
<>(
current_days_checked
));
dialog
.
dismiss
();
// Effacer le champ de texte AutoCompleteTextView
input_exo
.
setText
(
""
);
}
else
{
Toast
.
makeText
(
ProgramCreationActivity
.
this
,
"Veuillez sélectionner au moins un jour !"
,
Toast
.
LENGTH_SHORT
).
show
();
}
addToProgram
(
actual_exo
,
new
ArrayList
<>(
current_days_checked
));
dialog
.
dismiss
();
});
// Effacer le champ de texte AutoCompleteTextView
input_exo
.
setText
(
""
);
}
});
}
...
...
@@ -305,44 +337,58 @@ public class ProgramCreationActivity extends AppCompatActivity {
if
(
buttonView
==
cb_lundi
)
{
if
(
current_days_checked
.
contains
(
"lundi"
)){
current_days_checked
.
remove
(
"lundi"
);
nbre_day
-=
1
;
}
else
{
current_days_checked
.
add
(
"lundi"
);
nbre_day
+=
1
;
}
}
else
if
(
buttonView
==
cb_mardi
)
{
if
(
current_days_checked
.
contains
(
"mardi"
)){
current_days_checked
.
remove
(
"mardi"
);
nbre_day
-=
1
;
}
else
{
current_days_checked
.
add
(
"mardi"
);
nbre_day
+=
1
;
}
}
else
if
(
buttonView
==
cb_mercredi
)
{
if
(
current_days_checked
.
contains
(
"mercredi"
)){
current_days_checked
.
remove
(
"mercredi"
);
nbre_day
-=
1
;
}
else
{
current_days_checked
.
add
(
"mercredi"
);
nbre_day
+=
1
;
}
}
else
if
(
buttonView
==
cb_jeudi
)
{
if
(
current_days_checked
.
contains
(
"jeudi"
)){
current_days_checked
.
remove
(
"jeudi"
);
nbre_day
-=
1
;
}
else
{
current_days_checked
.
add
(
"jeudi"
);
nbre_day
+=
1
;
}
}
else
if
(
buttonView
==
cb_vendredi
)
{
if
(
current_days_checked
.
contains
(
"vendredi"
)){
current_days_checked
.
remove
(
"vendredi"
);
nbre_day
-=
1
;
}
else
{
current_days_checked
.
add
(
"vendredi"
);
nbre_day
+=
1
;
}
}
else
if
(
buttonView
==
cb_samedi
)
{
if
(
current_days_checked
.
contains
(
"samedi"
)){
current_days_checked
.
remove
(
"samedi"
);
nbre_day
-=
1
;
}
else
{
current_days_checked
.
add
(
"samedi"
);
nbre_day
+=
1
;
}
}
else
if
(
buttonView
==
cb_dimanche
)
{
if
(
current_days_checked
.
contains
(
"dimanche"
)){
current_days_checked
.
remove
(
"dimanche"
);
nbre_day
-=
1
;
}
else
{
current_days_checked
.
add
(
"dimanche"
);
nbre_day
+=
1
;
}
//for (CheckBox cb : cb_list) if (!Objects.equals(cb, cb_dimanche)) cb.setChecked(false);
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
app/src/main/res/layout/modify_exercice_popup.xml
+
2
−
1
Voir le fichier @
13c6ae3b
...
...
@@ -179,7 +179,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"Pause"
android:text=
""
/>
android:text=
""
android:maxLines=
"5"
/>
<TextView
android:id=
"@+id/timer_text"
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter