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
f5adcd27
authored
Apr 03, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
empty square included
parent
4bd4a6e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
10 deletions
android/Pictogram/app/src/main/java/com/yottacode/pictogram/dao/Picto.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/PanelAdapter.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/PictogramActivity.java
android/Pictogram/app/src/main/res/drawable-xhdpi/square.png
android/Pictogram/app/src/main/java/com/yottacode/pictogram/dao/Picto.java
View file @
f5adcd27
...
@@ -181,8 +181,6 @@ public class Picto extends Img {
...
@@ -181,8 +181,6 @@ public class Picto extends Img {
*/
*/
public
boolean
is_invisible
()
{
public
boolean
is_invisible
()
{
try
{
try
{
Log
.
i
(
"FERNANDO 2"
,
this
.
attributes
.
getString
(
JSON_ATTTRS
.
STATUS
).
equals
(
JSON_ATTTR_STATUS_VALUES
.
INVISIBLE
)
+
"||"
+
this
.
is_category
()+
"&&"
+
!
PCBcontext
.
getVocabulary
().
isVisibleCategory
(
this
.
get_id
()));
return
this
.
attributes
.
getString
(
JSON_ATTTRS
.
STATUS
).
equals
(
JSON_ATTTR_STATUS_VALUES
.
INVISIBLE
)
||
return
this
.
attributes
.
getString
(
JSON_ATTTRS
.
STATUS
).
equals
(
JSON_ATTTR_STATUS_VALUES
.
INVISIBLE
)
||
(
this
.
is_category
()
&&
!
PCBcontext
.
getVocabulary
().
isVisibleCategory
(
this
.
get_id
()));
(
this
.
is_category
()
&&
!
PCBcontext
.
getVocabulary
().
isVisibleCategory
(
this
.
get_id
()));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
...
@@ -305,7 +303,6 @@ public class Picto extends Img {
...
@@ -305,7 +303,6 @@ public class Picto extends Img {
* @return
* @return
*/
*/
public
boolean
is_category
()
{
public
boolean
is_category
()
{
Log
.
i
(
"FERNANDO 3"
,(
this
.
get_category
()==
Picto
.
NO_CATEGORY
)+
"&&"
+(
this
.
get_column
()!=
Picto
.
ROW_UNCATEGORIZED_CONCEPTS
)+
":"
+
this
.
get_column
());
return
this
.
get_category
()==
Picto
.
NO_CATEGORY
&&
this
.
get_column
()!=
Picto
.
ROW_UNCATEGORIZED_CONCEPTS
;
return
this
.
get_category
()==
Picto
.
NO_CATEGORY
&&
this
.
get_column
()!=
Picto
.
ROW_UNCATEGORIZED_CONCEPTS
;
}
}
/**
/**
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/PanelAdapter.java
View file @
f5adcd27
...
@@ -38,7 +38,8 @@ import java.util.LinkedList;
...
@@ -38,7 +38,8 @@ import java.util.LinkedList;
public
class
PanelAdapter
extends
ArrayAdapter
{
public
class
PanelAdapter
extends
ArrayAdapter
{
private
LinkedList
<
Picto
>
lPictos
;
private
LinkedList
<
Picto
>
lPictos
;
private
int
color
;
int
color
;
private
Bitmap
square_bmp
=
BitmapFactory
.
decodeResource
(
PCBcontext
.
getContext
().
getResources
(),
R
.
drawable
.
square
);
//private Context mContext;
//private Context mContext;
// String constant for logs
// String constant for logs
...
@@ -147,7 +148,8 @@ public class PanelAdapter extends ArrayAdapter {
...
@@ -147,7 +148,8 @@ public class PanelAdapter extends ArrayAdapter {
// Pruebo a poner una X encima de la imagen
// Pruebo a poner una X encima de la imagen
if
(
lPictos
.
get
(
position
)
==
null
){
if
(
lPictos
.
get
(
position
)
==
null
){
// Es un hueco en blanco
// Es un hueco en blanco
imageView
.
setImageAlpha
(
0
);
imageView
.
setImageAlpha
(
50
);
imageView
.
setImageBitmap
(
this
.
square_bmp
);
}
else
{
}
else
{
Picto
picto
=
lPictos
.
get
(
position
);
Picto
picto
=
lPictos
.
get
(
position
);
Bitmap
bmp1
=
picto
.
get_bitmap
(
PCBcontext
.
getContext
());
Bitmap
bmp1
=
picto
.
get_bitmap
(
PCBcontext
.
getContext
());
...
@@ -163,10 +165,8 @@ public class PanelAdapter extends ArrayAdapter {
...
@@ -163,10 +165,8 @@ public class PanelAdapter extends ArrayAdapter {
if
(
picto
.
is_invisible
())
{
if
(
picto
.
is_invisible
())
{
imageView
.
setImageAlpha
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
50
:
0
);
imageView
.
setImageAlpha
(
50
);
imageView
.
setImageBitmap
(
bmp1
);
imageView
.
setImageBitmap
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
bmp1
:
this
.
square_bmp
);
Log
.
d
(
LOG_TAG
,
"POSITION:"
+
position
+
" / STATUS: "
+
picto
.
get_status
());
//imageView.setImageBitmap(bmp1);
}
}
if
(
picto
.
is_disabled
()){
if
(
picto
.
is_disabled
()){
imageView
.
setImageAlpha
(
100
);
// Entre 0 y 255
imageView
.
setImageAlpha
(
100
);
// Entre 0 y 255
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/PictogramActivity.java
View file @
f5adcd27
...
@@ -204,7 +204,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
...
@@ -204,7 +204,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
//rowNumberAdapter.notifyDataSetChanged();
//rowNumberAdapter.notifyDataSetChanged();
Picto
p
=
panelAdapter
.
getItem
(
position
);
Picto
p
=
panelAdapter
.
getItem
(
position
);
Log
.
i
(
"PA FERNANDO 1"
,(
p
!=
null
)
+
"&&"
+(!
p
.
is_invisible
())+
"&&"
+
p
.
is_enabled
());
if
(
p
!=
null
&&
!
p
.
is_invisible
()
&&
p
.
is_enabled
())
{
if
(
p
!=
null
&&
!
p
.
is_invisible
()
&&
p
.
is_enabled
())
{
Log
.
d
(
LOG_TAG
,
"Clic en picto: "
+
p
.
toString
());
Log
.
d
(
LOG_TAG
,
"Clic en picto: "
+
p
.
toString
());
//Log.d(LOG_TAG, "STATUS: " + p.get_status());
//Log.d(LOG_TAG, "STATUS: " + p.get_status());
...
...
android/Pictogram/app/src/main/res/drawable-xhdpi/square.png
0 → 100644
View file @
f5adcd27
1.96 KB
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