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
795c4f46
Valider
795c4f46
rédigé
2 years ago
par
Arthur Schamroth
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
popup with exos for every day
parent
518f1fd7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!41
Arthur
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
app/src/main/java/be/lepl1509group13/workoutwarrior/ProgramDetailActivity.java
+32
-27
32 ajouts, 27 suppressions
...lepl1509group13/workoutwarrior/ProgramDetailActivity.java
avec
32 ajouts
et
27 suppressions
app/src/main/java/be/lepl1509group13/workoutwarrior/ProgramDetailActivity.java
+
32
−
27
Voir le fichier @
795c4f46
...
...
@@ -33,6 +33,7 @@ import java.io.IOException;
import
java.io.ObjectInputStream
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -51,6 +52,9 @@ public class ProgramDetailActivity extends AppCompatActivity implements ProgramA
private
Button
start_workout
,
delete_workout
,
show_workout
,
share_workout
;
private
boolean
isLocalProgram
=
false
;
private
String
[][]
exercisesData
=
null
;
private
String
[][]
exercices_data_all
=
null
;
int
total_Exercises
=
0
;
int
totalExercises
=
0
;
private
ArrayList
<
ArrayList
<
String
>>
allExercices
=
new
ArrayList
<
ArrayList
<
String
>>();
Map
<
String
,
ArrayList
<
Exercise
>>
all_ex_all_days
=
new
HashMap
<>();
String
program_name
=
""
;
...
...
@@ -186,19 +190,14 @@ public class ProgramDetailActivity extends AppCompatActivity implements ProgramA
closeButton
.
setOnClickListener
(
w
->
dialog
.
dismiss
());
ListView
listView
=
dialog
.
findViewById
(
R
.
id
.
list_exo_program
);
// Création tableau avec nom d'exo
String
[]
exo_name
=
new
String
[
exercisesData
.
length
];
for
(
int
i
=
0
;
i
<
exercisesData
.
length
;
i
++)
{
exo_name
[
i
]
=
exercisesData
[
i
][
0
];
}
String
[]
days_exos
=
new
String
[
exerci
s
es
D
ata
.
length
];
for
(
int
i
=
0
;
i
<
exerci
s
es
D
ata
.
length
;
i
++)
{
String
[]
days_exos
=
new
String
[
exerci
c
es
_d
ata
_all
.
length
];
for
(
int
i
=
0
;
i
<
exerci
c
es
_d
ata
_all
.
length
;
i
++)
{
String
globalString
=
""
;
for
(
String
key
:
all_ex_all_days
.
keySet
())
{
ArrayList
<
Exercise
>
values
=
all_ex_all_days
.
get
(
key
);
for
(
Exercise
ex
:
values
)
{
if
(
ex
.
name
.
equals
(
exerci
s
es
D
ata
[
i
][
0
]))
{
if
(
ex
.
name
.
equals
(
exerci
c
es
_d
ata
_all
[
i
][
0
]))
{
globalString
+=
key
+
", "
;
break
;
}
...
...
@@ -208,10 +207,16 @@ public class ProgramDetailActivity extends AppCompatActivity implements ProgramA
days_exos
[
i
]
=
globalString
;
}
// Création tableau avec nom d'exo
String
[]
exo_name
=
new
String
[
exercices_data_all
.
length
];
for
(
int
i
=
0
;
i
<
exercices_data_all
.
length
;
i
++)
{
exo_name
[
i
]
=
exercices_data_all
[
i
][
0
];
}
// Création tableau avec description d'exo
String
[]
exo_description
=
new
String
[
exerci
s
es
D
ata
.
length
];
for
(
int
i
=
0
;
i
<
exerci
s
es
D
ata
.
length
;
i
++)
{
exo_description
[
i
]
=
exerci
s
es
D
ata
[
i
][
1
];
String
[]
exo_description
=
new
String
[
exerci
c
es
_d
ata
_all
.
length
];
for
(
int
i
=
0
;
i
<
exerci
c
es
_d
ata
_all
.
length
;
i
++)
{
exo_description
[
i
]
=
exerci
c
es
_d
ata
_all
[
i
][
1
];
}
ArrayList
<
HashMap
<
String
,
String
>>
list
=
new
ArrayList
<>();
...
...
@@ -324,12 +329,6 @@ public class ProgramDetailActivity extends AppCompatActivity implements ProgramA
for
(
Map
.
Entry
<
String
,
ArrayList
<
Exercise
>>
set
:
entry
.
entrySet
())
{
for
(
Exercise
values
:
set
.
getValue
()){
String
customName
=
values
.
name
;
exo
.
add
(
customName
);
String
description
=
values
.
description
;
exo
.
add
(
description
);
}
String
dayOfTheWeek
=
new
SimpleDateFormat
(
"EEEE"
,
Locale
.
FRENCH
).
format
(
date
.
getTime
());
String
day
=
set
.
getKey
();
...
...
@@ -352,23 +351,29 @@ public class ProgramDetailActivity extends AppCompatActivity implements ProgramA
exercisesData
[
exerciseId
]
=
new
String
[]{
customName
,
description
,
image_url
,
String
.
valueOf
(
timer
)};
exerciseId
++;
}
RecyclerView
recyclerView
=
findViewById
(
R
.
id
.
program_view_recycler
);
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
ProgramDetailActivity
.
this
));
ProgramAdapter
adapter
=
new
ProgramAdapter
(
exercisesData
);
adapter
.
setOnItemClickListener
(
ProgramDetailActivity
.
this
);
recyclerView
.
setAdapter
(
adapter
);
}
}
boolean
axo_in_program
=
false
;
for
(
ArrayList
<
String
>
element
:
allExercices
)
{
if
(
element
.
equals
(
exo
))
{
axo_in_program
=
true
;
break
;
int
totalExercicesAll
=
0
;
for
(
Exercise
values
:
set
.
getValue
()){
totalExercicesAll
++;}
int
exercise_Id
=
0
;
if
(
exercise_Id
!=
totalExercicesAll
){
exercices_data_all
=
new
String
[
totalExercicesAll
][];
}
for
(
Exercise
values
:
set
.
getValue
()){
String
customName
=
values
.
name
;
String
description
=
values
.
description
;
String
image_url
=
values
.
image_url
;
Integer
timer
=
values
.
timer
;
exercices_data_all
[
exercise_Id
]
=
new
String
[]{
customName
,
description
,
image_url
,
String
.
valueOf
(
timer
)};
exercise_Id
++;
}
}
if
(!
axo_in_program
)
{
allExercices
.
add
(
exo
);
}
objectInputStream
.
close
();
fileInputStream
.
close
();
...
...
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