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
15664a9f
authored
Jul 25, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
vocabularymanager
parent
4cb773c3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
46 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoMenu.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VOCA.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VocabularyManager.java
android/Pictogram/yotta_tablet/src/main/AndroidManifest.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoMenu.java
View file @
15664a9f
...
@@ -26,7 +26,7 @@ public class PictoMenu {
...
@@ -26,7 +26,7 @@ public class PictoMenu {
public
static
final
String
IMAGE_PICTO
=
"imagePicto"
;
public
static
final
String
IMAGE_PICTO
=
"imagePicto"
;
public
static
final
String
PATH_SOUND
=
"pathSound"
;
public
static
final
String
PATH_SOUND
=
"pathSound"
;
V
OCA
activity
;
V
ocabularyManager
activity
;
//Variables used on the picto menu (only supervisors)
//Variables used on the picto menu (only supervisors)
private
static
final
int
CAMERA_PIC_REQUEST
=
1
;
private
static
final
int
CAMERA_PIC_REQUEST
=
1
;
...
@@ -40,7 +40,7 @@ public class PictoMenu {
...
@@ -40,7 +40,7 @@ public class PictoMenu {
// TODO describe this variable
// TODO describe this variable
static
final
int
SELECT_PICTURE
=
1
;
static
final
int
SELECT_PICTURE
=
1
;
public
PictoMenu
(
V
OCA
activity
)
{
public
PictoMenu
(
V
ocabularyManager
activity
)
{
this
.
activity
=
activity
;
this
.
activity
=
activity
;
}
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VOCA.java
View file @
15664a9f
...
@@ -51,6 +51,7 @@ import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
...
@@ -51,6 +51,7 @@ import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import
com.yottacode.pictogram.tools.Img
;
import
com.yottacode.pictogram.tools.Img
;
import
com.yottacode.pictogram.tools.PCBcontext
;
import
com.yottacode.pictogram.tools.PCBcontext
;
import
com.yottacode.pictogram.tts.TTSHelper
;
import
com.yottacode.pictogram.tts.TTSHelper
;
import
com.yottacode.tools.GUITools
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONException
;
...
@@ -923,23 +924,6 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
...
@@ -923,23 +924,6 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
*/
*/
private
class
OnPictoLongClickListener
implements
AdapterView
.
OnItemLongClickListener
{
private
class
OnPictoLongClickListener
implements
AdapterView
.
OnItemLongClickListener
{
public
boolean
onItemLongClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
public
boolean
onItemLongClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
/*if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
// Si es supervisor al hacer longClick deshabilito ese pictograma o lo habilito
Picto p = getCurrentPictoGridAdapter().getItem(position);
if (p == null) {
// No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria
if (getCurrentCategory() != null || *//*!PCBcontext.getPcbdb().getCurrentUser().has_categories()*//*!PCBcontext.getVocabulary().has_categories()) {
int cat = getCurrentCategory() != null ? currentCategory.get_id() : Picto.NO_CATEGORY;
new PictoMenu(VOCA.this).createMenuForNewPicto(position % maxColumns, (int) (position / maxColumns), cat);
} else
Toast.makeText(VOCA.this, VOCA.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show();
} else {
//Si es supervisor hacer aparecer el menú de opciones del picto
new PictoMenu(VOCA.this).createMenuForPicto(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big(),p);
getCurrentPictoGridAdapter().notifyDataSetChanged();
}
} else {*/
ClipData
.
Item
item
=
new
ClipData
.
Item
(
""
+
position
);
ClipData
.
Item
item
=
new
ClipData
.
Item
(
""
+
position
);
String
[]
mimeTypes
=
{
ClipDescription
.
MIMETYPE_TEXT_PLAIN
};
String
[]
mimeTypes
=
{
ClipDescription
.
MIMETYPE_TEXT_PLAIN
};
ClipData
data
=
new
ClipData
(
""
+
position
,
mimeTypes
,
item
);
ClipData
data
=
new
ClipData
(
""
+
position
,
mimeTypes
,
item
);
...
@@ -961,7 +945,6 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
...
@@ -961,7 +945,6 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
//view.setVisibility(View.INVISIBLE);
//view.setVisibility(View.INVISIBLE);
}
}
}
}
//}
return
true
;
return
true
;
}
}
}
}
...
@@ -1131,58 +1114,47 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
...
@@ -1131,58 +1114,47 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
}
}
}
}
/*
@Override
@Override
public
boolean
dispatchTouchEvent
(
MotionEvent
event
)
{
public
boolean
dispatchTouchEvent
(
MotionEvent
event
)
{
int
in
=
0
,
out
=
0
;
int
in
=
0
,
out
=
0
;
Intent nextActivity
=
null;
Intent
nextActivity
=
null
;
Intent
intent
=
getIntent
();
Intent
intent
=
getIntent
();
boolean student_view=intent.getBooleanExtra("student_view",false);
if (
PCBcontext.getPcbdb()!=null && (PCBcontext.getPcbdb().getCurrentUser().is_supervisor() || student_view
) ) {
if
(
PCBcontext
.
getPcbdb
()
!=
null
&&
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
(
)
)
{
switch
(
event
.
getAction
())
{
switch
(
event
.
getAction
())
{
case
MotionEvent
.
ACTION_DOWN
:
case
MotionEvent
.
ACTION_DOWN
:
firstTouchX
=
event
.
getX
();
firstTouchX
=
event
.
getX
();
break
;
break
;
case
MotionEvent
.
ACTION_UP
:
case
MotionEvent
.
ACTION_UP
:
if (event.getX() > firstTouchX + 150) { //izquierda a derecha
if
(
event
.
getX
()
>
firstTouchX
+
150
)
{
// izquierda a derecha
if (!student_view || !PCBcontext.getPcbdb().getCurrentUser().is_teacher()) {
// No action
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(student_view ? PCBcontext.getDevice().getLastSupId() : User.NO_SUPERVISOR);
nextActivity = intent;
} else
if (!PCBcontext.getNetService().online())
GUITools.show_alert(VOCA.this, R.string.session_noinet);
else {
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(PCBcontext.getDevice().getLastSupId());
nextActivity = new Intent(this, SessionActivity.class);
}
in = R.anim.rightin;
out = R.anim.rightout;
overridePendingTransition(R.anim.leftin, R.anim.leftout);
}
else
if
(
firstTouchX
>
event
.
getX
()
+
150
)
{
//derecha a izquierda
}
else
if
(
firstTouchX
>
event
.
getX
()
+
150
)
{
//derecha a izquierda
if (!student_view && PCBcontext.getPcbdb().getCurrentUser().is_teacher() ) {
if
(!
PCBcontext
.
getNetService
().
online
())
if
(!
PCBcontext
.
getNetService
().
online
())
GUITools
.
show_alert
(
VOCA
.
this
,
R
.
string
.
session_noinet
);
GUITools
.
show_alert
(
VOCA
.
this
,
R
.
string
.
session_noinet
);
else
else
nextActivity = new Intent(this, SessionActivity.class);
nextActivity
=
new
Intent
(
this
,
VocabularyManager
.
class
);
} else {
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(student_view ? PCBcontext.getDevice().getLastSupId() : User.NO_SUPERVISOR);
nextActivity = intent;
}
in
=
R
.
anim
.
leftin
;
in
=
R
.
anim
.
leftin
;
out
=
R
.
anim
.
leftout
;
out
=
R
.
anim
.
leftout
;
}
}
if
(
nextActivity
!=
null
)
{
if
(
nextActivity
!=
null
)
{
tape_delivered
=
false
;
tape_delivered
=
false
;
intent.putExtra("student_view", !PCBcontext.getPcbdb().getCurrentUser().is_supervisor());
finish
();
finish
();
startActivity
(
nextActivity
);
startActivity
(
nextActivity
);
overridePendingTransition
(
in
,
out
);
overridePendingTransition
(
in
,
out
);
}
}
break
;
break
;
}
}
}
}
return
super
.
dispatchTouchEvent
(
event
);
return
super
.
dispatchTouchEvent
(
event
);
}
*/
}
/**
/**
* Para capturar el evento para abrir camara o galeria y procesar
* Para capturar el evento para abrir camara o galeria y procesar
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VocabularyManager.java
0 → 100644
View file @
15664a9f
This diff is collapsed.
Click to expand it.
android/Pictogram/yotta_tablet/src/main/AndroidManifest.xml
View file @
15664a9f
...
@@ -55,6 +55,12 @@
...
@@ -55,6 +55,12 @@
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:screenOrientation=
"landscape"
/>
android:screenOrientation=
"landscape"
/>
<activity
android:name=
"com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyManager"
android:exported=
"true"
android:label=
"@string/app_name"
android:launchMode=
"singleTop"
android:screenOrientation=
"landscape"
/>
<!-- Intent Filter to run the app when the boot is completed -->
<!-- Intent Filter to run the app when the boot is completed -->
<receiver
android:name=
".kiosk.BootReceiver"
>
<receiver
android:name=
".kiosk.BootReceiver"
>
<intent-filter>
<intent-filter>
...
...
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