Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cfa43baf
authored
Mar 27, 2017
by
german
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Atributo lista de supervisores de user funcionando (Falta pasarlo para mostrarlo en la vista)
parent
c5510d07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
19 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
View file @
cfa43baf
...
...
@@ -85,18 +85,7 @@ public class StudentFragmentGrid extends Fragment{
startActivity
(
pictogramActivity
);
}
else
{
new_user
(
i
);
User
currentUser
=
PCBcontext
.
getPcbdb
().
getCurrentUser
();
Log
.
i
(
EditPictoActivity
.
DEBUG_MESSAGE
,
"Usuario: "
+
currentUser
.
get_name_stu
());
ArrayList
<
String
>
listaSup
=
download_supervisors
(
currentUser
.
get_id_stu
());
String
cadenaTotal
=
""
;
if
(
listaSup
.
isEmpty
())
Log
.
i
(
EditPictoActivity
.
DEBUG_MESSAGE
,
"Lista Vacia"
);
for
(
String
cadena:
listaSup
){
Log
.
i
(
EditPictoActivity
.
DEBUG_MESSAGE
,
"Cadena de array: "
+
cadena
);
cadenaTotal
+=
cadena
;
}
Log
.
i
(
EditPictoActivity
.
DEBUG_MESSAGE
,
"Cadena total: "
+
cadenaTotal
);
currentUser
.
set_Supervisors
(
cadenaTotal
);
Log
.
i
(
EditPictoActivity
.
DEBUG_MESSAGE
,
"Cadena: "
+
cadenaTotal
);
download_supervisors
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_id_stu
());
}
}
...
...
@@ -214,9 +203,8 @@ public class StudentFragmentGrid extends Fragment{
downloader
.
executeOnExecutor
(
AsyncTask
.
THREAD_POOL_EXECUTOR
,
imgs
);
}
private
ArrayList
<
String
>
download_supervisors
(
int
stu_id
)
{
private
void
download_supervisors
(
int
stu_id
)
{
String
token
=
getActivity
().
getIntent
().
getExtras
().
getString
(
"token"
);
final
ArrayList
<
String
>
datosSup
=
new
ArrayList
<>();
RestapiWrapper
wrapper
=
PCBcontext
.
getRestapiWrapper
();
wrapper
.
setToken
(
token
);
...
...
@@ -237,18 +225,17 @@ public class StudentFragmentGrid extends Fragment{
}
@Override
public
void
result
(
JSONArray
supervisors
)
{
String
supervisorsFormat
=
""
;
for
(
int
i
=
0
;
i
<
supervisors
.
length
();
i
++)
{
JSONObject
supervisor
;
String
datos
;
try
{
supervisor
=
supervisors
.
getJSONObject
(
i
);
datos
=
supervisor
.
get
(
"name"
)
+
" "
+
supervisor
.
get
(
"surname"
)
+
","
+
supervisor
.
get
(
"email"
)
+
";"
;
//Log.i(EditPictoActivity.DEBUG_MESSAGE,"Datos: "+datos);
datosSup
.
add
(
datos
);
supervisorsFormat
+=
supervisor
.
get
(
"name"
)
+
" "
+
supervisor
.
get
(
"surname"
)
+
","
+
supervisor
.
get
(
"email"
)
+
";"
;
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
}
PCBcontext
.
getPcbdb
().
getCurrentUser
().
set_Supervisors
(
supervisorsFormat
);
}
@Override
...
...
@@ -256,7 +243,6 @@ public class StudentFragmentGrid extends Fragment{
}
});
return
datosSup
;
}
private
void
download_students
(
int
sup_id
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment