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
212b8d32
authored
Dec 21, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on PCB issues2
parent
89bd9d4b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
16 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Picto.java
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictoItemViewGenerator.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/SerialActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/TapeAdapter.java
android/Pictogram/tabletlibrary/src/main/res/layout/activity_serial.xml
android/Pictogram/yotta_tablet/yotta_tablet.iml
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Picto.java
View file @
212b8d32
...
...
@@ -23,10 +23,17 @@ import org.json.JSONObject;
public
class
Picto
extends
Img
{
int
cont
=
0
;
Bitmap
bitmap
;
boolean
_disvanish
=
false
;
// String constant for logs
private
final
String
LOG_TAG
=
this
.
getClass
().
getSimpleName
();
// Or .getCanonicalName()
public
void
set_disvanish
(
boolean
_disvanish
)
{
this
.
_disvanish
=
_disvanish
;
}
public
boolean
disvanish
()
{
return
_disvanish
;
}
public
final
static
class
JSON_ATTTRS
{
public
static
String
CATEGORY
=
"id_cat"
;
public
static
String
COLUMN
=
"coord_x"
;
...
...
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
View file @
212b8d32
...
...
@@ -144,6 +144,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"
/>
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictoItemViewGenerator.java
View file @
212b8d32
...
...
@@ -6,7 +6,6 @@ import android.graphics.Canvas;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.PorterDuff
;
import
android.util.Log
;
import
android.util.TypedValue
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
...
...
@@ -31,6 +30,7 @@ public class PictoItemViewGenerator {
public
static
final
int
LAYOUT
=
R
.
layout
.
picto_grid_item
;
public
static
final
int
LAYOUT_BIG
=
R
.
layout
.
picto_grid_item_big
;
public
static
int
mirror_color
=
0
;
public
static
double
scale
=
1.0
;
/**
*
...
...
@@ -236,6 +236,9 @@ public class PictoItemViewGenerator {
pictoImage
.
setScaleY
(
scale
[
mirror_color
%
scale
.
length
]);
if
(
picto
.
is_highlight_background
())
layout
.
setBackgroundColor
(
color
[
mirror_color
%
color
.
length
]);
}
scale
=
picto
.
disvanish
()
?
scale
-
0.1
:
1.0
;
pictoImage
.
set
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
View file @
212b8d32
...
...
@@ -203,8 +203,8 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
" Delete item "
+
position
+
"("
+
PictogramActivity
.
this
.
tapeAdapter
.
getItem
(
position
).
get_translation
()
+
")"
);
PCBcontext
.
getActionLog
().
log
(
new
TalkAction
(
TalkAction
.
DELETE
,
PictogramActivity
.
this
.
tapeAdapter
.
getItem
(
position
)));
PictogramActivity
.
this
.
tapeAdapter
.
d
elete
Item
(
position
);
PictogramActivity
.
this
.
tapeAdapter
.
notifyDataSetChanged
(
);
PictogramActivity
.
this
.
tapeAdapter
.
d
isvanish
Item
(
position
);
execDeletePicto
(
PictogramActivity
.
this
.
tapeAdapter
,
position
);
}
});
...
...
@@ -764,7 +764,22 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
PictogramActivity
.
this
.
tts
.
play
(
p
.
get_translation
());
if
(
PictogramActivity
.
this
.
feedback_highlight
)
execHighligthFeeback
(
p
,
false
);
}
private
void
execDeletePicto
(
final
TapeAdapter
tapeAdapter
,
final
int
position
)
{
final
ScheduledThreadPoolExecutor
exec_delete
=
new
ScheduledThreadPoolExecutor
(
1
);
exec_delete
.
scheduleAtFixedRate
(
new
Runnable
()
{
int
repeating
=
0
;
@Override
public
void
run
()
{
tapeAdapter
.
notifyDataSetChanged
();
if
(
repeating
++
==
10
)
{
exec_delete
.
shutdown
();
tapeAdapter
.
getItem
(
position
).
set_disvanish
(
false
);
tapeAdapter
.
deleteItem
(
position
);
tapeAdapter
.
notifyDataSetChanged
();
}
}
},
0
,
100
,
TimeUnit
.
MILLISECONDS
);
}
private
void
execHighligthFeeback
(
final
Picto
picto
,
boolean
highlight_background
)
{
boolean
same_picto
=
false
;
picto
.
set_mirror
(
true
,
highlight_background
);
//comienza feedback
...
...
@@ -857,8 +872,10 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
void
onClick
(
View
arg0
)
{
LinkedList
<
Picto
>
lp
=
tapeAdapter
.
getAll
();
// This triggers the "Show" websocket action
PCBcontext
.
getActionLog
().
log
(
new
PictosAction
(
lp
));
tapeAdapter
.
ttsAllNew
(
tts
);
if
(
lp
.
size
()>
0
)
{
PCBcontext
.
getActionLog
().
log
(
new
PictosAction
(
lp
));
tapeAdapter
.
ttsAllNew
(
tts
);
}
}
}
...
...
@@ -1086,7 +1103,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override
public
boolean
dispatchTouchEvent
(
MotionEvent
event
)
{
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
())
if
(
PCBcontext
.
getPcbdb
()
!=
null
&&
PCBcontext
.
getPcbdb
()
.
getCurrentUser
().
is_supervisor
())
switch
(
event
.
getAction
())
{
case
MotionEvent
.
ACTION_DOWN
:
firstTouchX
=
event
.
getX
();
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/SerialActivity.java
View file @
212b8d32
...
...
@@ -21,7 +21,6 @@ import com.yottacode.pictogram.dao.User;
import
com.yottacode.pictogram.dao.UserLogin
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet
;
import
com.yottacode.pictogram.tools.Img
;
import
com.yottacode.pictogram.tools.PCBcontext
;
import
org.json.JSONException
;
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/TapeAdapter.java
View file @
212b8d32
...
...
@@ -52,6 +52,11 @@ public class TapeAdapter extends BaseAdapter {
pictoLinkedList
.
remove
(
position
);
}
// ELIMINAR ITEM DEL ADAPTADOR
public
void
disvanishItem
(
int
position
){
pictoLinkedList
.
get
(
position
).
set_disvanish
(
true
);
}
// ELIMINAR el último ITEM DEL ADAPTADOR
public
void
deleteLastView
(){
// Controlar excepcion al intentar eliminar el último cuando no hay elementos
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/activity_serial.xml
View file @
212b8d32
...
...
@@ -69,10 +69,10 @@
<LinearLayout
android:orientation=
"vertical"
android:layout_height=
"
350px
"
android:layout_height=
"
wrap_content
"
android:layout_marginStart=
"67dp"
android:background=
"@color/common_plus_signin_btn_text_dark_pressed"
android:layout_width=
"
400px
"
android:layout_width=
"
wrap_content
"
android:layout_alignParentBottom=
"true"
android:layout_alignParentStart=
"true"
android:id=
"@+id/stuLay"
>
...
...
@@ -99,12 +99,13 @@
<LinearLayout
android:orientation=
"vertical"
android:background=
"@color/common_google_signin_btn_text_dark_default"
android:layout_height=
"
350px
"
android:layout_width=
"
400px
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
wrap_content
"
android:layout_alignParentBottom=
"true"
android:layout_alignStart=
"@+id/entrar_button"
android:layout_marginStart=
"270dp"
android:id=
"@+id/supLay"
>
android:layout_toEndOf=
"@id/stuLay"
android:id=
"@+id/supLay"
android:gravity=
"right"
>
<TextView
android:layout_width=
"match_parent"
...
...
android/Pictogram/yotta_tablet/yotta_tablet.iml
View file @
212b8d32
...
...
@@ -122,7 +122,9 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/assets"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/builds"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/classes"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/dependency-cache"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars"
/>
...
...
@@ -135,11 +137,21 @@
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/incremental"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/incremental-classes"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/incremental-safeguard"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/incremental-verifier"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/instant-run-resources"
/>
<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/reload-dex"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/res"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/restart-dex"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/rs"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/shaders"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/symbols"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/transforms"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/outputs"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/tmp"
/>
</content>
...
...
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