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
faf359be
authored
Feb 03, 2016
by
Miguel Ángel García Cumbreras
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Varios bugs solucionados
parent
6383f43e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
152 additions
and
78 deletions
android/.idea/workspace.xml
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/LoginActivity.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/MainActivity.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/PictogramActivity.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/SerialActivity.java
android/Pictogram/app/src/main/res/drawable-hdpi/back64.png
android/Pictogram/app/src/main/res/drawable-hdpi/play64.png
android/Pictogram/app/src/main/res/layout/activity_pictogram.xml
android/.idea/workspace.xml
View file @
faf359be
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"10daeba4-0692-476d-a3da-642b4123cfdd"
name=
"Default"
comment=
""
>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/.idea/android.iml"
afterPath=
"$PROJECT_DIR$/.idea/android.iml"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
</list>
<list
default=
"true"
id=
"10daeba4-0692-476d-a3da-642b4123cfdd"
name=
"Default"
comment=
""
/>
<ignored
path=
"android.iws"
/>
<ignored
path=
".idea/workspace.xml"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
...
...
@@ -42,10 +39,10 @@
<order
/>
</component>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"
-9
"
/>
<option
name=
"y"
value=
"
-9
"
/>
<option
name=
"width"
value=
"1
938
"
/>
<option
name=
"height"
value=
"
1170
"
/>
<option
name=
"x"
value=
"
43
"
/>
<option
name=
"y"
value=
"
23
"
/>
<option
name=
"width"
value=
"1
397
"
/>
<option
name=
"height"
value=
"
877
"
/>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
>
<OptionsSetting
value=
"true"
id=
"Add"
/>
...
...
@@ -73,12 +70,16 @@
<sortByType
/>
</navigator>
<panes>
<pane
id=
"PackagesPane"
/>
<pane
id=
"AndroidView"
>
<pane
id=
"PackagesPane"
>
<subPane
/>
</pane>
<pane
id=
"Scope"
/>
<pane
id=
"Scratches"
/>
<pane
id=
"AndroidView"
>
<subPane
/>
</pane>
<pane
id=
"Scope"
>
<subPane
subId=
"Project Files"
/>
</pane>
<pane
id=
"ProjectPane"
>
<subPane>
<PATH>
...
...
@@ -87,30 +88,6 @@
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode"
/>
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"android"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode"
/>
</PATH_ELEMENT>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"android"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode"
/>
</PATH_ELEMENT>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"Pictogrammar"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode"
/>
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"android"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode"
/>
</PATH_ELEMENT>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"android"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode"
/>
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
...
...
@@ -291,39 +268,39 @@
<servers
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"
-9"
y=
"-9"
width=
"1938"
height=
"1170
"
extended-state=
"0"
/>
<frame
x=
"
43"
y=
"23"
width=
"1397"
height=
"877
"
extended-state=
"0"
/>
<editor
active=
"false"
/>
<layout>
<window_info
id=
"Palette	"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Designer"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Android Model"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Analysis"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Analysis"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Android Monitor"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Captures"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Event Log"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Tool"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Build Variants"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"-1"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Capture Tool"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"TODO"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"6"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.2
49446
5"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Maven Projects"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Application Servers"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Project"
active=
"true"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
weight=
"0.17524116"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Project"
active=
"true"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
weight=
"0.17490774"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Changes"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Ant Build"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Android Monitor"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Gradle Console"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Build Variants"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Hierarchy"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Memory Monitor"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Palette"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Message"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"An
t Build"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"fals
e"
content_ui=
"tabs"
/>
<window_info
id=
"An
droid Model"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"4"
side_tool=
"tru
e"
content_ui=
"tabs"
/>
<window_info
id=
"Find"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Captures"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.4"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Gradle Console"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Commander"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"SLIDING"
type=
"SLIDING"
visible=
"false"
weight=
"0.4"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Hierarchy"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Inspection"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.4"
sideWeight=
"0.5"
order=
"5"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Memory Monitor"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
</layout>
</component>
<component
name=
"Vcs.Log.UiProperties"
>
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/LoginActivity.java
View file @
faf359be
...
...
@@ -51,6 +51,7 @@ public class LoginActivity extends FragmentActivity implements iRestapiListener,
private
static
final
String
TAG_PIC
=
"pic"
;
private
static
final
String
TAG_LANG
=
"lang"
;
private
static
final
String
TAG_ATTRIBUTES
=
"attributes"
;
private
static
final
String
TAG_SUPERVISION
=
"supervision"
;
private
int
sup_id
;
...
...
@@ -153,6 +154,7 @@ public class LoginActivity extends FragmentActivity implements iRestapiListener,
public
void
result
(
JSONArray
students_supervisors
)
{
//FERNANDO
try
{
// Saco los pares estudiante-supervisor
//Log.d(LOG_TAG, "JSON:"+students_supervisors);
Log
.
d
(
LOG_TAG
,
"students_supervisors size:"
+
students_supervisors
.
length
());
// looping through All Students
Vector
<
User
>
users
=
new
Vector
<
User
>(
students_supervisors
.
length
());
...
...
@@ -189,15 +191,19 @@ public class LoginActivity extends FragmentActivity implements iRestapiListener,
String
st_lang
=
st
.
getString
(
TAG_LANG
);
//st_lang = "es-es";
String
st_attributes
=
st
.
getString
(
TAG_ATTRIBUTES
);
Integer
st_supervision
=
st
.
getInt
(
TAG_SUPERVISION
);
//Log.d(LOG_TAG, "student pic:" + st_pic);
// Añado un par <student-supervisor>
int
st_id_int
=
st_id
.
intValue
();
int
st_supervision_int
=
st_supervision
.
intValue
();
if
(
st_supervision_int
==
2
){
student
=
new
User
(
st_id_int
,
st_name
,
st_surname
,
st_pic
,
st_gender
,
st_lang
,
st_attributes
,
sup_id
,
""
,
""
,
""
,
"M"
,
"es-es"
,
""
);
users
.
add
(
student
);
}
}
// Si sólo hay 1 estudiante, cargo el st_id
if
(
students_supervisors
.
length
()
==
1
){
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/MainActivity.java
View file @
faf359be
...
...
@@ -15,11 +15,16 @@ import android.widget.Toast;
import
com.yottacode.pictogram.R
;
import
com.yottacode.pictogram.dao.Device
;
import
com.yottacode.pictogram.dao.PCBDBHelper
;
import
com.yottacode.pictogram.dao.User
;
import
com.yottacode.pictogram.tools.PCBcontext
;
import
org.json.JSONException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Vector
;
public
class
MainActivity
extends
Activity
{
...
...
@@ -35,28 +40,13 @@ public class MainActivity extends Activity {
// For deactivating the lock screen (just before setContentView)
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DISMISS_KEYGUARD
);
// Singleton getInstance and initialization passing the Context (to create the device)
//PCBcontext pcb = PCBcontext.getInstance();
PCBcontext
.
init
(
this
);
Log
.
d
(
LOG_TAG
,
"PCBcontext iniciado"
);
Log
.
d
(
LOG_TAG
,
"PCBcontext iniciado
.
"
);
// Nota magc: al pasar ya siempre por serial no tiene sentido tener main ¿no?
//if (1==0){ // Fuerzo a que entre en serialActivity
Intent
serialActivity
=
new
Intent
(
this
,
SerialActivity
.
class
);
startActivity
(
serialActivity
);
/*
if (token==null || token.isEmpty()){
Intent serialActivity = new Intent(this, SerialActivity.class);
startActivity(serialActivity);
} else{
Log.d(LOG_TAG, "token leido:" + token);
Intent loginActivity = new Intent(this, LoginActivity.class);
startActivity(loginActivity);
Intent pictogramActivity = new Intent(this, PictogramActivity.class);
startActivity(pictogramActivity);
}
*/
}
@Override
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/PictogramActivity.java
View file @
faf359be
...
...
@@ -19,6 +19,7 @@ import android.util.Log;
import
android.view.Display
;
import
android.view.DragEvent
;
import
android.view.KeyEvent
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.Window
;
...
...
@@ -78,6 +79,12 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
// String constant for logs
private
final
String
LOG_TAG
=
this
.
getClass
().
getSimpleName
();
// Or .getCanonicalName()
float
xAxis
=
0
f
;
float
yAxis
=
0
f
;
float
lastXAxis
=
0
f
;
float
lastYAxis
=
0
f
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -130,6 +137,43 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
tapeGridView
.
getLayoutParams
().
width
=
width
-
120
;
tapeGridView
.
requestLayout
();
tapeGridView
.
setOnTouchListener
(
new
View
.
OnTouchListener
()
{
@Override
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
final
int
actionPeformed
=
event
.
getAction
();
switch
(
actionPeformed
)
{
case
MotionEvent
.
ACTION_DOWN
:
{
final
float
x
=
event
.
getX
();
final
float
y
=
event
.
getY
();
lastXAxis
=
x
;
lastYAxis
=
y
;
Log
.
d
(
LOG_TAG
,
"TOUCH X:"
+
Float
.
toString
(
lastXAxis
));
Log
.
d
(
LOG_TAG
,
"TOUCH Y:"
+
Float
.
toString
(
lastYAxis
));
break
;
}
case
MotionEvent
.
ACTION_MOVE
:
{
final
float
x
=
event
.
getX
();
final
float
y
=
event
.
getY
();
final
float
dx
=
x
-
lastXAxis
;
final
float
dy
=
y
-
lastYAxis
;
xAxis
+=
dx
;
yAxis
+=
dy
;
Log
.
d
(
LOG_TAG
,
"MOVE X:"
+
Float
.
toString
(
xAxis
));
Log
.
d
(
LOG_TAG
,
"MOVE Y:"
+
Float
.
toString
(
yAxis
));
break
;
}
}
return
true
;
}
});
final
GridView
panelGridView
=
(
GridView
)
findViewById
(
R
.
id
.
panel_grid_view
);
final
ImageButton
deleteButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
button_delete
);
//final Button deleteAllButton = (Button) findViewById(R.id.button_delete_all);
...
...
@@ -167,6 +211,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
//rowNumberAdapter.notifyDataSetChanged();
Picto
p
=
panelAdapter
.
getItem
(
position
);
if
(
p
!=
null
&&
!
p
.
is_invisible
()
&&
p
.
is_enabled
()){
Log
.
d
(
LOG_TAG
,
"Clic en picto: "
+
p
.
toString
());
//Log.d(LOG_TAG, "STATUS: " + p.get_status());
...
...
@@ -228,6 +273,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
}
}
}
}
});
// onLongClick picto del panelGridView (para empezar a arrastrarlo hacia el tape)
...
...
@@ -297,6 +343,11 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
tapeAdapter
.
deleteAll
();
tapeAdapter
.
notifyDataSetChanged
();
panelAdapter
.
setColor
(
Color
.
parseColor
(
"#AFAFAF"
));
RelativeLayout
rl
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
pictogramLayout
);
rl
.
setBackgroundColor
(
Color
.
parseColor
(
"#BDBDBD"
));
// Load the categories
load_pictos
(
arg0
);
}
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/SerialActivity.java
View file @
faf359be
...
...
@@ -6,6 +6,7 @@ import android.app.ProgressDialog;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.net.ConnectivityManager
;
import
android.net.NetworkInfo
;
...
...
@@ -80,10 +81,13 @@ public class SerialActivity extends Activity implements iRestapiListener, iImgDo
private
final
String
LOG_TAG
=
this
.
getClass
().
getSimpleName
();
// Or .getCanonicalName()
private
String
username
=
null
;
private
String
password
=
null
;
//A ProgressDialog object
private
ProgressDialog
progressDialog
;
public
static
final
String
PREFS_NAME
=
"MyPrefsFile"
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -93,6 +97,13 @@ public class SerialActivity extends Activity implements iRestapiListener, iImgDo
mSerialViewMail
=
(
EditText
)
findViewById
(
R
.
id
.
serialmail
);
mSerialViewPass
=
(
EditText
)
findViewById
(
R
.
id
.
serialpass
);
SharedPreferences
settings
=
getSharedPreferences
(
PREFS_NAME
,
0
);
username
=
settings
.
getString
(
"username"
,
""
);
password
=
settings
.
getString
(
"password"
,
""
);
// Escribo los últimos valores indicados
mSerialViewMail
.
setText
(
username
);
//mSerialViewPass.setText(password);
// NOTA: si el Mail es un mail, es un supervisor...si no es un estudiante
context
=
this
;
...
...
@@ -103,6 +114,40 @@ public class SerialActivity extends Activity implements iRestapiListener, iImgDo
SSLDummyContext
.
init
(
getResources
().
getBoolean
(
R
.
bool
.
ssl_connect
));
PCBcontext
.
init
(
this
);
Log
.
d
(
LOG_TAG
,
"PCBcontext iniciado"
);
//if (PCBcontext.getDevice().getLastStuId() != 0) {
if
(!
username
.
equals
(
""
)
&&
!
password
.
equals
(
""
)){
// Tengo usuario, sigo con este usuario
RestapiWrapper
wrapper
=
PCBcontext
.
getRestapiWrapper
();
if
(
username
.
contains
(
"@"
)){
// Es un supervisor
String
operation
=
"sup/login"
;
Hashtable
<
String
,
String
>
postDataParams
=
new
Hashtable
<
String
,
String
>();
postDataParams
.
put
(
"email"
,
username
);
postDataParams
.
put
(
"password"
,
password
);
/*
postDataParams.put("idFirmware", _ANDROIDID);
postDataParams.put("desc", _MODEL);
postDataParams.put("serial", serial);
*/
wrapper
.
ask
(
operation
,
postDataParams
,
"post"
,
(
iRestapiListener
)
context
);
}
else
{
// Es un estudiante
Log
.
d
(
LOG_TAG
,
"Entro con usuario y password"
);
String
operation
=
"stu/login"
;
Hashtable
<
String
,
String
>
postDataParams
=
new
Hashtable
<
String
,
String
>();
postDataParams
.
put
(
"username"
,
username
);
postDataParams
.
put
(
"password"
,
password
);
/*
postDataParams.put("idFirmware", _ANDROIDID);
postDataParams.put("desc", _MODEL);
postDataParams.put("serial", serial);
*/
wrapper
.
ask
(
operation
,
postDataParams
,
"post"
,
(
iRestapiListener
)
context
);
}
}
else
{
// Compruebo si tengo acceso a internet
//modificación FERNANDO
if
(!
RestapiWrapper
.
ping
(
context
.
getResources
().
getString
(
R
.
string
.
server
),
"server/ping"
,
this
))
{
...
...
@@ -126,15 +171,21 @@ public class SerialActivity extends Activity implements iRestapiListener, iImgDo
mEntrarButton
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
username
=
mSerialViewMail
.
getText
().
toString
();
String
username
=
mSerialViewMail
.
getText
().
toString
();
String
password
=
mSerialViewPass
.
getText
().
toString
();
// DE PRUEBA
// Alumno
//
username = "faf0001";
//
password = "faf0001";
username
=
"faf0001"
;
password
=
"faf0001"
;
// Supervisor
username
=
"dofer@ujaen.es"
;
password
=
"dofer"
;
//username = "dofer@ujaen.es";
//password = "dofer";
SharedPreferences
settings
=
getSharedPreferences
(
PREFS_NAME
,
0
);
SharedPreferences
.
Editor
editor
=
settings
.
edit
();
editor
.
putString
(
"username"
,
username
);
editor
.
putString
(
"password"
,
password
);
editor
.
commit
();
RestapiWrapper
wrapper
=
PCBcontext
.
getRestapiWrapper
();
if
(
username
.
contains
(
"@"
)){
...
...
@@ -168,6 +219,7 @@ public class SerialActivity extends Activity implements iRestapiListener, iImgDo
});
}
}
}
@Override
public
void
preExecute
(){
...
...
android/Pictogram/app/src/main/res/drawable-hdpi/back64.png
0 → 100644
View file @
faf359be
1.62 KB
android/Pictogram/app/src/main/res/drawable-hdpi/play64.png
0 → 100644
View file @
faf359be
1.29 KB
android/Pictogram/app/src/main/res/layout/activity_pictogram.xml
View file @
faf359be
...
...
@@ -3,7 +3,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingLeft=
"10dp"
android:paddingRight=
"1
5
dp"
android:paddingRight=
"1
0
dp"
android:paddingTop=
"10dp"
android:orientation=
"horizontal"
android:background=
"#BDBDBD"
...
...
@@ -22,16 +22,14 @@
android:accessibilityLiveRegion=
"none"
android:background=
"@android:color/holo_red_light"
android:clickable=
"false"
android:visibility=
"visible"
android:layout_alignParentTop=
"true"
>
</GridView>
<ImageButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"20dp"
android:src=
"@drawable/
ic_action_1
"
android:src=
"@drawable/
play64
"
android:background=
"@null"
android:id=
"@+id/button_tts"
android:layout_toRightOf=
"@+id/tape_grid_view"
...
...
@@ -41,11 +39,11 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"20dp"
android:src=
"@drawable/
ic_action
"
android:src=
"@drawable/
back64
"
android:background=
"@null"
android:id=
"@+id/button_delete"
android:layout_toRightOf=
"@+id/tape_grid_view"
android:layout_
alignParentTop=
"true
"
/>
android:layout_
below=
"@+id/button_tts
"
/>
<GridView
android:id=
"@+id/panel_grid_view"
...
...
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