PCB v1.1 beta3

parent d3b355eb
...@@ -286,10 +286,10 @@ public class Picto extends Img { ...@@ -286,10 +286,10 @@ public class Picto extends Img {
public String get_legend() { public String get_legend() {
String legend; String legend;
try { try {
legend=this.attributes.getString(JSON_ATTTRS.LEGEND); legend=this.attributes.has(JSON_ATTTRS.LEGEND) ? this.attributes.getString(JSON_ATTTRS.LEGEND) : JSON_ATTTR_LEGEND_VALUES.NONE;
} catch (JSONException e) { } catch (JSONException e) {
legend=JSON_ATTTR_LEGEND_VALUES.NONE; // By default legend=JSON_ATTTR_LEGEND_VALUES.NONE; // By default
Log.e(LOG_TAG," Error getting legend:"+e.getMessage()); Log.e(LOG_TAG," Error getting legend:"+e.getMessage()+ "attributes: "+this.attributes.toString());
} }
return legend.equalsIgnoreCase("null") ? JSON_ATTTR_LEGEND_VALUES.NONE : legend; return legend.equalsIgnoreCase("null") ? JSON_ATTTR_LEGEND_VALUES.NONE : legend;
} }
......
...@@ -269,7 +269,7 @@ public class User { ...@@ -269,7 +269,7 @@ public class User {
/** /**
* *
* @return input feedback of the student configuration (default: "vibration") * @return delivery method
*/ */
public JSON_STUDENT_ATTTRS.delivery delivery() { public JSON_STUDENT_ATTTRS.delivery delivery() {
JSON_STUDENT_ATTTRS.delivery delivery; JSON_STUDENT_ATTTRS.delivery delivery;
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
<!--Upload local img --> <!--Upload local img -->
<string name="enterImgLabel">Introduzca etiqueta de la imagen</string> <string name="enterImgLabel">Introduzca etiqueta de la imagen</string>
<string name="notNewCats">No puede añadir nuevas categorias</string> <string name="notNewCats">No puede añadir nuevas categorias</string>
<string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string> <string name="upload_error">No pudo subirse a Pictogram Web. Se intentará más adelante</string>
<string name="upload_ok">Se subió correctamente al servidor</string> <string name="upload_ok">Se subió correctamente a Pictogram Web</string>
<string name="upload_duplicated">Pictograma ya presente en la colección. Utilice otra imagen</string> <string name="upload_duplicated">Pictograma ya presente en la colección. Utilice otra imagen</string>
......
...@@ -122,7 +122,27 @@ public class PictoAnimation { ...@@ -122,7 +122,27 @@ public class PictoAnimation {
} }
}); });
moveAnim.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
if (up) activity.ttsButton.setImageAlpha(255);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
moveAnim.setDuration(500); moveAnim.setDuration(500);
moveAnim.start(); moveAnim.start();
} }
......
...@@ -183,9 +183,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -183,9 +183,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
} }
}); });
if (this.vocabulary != null && this.vocabulary.size() > 0) {
Log.d(LOG_TAG, "Vocabulario correcto de tam:" + vocabulary.size());
}
this.tapeAdapter = new TapeAdapter(); this.tapeAdapter = new TapeAdapter();
this.tapeGridView = (GridView) this.findViewById(R.id.tape_grid_view); this.tapeGridView = (GridView) this.findViewById(R.id.tape_grid_view);
...@@ -403,7 +401,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -403,7 +401,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
tts.destroy();
Log.e(LOG_TAG, "Closing Pictogram Activity"); Log.e(LOG_TAG, "Closing Pictogram Activity");
PCBcontext.getNetService().closeNotifyStatus(); PCBcontext.getNetService().closeNotifyStatus();
} }
...@@ -912,7 +912,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -912,7 +912,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override @Override
public void onClick(View arg0) { public void onClick(View arg0) {
LinkedList<Picto> lp = tapeAdapter.getAll(); LinkedList<Picto> lp = tapeAdapter.getAll();
// This triggers the "Show" websocket action // This triggers the "Show" websocket action SI hay algo en la cinta y esta no está vacia
if (lp.size()>0 && !PictogramActivity.this.tapeAdapter.play()) { if (lp.size()>0 && !PictogramActivity.this.tapeAdapter.play()) {
PCBcontext.getActionLog().log(new PictosAction(lp)); PCBcontext.getActionLog().log(new PictosAction(lp));
tapeAdapter.ttsAllNew(tts); tapeAdapter.ttsAllNew(tts);
...@@ -926,11 +926,13 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -926,11 +926,13 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
protected void showOnlyTape(boolean onlyTape) { protected void showOnlyTape(boolean onlyTape) {
boolean tape_delivered_prev=this.tape_delivered; boolean tape_delivered_prev=this.tape_delivered;
Log.e(LOG_TAG,"ONLY TAPE->"+onlyTape+" "+ttsButton.isEnabled());
this.tape_delivered=onlyTape; this.tape_delivered=onlyTape;
if (onlyTape) { if (onlyTape) {
if (!tape_delivered_prev) { if (!tape_delivered_prev) {
if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one) if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one)
ttsButton.setEnabled(false); ttsButton.setEnabled(false);
Log.e(LOG_TAG,"ONLY TAPE0->"+onlyTape+" "+ttsButton.isEnabled());
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) { if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE); this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE);
this.pictoCategoryGridView.setVisibility(View.INVISIBLE); this.pictoCategoryGridView.setVisibility(View.INVISIBLE);
...@@ -946,8 +948,9 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -946,8 +948,9 @@ protected void showOnlyTape(boolean onlyTape) {
} }
} }
else { else {
if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one) ttsButton.setEnabled(true);
ttsButton.setEnabled(true); ttsButton.refreshDrawableState();
Log.e(LOG_TAG,"ONLY TAPE1->"+onlyTape+" "+ttsButton.isEnabled());
new PictoAnimation().animateTapeViewVertical(this,true); new PictoAnimation().animateTapeViewVertical(this,true);
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) { if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.VISIBLE); this.showPictoCategoriesViewButton.setVisibility(View.VISIBLE);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<string name="session_header">Seleccion de método e instrucción</string> <string name="session_header">Seleccion de método e instrucción</string>
<string name="session_error">Error de conexión</string> <string name="session_error">Error de conexión</string>
<string name="session_noinstructions">Alumno sin ninguna instrucción asignada. Por favor, asigne al menos una instrucción al alumno desde Pictogram Web</string> <string name="session_noinstructions">Alumno sin ninguna instrucción asignada. Por favor, asigne al menos una instrucción al alumno desde Pictogram Web</string>
<string name="session_loading">Desargando instrucciones</string> <string name="session_loading">Descargando instrucciones</string>
<string name="session_empty">Este alumno no tiene ningún método asignado. Por favor asigne un método a este alumno en</string> <string name="session_empty">Este alumno no tiene ningún método asignado. Por favor asigne un método a este alumno en</string>
<string name="session_notclosed">Este alumno tiene una sesión abierta. Por favor cierre la sesión desde Pictogram Web en</string> <string name="session_notclosed">Este alumno tiene una sesión abierta. Por favor cierre la sesión desde Pictogram Web en</string>
<string name="session_closed_ok">Sesión grabada correctamente. Hora</string> <string name="session_closed_ok">Sesión grabada correctamente. Hora</string>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<string name="session_header">Select method and instruction</string> <string name="session_header">Select method and instruction</string>
<string name="session_error">Server Error </string> <string name="session_error">Server Error </string>
<string name="session_noinstructions">Student without any instrucction assigment</string> <string name="session_noinstructions">Student without any instrucction assigment</string>
<string name="session_loading">Desargando instrucciones</string> <string name="session_loading">Descargando instrucciones</string>
<string name="session_empty">Este alumno no tiene ningún método asignado. Por favor asigne un método a este alumno en</string> <string name="session_empty">Este alumno no tiene ningún método asignado. Por favor asigne un método a este alumno en</string>
<string name="session_notclosed">Este alumno tiene una sesión abierta. Por favor cierre la sesión en el panel de control de Pictogram Web</string> <string name="session_notclosed">Este alumno tiene una sesión abierta. Por favor cierre la sesión en el panel de control de Pictogram Web</string>
<string name="session_closed_ok">Sesión grabada correctamente</string> <string name="session_closed_ok">Sesión grabada correctamente</string>
......
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