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
1b41b14b
authored
Jul 26, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
new layout for VocabularyManager and vertical offset fixed with tape_big_height
parent
2bb07ea4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
295 additions
and
265 deletions
android/Pictogram/commonlibrary/src/main/res/values-sw600dp/dimens.xml
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/tabletlibrary/src/main/res/layout/activity_pictogram.xml → android/Pictogram/tabletlibrary/src/main/res/layout/voca.xml
android/Pictogram/tabletlibrary/src/main/res/layout/activity_pictogram_big.xml → android/Pictogram/tabletlibrary/src/main/res/layout/voca_big.xml
android/Pictogram/tabletlibrary/src/main/res/layout/vocabulary_manager.xml
android/Pictogram/tabletlibrary/src/main/res/layout/vocabulary_manager_big.xml
android/Pictogram/commonlibrary/src/main/res/values-sw600dp/dimens.xml
View file @
1b41b14b
...
...
@@ -10,9 +10,9 @@
<dimen
name=
"picto_normal_height"
>
90px
</dimen>
<dimen
name=
"picto_normal_width"
>
90px
</dimen>
<dimen
name=
"tape_normal_height"
>
100px
</dimen>
<dimen
name=
"picto_big_height"
>
1
15
px
</dimen>
<dimen
name=
"picto_big_width"
>
1
15
px
</dimen>
<dimen
name=
"tape_big_height"
>
1
25
px
</dimen>
<dimen
name=
"picto_big_height"
>
1
08
px
</dimen>
<dimen
name=
"picto_big_width"
>
1
08
px
</dimen>
<dimen
name=
"tape_big_height"
>
1
18
px
</dimen>
<dimen
name=
"picto_session_height"
>
75px
</dimen>
<dimen
name=
"picto_session_width"
>
75px
</dimen>
</resources>
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoMenu.java
View file @
1b41b14b
...
...
@@ -81,7 +81,7 @@ public class PictoMenu {
public
void
addPicto
(
int
row
,
int
col
,
int
cat
,
int
source
)
{
//Enviar al
VOCA
los datos necesarios para crear el picto despues
//Enviar al
voca
los datos necesarios para crear el picto despues
if
(
/*PCBcontext.getPcbdb().getCurrentUser().has_categories()*/
PCBcontext
.
getVocabulary
().
has_categories
())
{
activity
.
getIntent
().
putExtra
(
Picto
.
JSON_ATTTRS
.
CATEGORY
,
cat
);
activity
.
getIntent
().
putExtra
(
Picto
.
JSON_ATTTRS
.
ROW
,
row
);
...
...
@@ -107,7 +107,7 @@ public class PictoMenu {
Intent
intent
=
new
Intent
(
activity
,
EditPictoActivity
.
class
);
intent
.
putExtra
(
ID_PICTO_IMAGE
,
id_picto
);
//Enviar al
VOCA
los datos necesarios para editar el picto despues
//Enviar al
voca
los datos necesarios para editar el picto despues
if
(
/*PCBcontext.getPcbdb().getCurrentUser().has_categories()*/
PCBcontext
.
getVocabulary
().
has_categories
())
{
intent
.
putExtra
(
Picto
.
JSON_ATTTRS
.
CATEGORY
,
cat
);
intent
.
putExtra
(
Picto
.
JSON_ATTTRS
.
ROW
,
row
);
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VOCA.java
View file @
1b41b14b
...
...
@@ -135,7 +135,7 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
NetServiceTablet
.
restart_PictogramTablet
(
this
);
return
;
}
setContentView
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
R
.
layout
.
activity_pictogram_big
:
R
.
layout
.
activity_pictogram
);
setContentView
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
R
.
layout
.
voca_big
:
R
.
layout
.
voca
);
this
.
mainLayout
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
pictogramLayout
);
this
.
currentCategory
=
null
;
...
...
@@ -678,7 +678,7 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
// Change the keyword
PCBcontext
.
getDevice
().
setKeyword
(
m_Text1
);
Toast
.
makeText
(
PCBcontext
.
getContext
(),
getResources
().
getString
(
R
.
string
.
codeModified
),
Toast
.
LENGTH_SHORT
).
show
();
// And exit
VOCA
// And exit
voca
finish
();
}
else
...
...
@@ -1135,7 +1135,7 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
}
else
if
(
firstTouchX
>
event
.
getX
()
+
150
)
{
//derecha a izquierda
// Pasa de
VOCA
a VocabularyManager
// Pasa de
voca
a VocabularyManager
if
(!
PCBcontext
.
getNetService
().
online
()){
GUITools
.
show_alert
(
VOCA
.
this
,
R
.
string
.
session_noinet
);
}
else
{
...
...
@@ -1244,7 +1244,7 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
});
}*/
/**Para cambiar la activity de
VOCA
a EditPictoActivity
/**Para cambiar la activity de
voca
a EditPictoActivity
* @param image
*/
/*public void launchEditPictoActivity(Bitmap image){
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VocabularyManager.java
View file @
1b41b14b
...
...
@@ -3,8 +3,6 @@ package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.content.ClipData
;
import
android.content.ClipDescription
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
...
...
@@ -16,7 +14,6 @@ import android.net.Uri;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.provider.MediaStore
;
import
android.speech.tts.UtteranceProgressListener
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
import
android.view.DragEvent
;
...
...
@@ -39,7 +36,6 @@ import android.widget.ImageButton;
import
android.widget.RelativeLayout
;
import
android.widget.Toast
;
import
com.yottacode.pictogram.action.PictosAction
;
import
com.yottacode.pictogram.action.TalkAction
;
import
com.yottacode.pictogram.dao.Picto
;
import
com.yottacode.pictogram.dao.User
;
...
...
@@ -55,7 +51,6 @@ import com.yottacode.pictogram.tabletlibrary.gui.session.SessionActivity;
import
com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet
;
import
com.yottacode.pictogram.tools.Img
;
import
com.yottacode.pictogram.tools.PCBcontext
;
import
com.yottacode.pictogram.tts.TTSHelper
;
import
com.yottacode.tools.BitmapTools
;
import
com.yottacode.tools.GUITools
;
...
...
@@ -89,14 +84,8 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
PictoGridAdapter
pictoCategoryGridAdapter
;
// Grid showing pictos from a category (initially hidden)
GridView
pictoCategoryGridView
;
// Adapter for the tape view (list of pictos to send to the server)
TapeAdapter
tapeAdapter
;
// Tape view (list of pictos to send to the server)
GridView
tapeGridView
;
// Current picto category, if not null the corresponding category grid will be shown
private
Picto
currentCategory
;
// Object used for reading text
TTSHelper
tts
;
// Element used for loading new pictos (while changing categories)
Vocabulary
vocabulary
;
...
...
@@ -112,8 +101,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
Animation
showPictoMainViewAnimation
;
// Button used for showing the picto category view
ImageButton
showPictoCategoriesViewButton
;
ImageButton
deleteButton
;
ImageButton
ttsButton
;
int
maxColumns
,
maxRows
,
maxInTape
;
ScheduledThreadPoolExecutor
exec_mirror
=
null
;
...
...
@@ -142,7 +129,7 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
NetServiceTablet
.
restart_PictogramTablet
(
this
);
return
;
}
setContentView
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
R
.
layout
.
activity_pictogram_big
:
R
.
layout
.
activity_pictogram
);
setContentView
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
R
.
layout
.
vocabulary_manager_big
:
R
.
layout
.
vocabulary_manager
);
this
.
mainLayout
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
pictogramLayout
);
this
.
currentCategory
=
null
;
...
...
@@ -230,11 +217,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
}
});
this
.
tapeAdapter
=
new
TapeAdapter
();
this
.
tapeGridView
=
(
GridView
)
this
.
findViewById
(
R
.
id
.
tape_grid_view
);
this
.
tapeGridView
.
setAdapter
(
this
.
tapeAdapter
);
this
.
pictoMainGridAdapter
=
new
PictoGridAdapter
(
new
LinkedList
<
Picto
>());
this
.
pictoMainGridView
=
(
GridView
)
this
.
findViewById
(
R
.
id
.
picto_main_grid_view
);
this
.
pictoMainGridView
.
setAdapter
(
this
.
pictoMainGridAdapter
);
...
...
@@ -242,34 +224,14 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
this
.
pictoCategoryGridView
=
(
GridView
)
this
.
findViewById
(
R
.
id
.
picto_category_grid_view
);
this
.
pictoCategoryGridView
.
setAdapter
(
this
.
pictoCategoryGridAdapter
);
this
.
pictoMainGridView
.
setOnDragListener
(
new
OnPictoDragListener
());
this
.
pictoCategoryGridView
.
setOnDragListener
(
new
OnPictoDragListener
());
this
.
pictoMainGridView
.
setOnItemClickListener
(
new
OnPictoClickListener
());
this
.
pictoCategoryGridView
.
setOnItemClickListener
(
new
OnPictoClickListener
());
this
.
pictoMainGridView
.
setOnItemLongClickListener
(
new
OnPictoLongClickListener
());
this
.
pictoCategoryGridView
.
setOnItemLongClickListener
(
new
OnPictoLongClickListener
());
this
.
deleteButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
button_delete
);
this
.
ttsButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
button_tts
);
ttsButton
.
setOnLongClickListener
(
new
View
.
OnLongClickListener
()
{
@Override
public
boolean
onLongClick
(
View
v
)
{
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
" Changing mirror mode"
);
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
())
{
int
res_id
=
PCBcontext
.
getPcbdb
().
getCurrentUser
().
alter_mirror_mode
()
==
true
?
R
.
string
.
mirror_mode_on
:
R
.
string
.
mirror_mode_off
;
Toast
.
makeText
(
VocabularyManager
.
this
,
res_id
,
Toast
.
LENGTH_SHORT
).
show
();
}
return
true
;
}
});
this
.
deleteButton
.
setOnLongClickListener
(
new
OnDeleteButtonLongClickListener
());
this
.
showPictoCategoriesViewButton
=
(
ImageButton
)
this
.
findViewById
(
R
.
id
.
showPictoCategoriesViewButton
);
this
.
showPictoCategoriesViewButton
.
setOnClickListener
(
new
OnShowPictoCategoriesViewButtonClick
());
this
.
tapeGridView
.
setOnDragListener
(
new
OnPictoDragListener
());
//((NetServiceTablet) PCBcontext.getNetService().getNetServiceDevice()).setVOCA(this);
...
...
@@ -301,8 +263,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
super
.
onResume
();
Log
.
i
(
LOG_TAG
,
"Resuming Pictogram Activity"
);
PCBcontext
.
setActivityContext
(
this
);
setConfig
();
startTTS
();
Toast
.
makeText
(
this
.
getBaseContext
(),
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_name_stu
()+
" "
+
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_surname_stu
()+
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
" ("
+
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_name_sup
()+
" "
+
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_surname_sup
()+
")"
...
...
@@ -327,10 +287,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
manager
.
addView
(
view
,
localLayoutParams
);
}
public
void
setConfig
()
{
setFeedback
(
new
View
[]{
deleteButton
,
ttsButton
,
this
.
showPictoCategoriesViewButton
,
this
.
pictoCategoryGridView
,
this
.
pictoMainGridView
});
}
private
void
setFeedback
(
View
views
[])
{
boolean
vibration
=
PCBcontext
.
getPcbdb
().
getCurrentUser
().
input_feedback_on
(
User
.
JSON_STUDENT_INPUT_FEEDBACK
.
VIBRATION
);
boolean
click
=
PCBcontext
.
getPcbdb
().
getCurrentUser
().
input_feedback_on
(
User
.
JSON_STUDENT_INPUT_FEEDBACK
.
BEEP
);
...
...
@@ -385,43 +341,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
view
.
setOnTouchListener
(
touchListener
);
}
public
void
startTTS
()
{
String
engine
=
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_tts_engine_sup
()
==
null
?
getString
(
R
.
string
.
default_tts_engine
)
:
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_tts_engine_sup
();
String
tts_voice
=
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_json_attr
(
"tts voice"
)
==
null
?
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_gender_stu
().
charAt
(
0
)
==
'M'
?
getString
(
R
.
string
.
default_tts_voice_male
)
:
getString
(
R
.
string
.
default_tts_voice_female
)
:
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_json_attr
(
"tts voice"
);
tts
=
new
TTSHelper
(
this
,
engine
,
new
Locale
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_lang_stu
()),
tts_voice
);
tts
.
setOnUtteranceProgressListener
(
new
UtteranceProgressListener
()
{
@Override
public
void
onStart
(
String
utteranceId
)
{
Log
.
d
(
LOG_TAG
,
"TTS tape read start"
+
utteranceId
);
}
@Override
public
void
onDone
(
String
utteranceId
)
{
Log
.
d
(
LOG_TAG
,
"TTS tape read end"
);
this
.
finishSpeech
();
}
@Override
public
void
onError
(
String
utteranceId
)
{
Log
.
d
(
LOG_TAG
,
"TTS tape read error"
);
this
.
finishSpeech
();
}
private
void
finishSpeech
()
{
}
});
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
...
...
@@ -431,7 +350,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
@Override
protected
void
onStop
()
{
super
.
onStop
();
tts
.
destroy
();
Log
.
e
(
LOG_TAG
,
"Closing Pictogram Activity"
);
PCBcontext
.
getNetService
().
closeNotifyStatus
();
...
...
@@ -440,9 +358,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
if
(
tts
!=
null
)
{
tts
.
destroy
();
}
}
/**
...
...
@@ -667,7 +582,7 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
// Change the keyword
PCBcontext
.
getDevice
().
setKeyword
(
m_Text1
);
Toast
.
makeText
(
PCBcontext
.
getContext
(),
getResources
().
getString
(
R
.
string
.
codeModified
),
Toast
.
LENGTH_SHORT
).
show
();
// And exit
VOCA
// And exit
voca
finish
();
}
else
...
...
@@ -756,69 +671,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
* Event listener classes
* ********************************************************************************************/
/**
* Class used for dragging pictos to the tape
*/
private
class
OnPictoDragListener
implements
View
.
OnDragListener
{
@Override
public
boolean
onDrag
(
View
v
,
DragEvent
event
)
{
// Handles each of the expected events
switch
(
event
.
getAction
())
{
//signal for the start of a drag and drop operation.
case
DragEvent
.
ACTION_DRAG_STARTED
:
// do nothing
break
;
//the drag point has entered the bounding box of the View
case
DragEvent
.
ACTION_DRAG_ENTERED
:
//v.setBackground(targetShape); //change the shape of the view
break
;
//the user has moved the drag shadow outside the bounding box of the View
case
DragEvent
.
ACTION_DRAG_EXITED
:
//v.setBackground(normalShape); //change the shape of the view back to normal
break
;
//drag shadow has been released,the drag point is within the bounding box of the View
case
DragEvent
.
ACTION_DROP
:
View
view
=
(
View
)
event
.
getLocalState
();
ViewGroup
viewgroup
=
(
ViewGroup
)
view
.
getParent
();
int
position
=
Integer
.
parseInt
((
String
)
event
.
getClipDescription
().
getLabel
());
Log
.
d
(
"Drag:"
,
"Posición: "
+
position
+
" es categoria:"
+
v
.
getTransitionName
()+
" "
+
viewgroup
.
getTransitionName
());
// if the view is the tape_grid_view, we accept the drag item
// Destino tape_grid_view y origen panel_grid_view
if
(
v
==
findViewById
(
R
.
id
.
tape_grid_view
)
&&
(
viewgroup
==
findViewById
(
R
.
id
.
picto_category_grid_view
)
||
viewgroup
==
findViewById
(
R
.
id
.
picto_main_grid_view
)))
{
Picto
p
=
viewgroup
==
findViewById
(
R
.
id
.
picto_category_grid_view
)
?
pictoCategoryGridAdapter
.
getItem
(
position
)
:
pictoMainGridAdapter
.
getItem
(
position
);
if
(!
p
.
is_category
())
addPictoWord
(
view
,
p
);
}
// Si el destino es el panel y el origen la cinta de frase
else
if
(
v
==
findViewById
(
R
.
id
.
picto_category_grid_view
)
&&
viewgroup
==
findViewById
(
R
.
id
.
tape_grid_view
))
{
Picto
p
=
tapeAdapter
.
getItem
(
position
);
tapeAdapter
.
deleteItem
(
position
);
tapeAdapter
.
notifyDataSetChanged
();
getCurrentPictoGridAdapter
().
pictoInGrid
(
p
);
getCurrentPictoGridAdapter
().
notifyDataSetChanged
();
}
break
;
//the drag and drop operation has concluded.
case
DragEvent
.
ACTION_DRAG_ENDED
:
// v.setBackground(normalShape); //go back to normal shape
default
:
break
;
}
return
false
;
}
}
/**f
* Class used for picto clicking feedback
*/
...
...
@@ -844,29 +696,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
/**
*
* @param view
* @param p
*/
private
void
addPictoWord
(
View
view
,
Picto
p
)
{
tapeAdapter
.
addItem
(
p
);
getCurrentPictoGridAdapter
().
pictoInTape
(
view
,
p
);
currentCategory
=
null
;
tapeAdapter
.
notifyDataSetChanged
();
showPictoMainGridView
();
PCBcontext
.
getActionLog
().
log
(
new
TalkAction
(
TalkAction
.
ADD
,
p
));
if
(
VocabularyManager
.
this
.
feedback_read
&&
!
VocabularyManager
.
this
.
tapeAdapter
.
play
()
&&
!
p
.
is_category
())
{
File
audioFile
=
p
.
get_audioFile
();
Log
.
e
(
LOG_TAG
,
"AUDIO:"
+(
audioFile
!=
null
)+
":"
+
p
.
get_audioPath
());
if
(
audioFile
!=
null
)
VocabularyManager
.
this
.
tts
.
playRecord
(
audioFile
);
else
VocabularyManager
.
this
.
tts
.
play
(
p
.
get_translation
());
}
if
(
VocabularyManager
.
this
.
feedback_highlight
)
execHighligthFeeback
(
p
,
false
);
}
/**
*
* @param picto
* @param highlight_background
*/
...
...
@@ -930,68 +759,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
}
/**
* Class used for long click on delete button. When a press count reaches 3, the application
* exists.
*/
private
class
OnDeleteButtonLongClickListener
implements
View
.
OnLongClickListener
{
@Override
public
boolean
onLongClick
(
View
v
)
{
count_deletelong
++;
if
(
count_deletelong
>=
3
)
{
//TODO: COMPROBAR SI LOS USUARIOS QUE BUSCO EXISTEN: SI NO PONER LOS DATOS POR DEFECTO*******************************************************************/
//Cojo los id del ultimo estudiante y el ultimo supervisor
int
lastIdStu
=
PCBcontext
.
getDevice
().
getLastStuId
();
User
actual
=
PCBcontext
.
getPcbdb
().
getCurrentUser
();
User
usuario_anterior
;
String
lastUserName
=
null
;
String
lastPassword
=
null
;
if
(
actual
.
is_supervisor
())
//Si el que habia es supervisor busco el ultimo niño
try
{
usuario_anterior
=
PCBcontext
.
getDevice
().
findUser
(
lastIdStu
,
User
.
NO_SUPERVISOR
);
if
(
usuario_anterior
!=
null
)
{
lastUserName
=
usuario_anterior
.
get_nickname_stu
();
lastPassword
=
usuario_anterior
.
get_pwd_stu
();
}
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
else
{
int
lastIdSup
=
PCBcontext
.
getDevice
().
getLastSupId
();
try
{
usuario_anterior
=
PCBcontext
.
getDevice
().
findUser
(
lastIdStu
,
lastIdSup
);
if
(
usuario_anterior
!=
null
)
{
lastUserName
=
usuario_anterior
.
get_email_sup
();
lastPassword
=
usuario_anterior
.
get_pwd_sup
();
}
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
}
Intent
serialActivity
=
new
Intent
(
getBaseContext
(),
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
.
SerialActivity
.
class
);
if
(
lastUserName
!=
null
)
{
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
"Switch user to "
+
lastUserName
);
serialActivity
.
putExtra
(
"switch_usr"
,
lastUserName
);
serialActivity
.
putExtra
(
"switch_pwd"
,
lastPassword
);
}
pictoCategoryGridAdapter
.
notifyDataSetInvalidated
();
pictoMainGridAdapter
.
notifyDataSetInvalidated
();
VocabularyManager
.
this
.
finish
();
if
(
SessionActivity
.
session
!=
null
)
SessionActivity
.
session
.
finish
();
PCBcontext
.
getNetService
().
restart_app
(
true
);
}
return
true
;
}
}
/**
* Listener used for bringing back the picto categories grid when clicked.
*/
private
class
OnShowPictoCategoriesViewButtonClick
implements
View
.
OnClickListener
{
...
...
@@ -1018,7 +785,7 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
case
MotionEvent
.
ACTION_UP
:
if
(
event
.
getX
()
>
firstTouchX
+
150
)
{
// izquierda a derecha
// Pasa de VocabularyManager a
VOCA
// Pasa de VocabularyManager a
voca
if
(!
PCBcontext
.
getNetService
().
online
()){
GUITools
.
show_alert
(
VocabularyManager
.
this
,
R
.
string
.
session_noinet
);
}
else
{
...
...
@@ -1138,7 +905,7 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
});
}
/**Para cambiar la activity de
VOCA
a EditPictoActivity
/**Para cambiar la activity de
voca
a EditPictoActivity
* @param image
*/
public
void
launchEditPictoActivity
(
Bitmap
image
){
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/
activity_pictogram
.xml
→
android/Pictogram/tabletlibrary/src/main/res/layout/
voca
.xml
View file @
1b41b14b
...
...
@@ -44,17 +44,17 @@
android:numColumns=
"8"
></GridView>
<ImageButton
android:id=
"@+id/button_tts"
android:layout_width=
"@dimen/picto_normal_width"
android:layout_height=
"@dimen/tape_normal_height"
android:src=
"@drawable/send_tape"
android:background=
"@android:color/holo_red_light"
android:id=
"@+id/button_tts"
android:adjustViewBounds=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentTop=
"true"
android:adjustViewBounds=
"true"
android:background=
"@android:color/holo_red_light"
android:clickable=
"true"
android:paddingLeft=
"16dp"
android:paddingRight=
"16dp"
android:
clickable=
"tru
e"
/>
android:
src=
"@drawable/send_tap
e"
/>
<ImageButton
android:layout_width=
"96dp"
...
...
@@ -63,8 +63,8 @@
android:layout_alignParentStart=
"true"
android:src=
"@drawable/show_categories_grid"
android:background=
"#EEEEEE"
android:
layout_below=
"@+id/tape_grid_view
"
android:
scaleType=
"fitCenter
"
/>
android:
scaleType=
"fitCenter
"
android:
layout_below=
"@+id/button_delete
"
/>
<GridView
android:id=
"@+id/picto_category_grid_view"
...
...
@@ -72,7 +72,6 @@
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_below=
"@+id/tape_grid_view"
android:layout_toEndOf=
"@+id/showPictoCategoriesViewButton"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
...
...
@@ -80,7 +79,8 @@
android:numColumns=
"10"
android:paddingLeft=
"@dimen/small_padding"
android:paddingRight=
"@dimen/small_padding"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
></GridView>
android:verticalSpacing=
"@dimen/picto_grid_spacing"
android:layout_below=
"@+id/tape_grid_view"
></GridView>
<GridView
android:id=
"@+id/picto_main_grid_view"
...
...
@@ -89,11 +89,11 @@
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentStart=
"true"
android:layout_below=
"@+id/tape_grid_view"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
android:horizontalSpacing=
"@dimen/picto_grid_spacing"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
></GridView>
android:verticalSpacing=
"@dimen/picto_grid_spacing"
android:layout_below=
"@+id/button_delete"
></GridView>
</RelativeLayout>
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/
activity_pictogram
_big.xml
→
android/Pictogram/tabletlibrary/src/main/res/layout/
voca
_big.xml
View file @
1b41b14b
...
...
@@ -62,10 +62,10 @@
android:layout_width=
"96dp"
android:layout_height=
"match_parent"
android:layout_alignParentStart=
"true"
android:layout_below=
"@+id/tape_grid_view"
android:background=
"#EEEEEE"
android:scaleType=
"fitCenter"
android:src=
"@drawable/show_categories_grid"
/>
android:src=
"@drawable/show_categories_grid"
android:layout_below=
"@+id/button_delete"
/>
<GridView
android:id=
"@+id/picto_category_grid_view"
...
...
@@ -73,7 +73,6 @@
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_below=
"@+id/tape_grid_view"
android:layout_toEndOf=
"@+id/showPictoCategoriesViewButton"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
...
...
@@ -81,7 +80,8 @@
android:numColumns=
"8"
android:paddingLeft=
"@dimen/small_padding"
android:paddingRight=
"@dimen/small_padding"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
></GridView>
android:verticalSpacing=
"@dimen/picto_grid_spacing"
android:layout_below=
"@+id/tape_grid_view"
></GridView>
<GridView
android:id=
"@+id/picto_main_grid_view"
...
...
@@ -90,19 +90,19 @@
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentStart=
"true"
android:layout_below=
"@+id/tape_grid_view"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
android:horizontalSpacing=
"@dimen/picto_grid_spacing"
android:paddingLeft=
"@dimen/small_padding"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
></GridView>
android:verticalSpacing=
"@dimen/picto_grid_spacing"
android:layout_below=
"@+id/button_delete"
></GridView>
</RelativeLayout>
<FrameLayout
android:id=
"@+id/fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"
match_paren
t"
android:layout_height=
"
@dimen/tape_normal_heigh
t"
android:layout_gravity=
"center"
android:orientation=
"horizontal"
>
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/vocabulary_manager.xml
0 → 100644
View file @
1b41b14b
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:theme=
"@android:style/Theme.NoTitleBar.Fullscreen"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
android:background=
"#BDBDBD"
android:keepScreenOn=
"true"
tools:context=
"com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyManager"
android:padding=
"@dimen/small_padding"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/pictogramLayout"
>
<!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) -->
<RelativeLayout
android:id=
"@+id/loginTopbarLayout"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/tape_normal_height"
android:background=
"@color/VerdeApp"
android:paddingBottom=
"5dp"
android:paddingLeft=
"5dp"
android:paddingRight=
"5dp"
android:paddingTop=
"5dp"
>
<ImageView
android:id=
"@+id/loginTopbarSupervisorPhoto"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_alignParentStart=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"left"
android:background=
"@color/accent_material_dark"
android:scaleType=
"centerCrop"
/>
<LinearLayout
android:id=
"@+id/loginTopbarSupervisorNameLayout"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_toEndOf=
"@+id/loginTopbarSupervisorPhoto"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/loginTopbarSupervisorFullName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textColor=
"@color/BlancoApp"
/>
<TextView
android:id=
"@+id/loginTopbarSupervisorUserName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"@color/BlancoApp"
/>
</LinearLayout>
<Button
android:id=
"@+id/loginTopbarLogout"
style=
"@android:style/TextAppearance.Material.Button"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentTop=
"true"
android:enabled=
"false"
android:text=
"@string/logout"
android:textColor=
"@color/BlancoApp"
/>
</RelativeLayout>
<ImageButton
android:layout_width=
"96dp"
android:layout_height=
"match_parent"
android:id=
"@+id/showPictoCategoriesViewButton"
android:layout_alignParentStart=
"true"
android:src=
"@drawable/show_categories_grid"
android:background=
"#EEEEEE"
android:layout_below=
"@+id/tape_grid_view"
android:scaleType=
"fitCenter"
/>
<GridView
android:id=
"@+id/picto_category_grid_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_toEndOf=
"@+id/showPictoCategoriesViewButton"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
android:horizontalSpacing=
"@dimen/picto_grid_spacing"
android:numColumns=
"10"
android:paddingLeft=
"@dimen/small_padding"
android:paddingRight=
"@dimen/small_padding"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
android:layout_below=
"@+id/loginTopbarLayout"
></GridView>
<GridView
android:id=
"@+id/picto_main_grid_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentStart=
"true"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
android:horizontalSpacing=
"@dimen/picto_grid_spacing"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
android:layout_below=
"@+id/loginTopbarLayout"
></GridView>
</RelativeLayout>
<FrameLayout
android:id=
"@+id/fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/tape_normal_height"
android:layout_gravity=
"center"
android:orientation=
"horizontal"
>
</FrameLayout>
</FrameLayout>
android/Pictogram/tabletlibrary/src/main/res/layout/vocabulary_manager_big.xml
0 → 100644
View file @
1b41b14b
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:theme=
"@android:style/Theme.NoTitleBar.Fullscreen"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
android:background=
"#BDBDBD"
android:keepScreenOn=
"true"
tools:context=
"com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyManager"
android:padding=
"@dimen/small_padding"
>
<RelativeLayout
android:id=
"@+id/pictogramLayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) -->
<RelativeLayout
android:id=
"@+id/loginTopbarLayout"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/tape_big_height"
android:background=
"@color/VerdeApp"
android:paddingBottom=
"5dp"
android:paddingLeft=
"5dp"
android:paddingRight=
"5dp"
android:paddingTop=
"5dp"
>
<ImageView
android:id=
"@+id/loginTopbarSupervisorPhoto"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_alignParentStart=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"left"
android:background=
"@color/accent_material_dark"
android:scaleType=
"centerCrop"
/>
<LinearLayout
android:id=
"@+id/loginTopbarSupervisorNameLayout"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_toEndOf=
"@+id/loginTopbarSupervisorPhoto"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/loginTopbarSupervisorFullName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textColor=
"@color/BlancoApp"
/>
<TextView
android:id=
"@+id/loginTopbarSupervisorUserName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"@color/BlancoApp"
/>
</LinearLayout>
<Button
android:id=
"@+id/loginTopbarLogout"
style=
"@android:style/TextAppearance.Material.Button"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentTop=
"true"
android:enabled=
"false"
android:text=
"@string/logout"
android:textColor=
"@color/BlancoApp"
/>
</RelativeLayout>
<ImageButton
android:id=
"@+id/showPictoCategoriesViewButton"
android:layout_width=
"96dp"
android:layout_height=
"match_parent"
android:layout_alignParentStart=
"true"
android:layout_below=
"@+id/tape_grid_view"
android:background=
"#EEEEEE"
android:scaleType=
"fitCenter"
android:src=
"@drawable/show_categories_grid"
/>
<GridView
android:id=
"@+id/picto_category_grid_view"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/tape_big_height"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_below=
"@+id/loginTopbarLayout"
android:layout_toEndOf=
"@+id/showPictoCategoriesViewButton"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
android:horizontalSpacing=
"@dimen/picto_grid_spacing"
android:numColumns=
"8"
android:paddingLeft=
"@dimen/small_padding"
android:paddingRight=
"@dimen/small_padding"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
></GridView>
<GridView
android:id=
"@+id/picto_main_grid_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentStart=
"true"
android:background=
"#DDDDDD"
android:gravity=
"center_vertical|center|center_horizontal"
android:horizontalSpacing=
"@dimen/picto_grid_spacing"
android:paddingLeft=
"@dimen/small_padding"
android:verticalSpacing=
"@dimen/picto_grid_spacing"
android:layout_below=
"@+id/loginTopbarLayout"
></GridView>
</RelativeLayout>
<FrameLayout
android:id=
"@+id/fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:orientation=
"horizontal"
>
</FrameLayout>
</FrameLayout>
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