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
d5dc05d9
authored
Aug 21, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on several issues
parent
12fa8213
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
21 deletions
android/Pictogram/commonlibrary/src/main/res/values-en/strings.xml
android/Pictogram/commonlibrary/src/main/res/values-es/strings.xml
android/Pictogram/commonlibrary/src/main/res/values/strings.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/CustomList.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
android/Pictogram/commonlibrary/src/main/res/values-en/strings.xml
View file @
d5dc05d9
...
@@ -47,6 +47,8 @@
...
@@ -47,6 +47,8 @@
<string
name=
"exitingApp"
>
Exiting the app
</string>
<string
name=
"exitingApp"
>
Exiting the app
</string>
<string
name=
"serverError"
>
There is a server error. Try again later
</string>
<string
name=
"serverError"
>
There is a server error. Try again later
</string>
<string
name=
"firstlogin"
>
Login by using your user and password. In other case, register as new user on the website
</string>
<string
name=
"firstlogin"
>
Login by using your user and password. In other case, register as new user on the website
</string>
<string
name=
"addStudent"
>
Add student
</string>
<string
name=
"getLicenseStudent"
>
Please, enter a student license
</string>
<!--Semantic grammar -->
<!--Semantic grammar -->
<string
name=
"loadingGrammar"
>
Please wait, loading vocabulary
</string>
<string
name=
"loadingGrammar"
>
Please wait, loading vocabulary
</string>
...
...
android/Pictogram/commonlibrary/src/main/res/values-es/strings.xml
View file @
d5dc05d9
...
@@ -49,7 +49,8 @@
...
@@ -49,7 +49,8 @@
<string
name=
"exitingApp"
>
Saliendo de la aplicación
</string>
<string
name=
"exitingApp"
>
Saliendo de la aplicación
</string>
<string
name=
"serverError"
>
Fallo accediendo al Servidor. Inténtelo más tarde
</string>
<string
name=
"serverError"
>
Fallo accediendo al Servidor. Inténtelo más tarde
</string>
<string
name=
"firstlogin"
>
Por favor, introduzca su usuario y clave, o bien registrese en
</string>
<string
name=
"firstlogin"
>
Por favor, introduzca su usuario y clave, o bien registrese en
</string>
<string
name=
"addStudent"
>
Añadir estudiante
</string>
<string
name=
"getLicenseStudent"
>
Por favor, introduzca el número de licencia del estudiante
</string>
<!--Semantic grammar -->
<!--Semantic grammar -->
<string
name=
"loadingGrammar"
>
Por favor espere, cargando vocabulario
</string>
<string
name=
"loadingGrammar"
>
Por favor espere, cargando vocabulario
</string>
...
...
android/Pictogram/commonlibrary/src/main/res/values/strings.xml
View file @
d5dc05d9
...
@@ -50,6 +50,9 @@
...
@@ -50,6 +50,9 @@
<string
name=
"exitingApp"
>
Saliendo de la aplicación
</string>
<string
name=
"exitingApp"
>
Saliendo de la aplicación
</string>
<string
name=
"serverError"
>
Error en el servidor de datos. Inténtelo más tarde
</string>
<string
name=
"serverError"
>
Error en el servidor de datos. Inténtelo más tarde
</string>
<string
name=
"firstlogin"
>
Por favor, introduzca su usuario y clave, o bien registrese en
</string>
<string
name=
"firstlogin"
>
Por favor, introduzca su usuario y clave, o bien registrese en
</string>
<string
name=
"addStudent"
>
Añadir estudiante
</string>
<string
name=
"getLicenseStudent"
>
Por favor, introduzca el número de licencia del estudiante
</string>
<!--Semantic grammar -->
<!--Semantic grammar -->
<string
name=
"loadingGrammar"
>
Please wait, loading vocabulary
</string>
<string
name=
"loadingGrammar"
>
Please wait, loading vocabulary
</string>
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/CustomList.java
View file @
d5dc05d9
...
@@ -74,7 +74,7 @@ public class CustomList extends ArrayAdapter<String>{
...
@@ -74,7 +74,7 @@ public class CustomList extends ArrayAdapter<String>{
//}
//}
//imageView.setImageResource(R.drawable.user);
//imageView.setImageResource(R.drawable.user);
if
(
images
.
size
()>
0
){
if
(
images
.
elementAt
(
position
)!=
null
){
imageView
.
setImageBitmap
(
images
.
elementAt
(
position
));
imageView
.
setImageBitmap
(
images
.
elementAt
(
position
));
}
else
{
}
else
{
imageView
.
setImageResource
(
R
.
drawable
.
anonymous_student
);
imageView
.
setImageResource
(
R
.
drawable
.
anonymous_student
);
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/StudentFragmentGrid.java
View file @
d5dc05d9
package
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
;
package
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
;
import
android.app.AlertDialog
;
import
android.app.Fragment
;
import
android.app.Fragment
;
import
android.app.ProgressDialog
;
import
android.app.ProgressDialog
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.os.AsyncTask
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.EditText
;
import
android.widget.GridView
;
import
android.widget.GridView
;
import
com.yottacode.net.RestapiWrapper
;
import
com.yottacode.net.RestapiWrapper
;
...
@@ -83,11 +87,37 @@ public class StudentFragmentGrid extends Fragment{
...
@@ -83,11 +87,37 @@ public class StudentFragmentGrid extends Fragment{
Intent
pictogramActivity
=
new
Intent
(
getActivity
(),
VOCA
.
class
);
Intent
pictogramActivity
=
new
Intent
(
getActivity
(),
VOCA
.
class
);
startActivity
(
pictogramActivity
);
startActivity
(
pictogramActivity
);
}
else
{
}
else
{
new_user
(
i
);
if
(
this
.
nameStudents
[
i
].
equals
(
getString
(
R
.
string
.
addStudent
)))
download_supervisors
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_id_stu
());
register_student
();
else
{
new_user
(
i
);
download_supervisors
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_id_stu
());
}
}
}
}
}
private
void
register_student
()
{
AlertDialog
.
Builder
alert
=
new
AlertDialog
.
Builder
(
this
.
getActivity
());
final
EditText
edittext
=
new
EditText
(
this
.
getActivity
());
alert
.
setMessage
(
getString
(
R
.
string
.
getLicenseStudent
));
alert
.
setTitle
(
getString
(
R
.
string
.
addStudent
));
alert
.
setView
(
edittext
);
alert
.
setPositiveButton
(
"Ok"
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
//What ever you want to do with the value
String
license
=
edittext
.
getText
().
toString
();
}
});
alert
.
setNegativeButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
// what ever you want to do with No option.
}
});
alert
.
show
();
}
private
void
new_user
(
int
i
)
{
private
void
new_user
(
int
i
)
{
JSONObject
st
=
this
.
downloaded_students
.
get
(
i
);
JSONObject
st
=
this
.
downloaded_students
.
get
(
i
);
...
@@ -145,10 +175,11 @@ public class StudentFragmentGrid extends Fragment{
...
@@ -145,10 +175,11 @@ public class StudentFragmentGrid extends Fragment{
}
}
}
}
private
void
show_student_list_online
()
{
private
void
show_student_list_online
()
{
final
Vector
<
Img
>
imgs
=
new
Vector
<>(
downloaded_students
.
size
());
int
listsize
=
downloaded_students
.
size
()+
1
;
this
.
nameStudents
=
new
String
[
downloaded_students
.
size
()];
final
Vector
<
Img
>
imgs
=
new
Vector
<>(
listsize
);
this
.
idStudents
=
new
Vector
<>(
downloaded_students
.
size
());
this
.
nameStudents
=
new
String
[
listsize
];
this
.
imageStudents
=
new
Vector
<>(
downloaded_students
.
size
());
this
.
idStudents
=
new
Vector
<>(
listsize
);
this
.
imageStudents
=
new
Vector
<>(
listsize
);
for
(
int
i
=
0
;
i
<
downloaded_students
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
downloaded_students
.
size
();
i
++)
{
JSONObject
st
;
JSONObject
st
;
...
@@ -168,6 +199,10 @@ public class StudentFragmentGrid extends Fragment{
...
@@ -168,6 +199,10 @@ public class StudentFragmentGrid extends Fragment{
}
}
}
//for
}
//for
nameStudents
[
listsize
-
1
]=
getString
(
R
.
string
.
addStudent
);
idStudents
.
add
(-
1
);
imgs
.
add
(
new
Img
(-
1
,
null
,
Img
.
STUDENT
));
//it's required to download student's images
progressDialog
=
ProgressDialog
.
show
(
getActivity
(),
getString
(
R
.
string
.
imguserLoadingMsg
),
progressDialog
=
ProgressDialog
.
show
(
getActivity
(),
getString
(
R
.
string
.
imguserLoadingMsg
),
getString
(
R
.
string
.
userLoadingTxt
),
false
,
false
);
getString
(
R
.
string
.
userLoadingTxt
),
false
,
false
);
ImgDownloader
downloader
=
new
ImgDownloader
(
getActivity
(),
new
ImgDownloader
.
iImgDownloaderListener
()
{
ImgDownloader
downloader
=
new
ImgDownloader
(
getActivity
(),
new
ImgDownloader
.
iImgDownloaderListener
()
{
...
@@ -314,19 +349,7 @@ public class StudentFragmentGrid extends Fragment{
...
@@ -314,19 +349,7 @@ public class StudentFragmentGrid extends Fragment{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
switch
(
students
.
length
())
{
show_student_list_online
();
case
0
:
GUITools
.
show_alert
(
getActivity
(),
R
.
string
.
loginErrorTxt
,
getString
(
R
.
string
.
noStudentsError
),
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
PCBcontext
.
getNetService
().
restart_app
(
true
);
}
});
break
;
default
:
show_student_list_online
();
}
}
}
@Override
@Override
public
void
result
(
JSONObject
result
)
{
public
void
result
(
JSONObject
result
)
{
...
...
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