empty square included

parent 4bd4a6e0
...@@ -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;
} }
/** /**
......
...@@ -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
......
...@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment