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
74042fef
authored
Dec 13, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #630 solved
parent
59a02fe5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
46 deletions
android/Pictogram/commonlibrary/build.gradle
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
android/Pictogram/yotta_tablet/src/main/assets/core_vocabulary/56366.png
android/Pictogram/yotta_tablet/yotta_tablet.iml
android/Pictogram/commonlibrary/build.gradle
View file @
74042fef
...
...
@@ -16,18 +16,18 @@ android {
release
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
resValue
"string"
,
"server"
,
"https://p
re
.yottacode.com"
resValue
"string"
,
"server"
,
"https://p
ictogram
.yottacode.com"
resValue
"bool"
,
"force_db_create"
,
"false"
resValue
"bool"
,
"ssl_connect"
,
"true"
resValue
"bool"
,
"force_img_download"
,
"false"
resValue
"integer"
,
"netservice_timing"
,
"
20
"
resValue
"integer"
,
"netservice_timing"
,
"
5
"
}
debug
{
resValue
"string"
,
"server"
,
"https://dev.yottacode.com"
resValue
"bool"
,
"force_db_create"
,
"false"
resValue
"bool"
,
"ssl_connect"
,
"false"
resValue
"bool"
,
"force_img_download"
,
"false"
resValue
"integer"
,
"netservice_timing"
,
"
20
"
resValue
"integer"
,
"netservice_timing"
,
"
5
"
}
}
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
View file @
74042fef
...
...
@@ -105,6 +105,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener {
int
maxColumns
,
maxRows
,
maxInTape
;
ScheduledThreadPoolExecutor
exec_mirror
=
null
;
Picto
prev_picto
=
null
;
private
boolean
feedback_read
;
private
boolean
feedback_highlight
;
...
...
@@ -127,36 +128,13 @@ public class PictogramActivity extends Activity implements iVocabularyListener {
this
.
vocabulary
=
PCBcontext
.
getVocabulary
();
this
.
vocabulary
.
listen
(
PCBcontext
.
getRoom
(),
this
,
new
iActionListener
()
{
Picto
prev
=
null
;
@Override
public
void
action
(
action
action
,
int
picto_cat
,
int
picto_id
)
{
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
action
+
" from "
+
picto_cat
+
","
+
picto_id
+
" catched"
);
final
Picto
picto
=
vocabulary
.
get_picto
(
picto_cat
,
picto_id
);
picto
.
set_mirror
(
true
);
if
(
exec_mirror
!=
null
)
{
exec_mirror
.
shutdown
();
exec_mirror
=
null
;
prev
.
set_mirror
(
false
);
}
exec_mirror
=
new
ScheduledThreadPoolExecutor
(
1
);
prev
=
picto
;
exec_mirror
.
scheduleAtFixedRate
(
new
Runnable
()
{
int
repeating
=
0
;
@Override
public
void
run
()
{
refresh
();
if
(
repeating
++==
20
)
{
picto
.
set_mirror
(
false
);
if
(
exec_mirror
!=
null
)
{
exec_mirror
.
shutdown
();
exec_mirror
=
null
;
}
}
}
},
0
,
500
,
TimeUnit
.
MILLISECONDS
);
}
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
action
+
" from "
+
picto_cat
+
","
+
picto_id
+
" catched"
);
Picto
picto
=
vocabulary
.
get_picto
(
picto_cat
,
picto_id
);
PictogramActivity
.
this
.
execHighligthFeeback
(
picto
);
}
);
}
);
this
.
vocabulary
.
setImgDownloaderListener
(
new
iImgDownloaderListener
()
{
@Override
public
void
loadComplete
()
{
...
...
@@ -486,11 +464,13 @@ public class PictogramActivity extends Activity implements iVocabularyListener {
for
(
Picto
p
:
list
)
{
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
has_categories
())
{
if
(
p
.
get_column
()
!=
-
1
&&
p
.
get_row
()
!=
-
1
)
{
if
(
p
.
get_column
()
!=
-
1
&&
p
.
get_row
()
!=
-
1
&&
p
.
get_column
()
<
maxRows
&&
p
.
get_row
()
<
maxColumns
)
{
mp
[
p
.
get_column
()][
p
.
get_row
()]
=
p
;
}
}
else
{
if
(
p
.
getFreeColumn
()
!=
-
1
&&
p
.
getFreeRow
()
!=
-
1
)
{
if
(
p
.
getFreeColumn
()
!=
-
1
&&
p
.
getFreeRow
()
!=
-
1
&&
p
.
get_column
()
<
maxRows
&&
p
.
get_row
()
<
maxColumns
)
{
mp
[
p
.
getFreeColumn
()][
p
.
getFreeRow
()]
=
p
;
}
}
...
...
@@ -778,24 +758,41 @@ public class PictogramActivity extends Activity implements iVocabularyListener {
}
private
void
execHighligthFeeback
(
final
Picto
picto
)
{
final
ScheduledThreadPoolExecutor
exec_HighligthFeeback
=
new
ScheduledThreadPoolExecutor
(
1
);
picto
.
set_mirror
(
true
);
exec_HighligthFeeback
.
scheduleAtFixedRate
(
new
Runnable
()
{
int
repeating
=
0
;
@Override
public
void
run
()
{
refresh
();
if
(
repeating
++==
5
)
{
picto
.
set_mirror
(
false
);
if
(
exec_mirror
!=
null
)
{
exec_mirror
.
shutdown
();
exec_mirror
=
null
;
boolean
same_picto
=
false
;
picto
.
set_mirror
(
true
);
//comienza feedback
if
(
exec_mirror
!=
null
)
{
//se cancela ejecución del feedbcack anterior, si lo hay
exec_mirror
.
shutdown
();
exec_mirror
=
null
;
}
if
(
prev_picto
!=
null
)
{
//se cancela marca de feedback del anterior, si lo hay
prev_picto
.
set_mirror
(
false
);
same_picto
=
prev_picto
==
picto
;
}
if
(
same_picto
)
prev_picto
=
null
;
//por si se pulsaa el mismo boton varias veces
else
{
prev_picto
=
picto
;
exec_mirror
=
new
ScheduledThreadPoolExecutor
(
1
);
prev_picto
=
picto
;
exec_mirror
.
scheduleAtFixedRate
(
new
Runnable
()
{
int
repeating
=
0
;
@Override
public
void
run
()
{
refresh
();
if
(
repeating
++
==
20
)
{
picto
.
set_mirror
(
false
);
if
(
exec_mirror
!=
null
)
{
exec_mirror
.
shutdown
();
exec_mirror
=
null
;
}
}
}
}
}
,
0
,
500
,
TimeUnit
.
MILLISECONDS
);
}
,
0
,
500
,
TimeUnit
.
MILLISECONDS
);
}
}
/**
* Class used for long pressing on pictos (start drag)
*/
...
...
android/Pictogram/yotta_tablet/src/main/assets/core_vocabulary/56366.png
deleted
100644 → 0
View file @
59a02fe5
8.64 KB
android/Pictogram/yotta_tablet/yotta_tablet.iml
View file @
74042fef
...
...
@@ -145,6 +145,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/instant-run-support"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/jniLibs"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/manifests"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/pre-dexed"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/reload-dex"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/res"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/restart-dex"
/>
...
...
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