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
77ae9311
authored
Apr 06, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
workin on issue
#141
parent
ae3d9e03
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
77ae9311
...
@@ -78,6 +78,7 @@ public class Vocabulary implements Iterable<Picto> {
...
@@ -78,6 +78,7 @@ public class Vocabulary implements Iterable<Picto> {
modifyAttsPicto
(
picto_cat
,
picto_id
,
args
.
getJSONObject
(
"attributes"
));
modifyAttsPicto
(
picto_cat
,
picto_id
,
args
.
getJSONObject
(
"attributes"
));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
Log
.
e
(
LOG_TAG
,
e
.
getMessage
());
}
}
break
;
break
;
}
}
...
@@ -134,6 +135,7 @@ public class Vocabulary implements Iterable<Picto> {
...
@@ -134,6 +135,7 @@ public class Vocabulary implements Iterable<Picto> {
private
boolean
synchronize_upload
()
{
private
boolean
synchronize_upload
()
{
boolean
upload_pending
=
false
;
boolean
upload_pending
=
false
;
try
{
try
{
this
.
pictos
.
clear
();
PCBcontext
.
getPcbdb
().
getStudentVocabulary
(
this
);
PCBcontext
.
getPcbdb
().
getStudentVocabulary
(
this
);
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
Log
.
e
(
this
.
getClass
().
getName
(),
" Picto json error from local storage: "
+
e
.
getMessage
());
Log
.
e
(
this
.
getClass
().
getName
(),
" Picto json error from local storage: "
+
e
.
getMessage
());
...
@@ -252,7 +254,7 @@ public class Vocabulary implements Iterable<Picto> {
...
@@ -252,7 +254,7 @@ public class Vocabulary implements Iterable<Picto> {
pictos_cat
=
new
LinkedList
<>();
pictos_cat
=
new
LinkedList
<>();
pictos
.
put
(
new
Integer
(
picto
.
get_category
()),
pictos_cat
);
pictos
.
put
(
new
Integer
(
picto
.
get_category
()),
pictos_cat
);
}
}
pictos_cat
.
add
(
picto
);
imgs
.
add
(
new
Img
(
picto
.
get_id
(),
picto
.
get_url
(),
Img
.
VOCABULARY
));
imgs
.
add
(
new
Img
(
picto
.
get_id
(),
picto
.
get_url
(),
Img
.
VOCABULARY
));
}
}
Log
.
d
(
this
.
getClass
().
getName
(),
"Vocabulary size: "
+
updated_collection
.
length
);
Log
.
d
(
this
.
getClass
().
getName
(),
"Vocabulary size: "
+
updated_collection
.
length
);
...
@@ -393,13 +395,14 @@ public class Vocabulary implements Iterable<Picto> {
...
@@ -393,13 +395,14 @@ public class Vocabulary implements Iterable<Picto> {
return
this
.
pictos
.
get
(
new
Integer
(
Picto
.
NO_CATEGORY
));
return
this
.
pictos
.
get
(
new
Integer
(
Picto
.
NO_CATEGORY
));
}
else
{
}
else
{
LinkedList
<
Picto
>
freePictos
=
new
LinkedList
<>();
LinkedList
<
Picto
>
freePictos
=
new
LinkedList
<>();
for
(
LinkedList
<
Picto
>
category
:
pictos
.
values
())
{
LinkedList
<
Picto
>
category
=
pictos
.
get
(
new
Integer
(
Picto
.
NO_CATEGORY
));
for
(
Picto
picto
:
category
)
{
//for (Picto picto : category) {
for
(
Picto
picto:
category
)
{
if
(
picto
.
getFreeRow
()
!=
-
1
&&
picto
.
getFreeColumn
()
!=
-
1
)
{
if
(
picto
.
getFreeRow
()
!=
-
1
&&
picto
.
getFreeColumn
()
!=
-
1
)
{
freePictos
.
add
(
picto
);
freePictos
.
add
(
picto
);
}
}
}
}
}
return
freePictos
;
return
freePictos
;
}
}
}
}
...
...
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