implementada funcionalidad "entrega de tira" III

issue #841 resuelto a falta de poner orden el error 401
parent 614b18cc
...@@ -113,11 +113,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -113,11 +113,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
@Override @Override
public boolean isValidToken(RestapiWrapper.HTTPException error, Object result) { public boolean isValidToken(RestapiWrapper.HTTPException error, Object result) {
try { Log.e(LOG_TAG,"Token valid? "+error.getCode()+":"+result.toString()); try {
return error.getCode()!=401 boolean invalid_token = error.getCode()==401
|| !(result instanceof JSONObject) && result!=null
|| !((JSONObject)result).has("err") && result instanceof JSONObject
|| !((JSONObject)result).getString("err").equalsIgnoreCase("Invalid token undefined"); && ((JSONObject)result).has("err")
&& ((JSONObject)result).getString("err").equalsIgnoreCase("Invalid token undefined");
return !invalid_token;
} catch (JSONException e) { } catch (JSONException e) {
Log.e(LOG_TAG,e.getMessage()); Log.e(LOG_TAG,e.getMessage());
return true; return true;
......
...@@ -109,7 +109,7 @@ public class PictoAnimation { ...@@ -109,7 +109,7 @@ public class PictoAnimation {
public void onAnimationUpdate(ValueAnimator animation) { public void onAnimationUpdate(ValueAnimator animation) {
int i=(int)animation.getAnimatedValue(); int i=(int)animation.getAnimatedValue();
v.setTranslationY(i); v.setTranslationY(i);
if (i<=255) activity.ttsButton.setImageAlpha(255-i); //if (i<=255) activity.ttsButton.setImageAlpha(255-i);
} }
......
...@@ -873,26 +873,27 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -873,26 +873,27 @@ 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;
this.tape_delivered=onlyTape; this.tape_delivered=onlyTape;
if (onlyTape) { if (onlyTape) {
ttsButton.setEnabled(false); if (!tape_delivered_prev) {
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) { //ttsButton.setEnabled(false);
this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE); if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.pictoCategoryGridView.setVisibility(View.INVISIBLE); this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE);
this.pictoMainGridView.setAlpha(0.25f); this.pictoCategoryGridView.setVisibility(View.INVISIBLE);
this.pictoMainGridView.setEnabled(false); this.pictoMainGridView.setAlpha(0.25f);
this.pictoMainGridView.setEnabled(false);
} else {
this.pictoCategoryGridView.setAlpha(0.25f);
this.pictoCategoryGridView.setEnabled(false);
this.showPictoCategoriesViewButton.setAlpha(0f);
}
new PictoAnimation().animateTapeViewVertical(this, false);
} }
else {
this.pictoCategoryGridView.setAlpha(0.25f);
this.pictoCategoryGridView.setEnabled(false);
this.showPictoCategoriesViewButton.setAlpha(0f);
}
new PictoAnimation().animateTapeViewVertical(this,false);
} }
else { else {
ttsButton.setEnabled(true); //ttsButton.setEnabled(true);
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);
......
...@@ -123,6 +123,8 @@ ...@@ -123,6 +123,8 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" 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/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.1/jars" />
...@@ -131,11 +133,13 @@ ...@@ -131,11 +133,13 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.support/wearable/2.0.0-alpha2/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.support/wearable/2.0.0-alpha2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
......
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