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
5b062401
authored
Jul 19, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
show invisible pictos only in VocabularyManager
parent
47009e7e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
65 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoItemViewGenerator.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/VocabularyViewer.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/SerialActivity.java
android/Pictogram/tabletlibrary/tabletlibrary.iml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoItemViewGenerator.java
View file @
5b062401
...
...
@@ -2,6 +2,7 @@ package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -64,73 +65,87 @@ public class PictoItemViewGenerator {
public
static
View
getPictoView
(
Picto
picto
,
View
convertView
,
ViewGroup
parent
)
{
return
getPictoView
(
picto
,
convertView
,
parent
,
false
);
}
/**
* Establece la visibilidad de los pictogramas
* Pictogramas no habilitados se muestran sólo en VocabularyManager
* @param picto
* @param convertView
* @param parent
* @param preventMirror
* @return
*/
public
static
View
getPictoView
(
Picto
picto
,
View
convertView
,
ViewGroup
parent
,
boolean
preventMirror
)
{
if
(
convertView
==
null
)
{
convertView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
LAYOUT_BIG
:
LAYOUT
,
parent
,
false
);
}
RelativeLayout
layoutWrapper
;
FrameLayout
layout
;
final
ImageView
pictoImage
;
ImageView
redCrossImage
;
TextView
legend
;
TextView
legend_full
;
if
(
convertView
==
null
)
convertView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
LAYOUT_BIG
:
LAYOUT
,
parent
,
false
);
if
(
parent
.
getId
()==
R
.
id
.
tape_grid_view
)
convertView
.
setPadding
(
0
,
0
,
0
,
0
);
RelativeLayout
layoutWrapper
;
FrameLayout
layout
;
final
ImageView
pictoImage
;
ImageView
redCrossImage
;
TextView
legend
;
TextView
legend_full
;
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
())
{
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper_big
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_big
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image_big
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross_big
);
legend
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text_big
);
legend_full
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text_big_full
);
}
else
{
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross
);
legend
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text
);
legend_full
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text_full
);
}
layout
.
setBackgroundColor
(
convertView
.
getResources
()
.
getColor
(
R
.
color
.
picto_default_background
));
redCrossImage
.
setVisibility
(
View
.
GONE
);
layoutWrapper
.
setVisibility
(
View
.
GONE
);
pictoImage
.
setVisibility
(
View
.
GONE
);
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
pictoImage
.
setImageBitmap
(
null
);
layoutWrapper
.
setAlpha
(
1
f
);
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
||
(
picto
!=
null
&&
!
picto
.
is_invisible
()))
{
layoutWrapper
.
setVisibility
(
View
.
VISIBLE
);
pictoImage
.
setVisibility
(
View
.
VISIBLE
);
layoutWrapper
.
setBackground
(
convertView
.
getResources
()
.
getDrawable
(
R
.
drawable
.
picto_grid_item_border
));
if
(
picto
!=
null
)
{
layoutWrapper
.
setAlpha
(!
picto
.
is_invisible
()
?
1.00f
:
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
0.25f
:
0
f
);
convertView
.
setPadding
(
0
,
0
,
0
,
0
);
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
())
{
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper_big
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_big
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image_big
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross_big
);
legend
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text_big
);
legend_full
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text_big_full
);
}
else
{
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross
);
legend
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text
);
legend_full
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text_full
);
}
layout
.
setBackgroundColor
(
convertView
.
getResources
().
getColor
(
R
.
color
.
picto_default_background
));
redCrossImage
.
setVisibility
(
View
.
GONE
);
layoutWrapper
.
setVisibility
(
View
.
GONE
);
pictoImage
.
setVisibility
(
View
.
GONE
);
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
pictoImage
.
setImageBitmap
(
null
);
layoutWrapper
.
setAlpha
(
1
f
);
if
(
PCBcontext
.
getActivityContext
().
getClass
().
getSimpleName
().
equals
(
"VocabularyManager"
)
||
(
picto
!=
null
&&
!
picto
.
is_invisible
()))
{
layoutWrapper
.
setVisibility
(
View
.
VISIBLE
);
pictoImage
.
setVisibility
(
View
.
VISIBLE
);
layoutWrapper
.
setBackground
(
convertView
.
getResources
().
getDrawable
(
R
.
drawable
.
picto_grid_item_border
));
if
(
picto
!=
null
)
{
layoutWrapper
.
setAlpha
(!
picto
.
is_invisible
()
?
1.00f
:
PCBcontext
.
getActivityContext
().
getClass
().
getSimpleName
().
equals
(
"VocabularyManager"
)
?
0.25f
:
0
f
);
try
{
Bitmap
bm
=
picto
.
get_bitmap
(
PCBcontext
.
getContext
());
switch
(
picto
.
get_legend
())
{
case
"none"
:
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
case
"normal"
:
legend
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH
,
false
));
legend
.
setVisibility
(
View
.
VISIBLE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
legend
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH
,
false
));
legend
.
setVisibility
(
View
.
VISIBLE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
default
:
legend_full
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH_FULL
,
true
));
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
VISIBLE
);
legend_full
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH_FULL
,
true
));
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
VISIBLE
);
}
pictoImage
.
setImageBitmap
(
bm
);
if
(
picto
.
is_magnify
())
{
pictoImage
.
setScaleX
(
1.2f
);
pictoImage
.
setScaleY
(
1.2f
);
...
...
@@ -148,10 +163,10 @@ public class PictoItemViewGenerator {
mirror_color
++;
pictoImage
.
setScaleX
(
scale
[
mirror_color
%
scale
.
length
]);
pictoImage
.
setScaleY
(
scale
[
mirror_color
%
scale
.
length
]);
if
(
picto
.
is_highlight_background
())
layout
.
setBackgroundColor
(
color
[
mirror_color
%
color
.
length
]);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VOCA.java
0 → 100644
View file @
5b062401
package
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
communicator
;
import
android.util.Log
;
import
android.widget.Toast
;
import
com.yottacode.pictogram.tools.PCBcontext
;
/**
* Created by scollado on 17/07/17.
*/
public
class
VOCA
extends
VocabularyViewer
{
@Override
protected
void
onResume
()
{
super
.
onResume
();
PCBcontext
.
setActivityContext
(
this
);
}
}
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/VocabularyViewer.java
View file @
5b062401
...
...
@@ -68,7 +68,6 @@ import java.util.concurrent.TimeUnit;
public
class
VocabularyViewer
extends
Activity
implements
VocabularyTalk
.
iVocabularyListener
{
private
static
final
int
CAMERA_PIC_REQUEST
=
1
;
private
static
final
int
GALLERY_PIC_REQUEST
=
2
;
...
...
@@ -146,7 +145,6 @@ public class VocabularyViewer extends Activity implements VocabularyTalk.iVocabu
return
;
}
this
.
vocabulary
=
PCBcontext
.
getVocabulary
();
this
.
vocabulary
.
listen
(
PCBcontext
.
getRoom
(),
this
,
new
ActionTalk
.
iActionListener
()
{
...
...
@@ -321,6 +319,7 @@ public class VocabularyViewer extends Activity implements VocabularyTalk.iVocabu
:
""
)
,
Toast
.
LENGTH_SHORT
).
show
();
}
private
void
blockNotificationBar
()
{
WindowManager
manager
=
((
WindowManager
)
getApplicationContext
().
getSystemService
(
Context
.
WINDOW_SERVICE
));
WindowManager
.
LayoutParams
localLayoutParams
=
new
WindowManager
.
LayoutParams
();
...
...
@@ -341,6 +340,7 @@ public class VocabularyViewer extends Activity implements VocabularyTalk.iVocabu
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
);
...
...
@@ -753,6 +753,10 @@ public class VocabularyViewer extends Activity implements VocabularyTalk.iVocabu
}
}
/**
*
* @return
*/
public
Picto
getCurrentCategory
()
{
return
currentCategory
;
}
...
...
@@ -851,6 +855,11 @@ public class VocabularyViewer extends Activity implements VocabularyTalk.iVocabu
}
}
/**
*
* @param view
* @param p
*/
private
void
addPictoWord
(
View
view
,
Picto
p
)
{
tapeAdapter
.
addItem
(
p
);
getCurrentPictoGridAdapter
().
pictoInTape
(
view
,
p
);
...
...
@@ -869,6 +878,11 @@ public class VocabularyViewer extends Activity implements VocabularyTalk.iVocabu
if
(
VocabularyViewer
.
this
.
feedback_highlight
)
execHighligthFeeback
(
p
,
false
);
}
/**
*
* @param picto
* @param highlight_background
*/
private
void
execHighligthFeeback
(
final
Picto
picto
,
boolean
highlight_background
)
{
boolean
same_picto
=
false
;
picto
.
set_mirror
(
true
,
highlight_background
);
//comienza feedback
...
...
@@ -971,6 +985,10 @@ public class VocabularyViewer extends Activity implements VocabularyTalk.iVocabu
}
}
/**
*
* @param onlyTape
*/
protected
void
showOnlyTape
(
boolean
onlyTape
)
{
boolean
tape_delivered_prev
=
this
.
tape_delivered
;
Log
.
e
(
LOG_TAG
,
"ONLY TAPE->"
+
onlyTape
+
" "
+
ttsButton
.
isEnabled
());
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/SerialActivity.java
View file @
5b062401
...
...
@@ -22,6 +22,7 @@ import com.yottacode.pictogram.dao.Device;
import
com.yottacode.pictogram.dao.User
;
import
com.yottacode.pictogram.dao.UserLogin
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA
;
import
com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer
;
import
com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet
;
import
com.yottacode.pictogram.tools.PCBcontext
;
...
...
android/Pictogram/tabletlibrary/tabletlibrary.iml
View file @
5b062401
...
...
@@ -62,13 +62,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
...
...
@@ -76,6 +69,13 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/annotations"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/bundles"
/>
...
...
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