Commit c1151ee9 authored by rakam's avatar rakam
Browse files

Removes the toasts

parent c6c72828
......@@ -11,7 +11,6 @@ import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import fr.istic.masteru.android.R;
import fr.istic.masteru.android.automate.Automate;
......@@ -233,7 +232,6 @@ public abstract class MatchActivity extends Activity {
score.getNumSet() - 1, 0, 0);
}
if (score.getVainqueur() != -1) {
Toast.makeText(this, "Match terminé, vainqueur:" + score.getVainqueur(), Toast.LENGTH_SHORT).show();
pointLeftButton.setVisibility(View.GONE);
pointRightButton.setVisibility(View.GONE);
final ProgressDialog dialog = new ProgressDialog(this);
......
......@@ -2,7 +2,6 @@ package fr.istic.masteru.android.automate;
import android.content.Context;
import android.os.Environment;
import android.widget.Toast;
import java.io.BufferedReader;
import java.io.BufferedWriter;
......@@ -107,11 +106,11 @@ public class FileManager {
bufferWritter.write(data);
bufferWritter.close();
} catch (IOException e) {
Toast.makeText(context, "Erreur lors de l'écriture", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Erreur lors de l'écriture", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(context, "Ecriture impossible", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Ecriture impossible", Toast.LENGTH_SHORT).show();
}
}
......@@ -130,11 +129,11 @@ public class FileManager {
data = bufferedReader.readLine();
bufferedReader.close();
} catch (IOException e) {
Toast.makeText(context, "Erreur lors de la lecture", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Erreur lors de la lecture", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(context, "Lecture impossible", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Lecture impossible", Toast.LENGTH_SHORT).show();
}
return data;
}
......
......@@ -3,7 +3,6 @@ package fr.istic.masteru.android.utils;
import android.content.Context;
import android.os.Handler;
import android.util.Log;
import android.widget.Toast;
import com.google.gson.JsonObject;
import com.koushikdutta.async.future.FutureCallback;
......@@ -153,7 +152,7 @@ public class ScoreSyncManager {
public void onCompleted(Exception e, JsonObject result) {
if (e != null) { // Exception
if (e instanceof CancellationException || e instanceof TimeoutException) {
Toast.makeText(context, "Cancelled", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Cancelled", Toast.LENGTH_SHORT).show();
// After a timeout, retry in 5 seconds
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
......@@ -163,7 +162,7 @@ public class ScoreSyncManager {
}
}, RETRY_DELAY);
} else {
Toast.makeText(context, "Exception:" + e, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Exception:" + e, Toast.LENGTH_SHORT).show();
Log.d(TAG, "ScoreException:" + e);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
......@@ -182,12 +181,12 @@ public class ScoreSyncManager {
} else if (result.toString().contains("Duplicate entry")) {
syncQueue.remove(key);
syncNextElement();
Toast.makeText(context, "DUPLICATE ENTRY WORKAROUND", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "DUPLICATE ENTRY WORKAROUND", Toast.LENGTH_SHORT).show();
Log.d(TAG, "DUPLICATE ENTRY WORKAROUND!!!");
} else {
Log.d(TAG, "" + result);
// todo handle the BAD_ID_POINT case
Toast.makeText(context, "Error code:" + code + result, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Error code:" + code + result, Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
......@@ -226,7 +225,7 @@ public class ScoreSyncManager {
public void onCompleted(Exception e, JsonObject result) {
if (e != null) { // Exception
if (e instanceof CancellationException || e instanceof TimeoutException) {
Toast.makeText(context, "PreviousSet Cancelled", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "PreviousSet Cancelled", Toast.LENGTH_SHORT).show();
// After a timeout, retry in 5 seconds
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
......@@ -236,7 +235,7 @@ public class ScoreSyncManager {
}
}, RETRY_DELAY);
} else {
Toast.makeText(context, "PreviousSet Exception:" + e, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "PreviousSet Exception:" + e, Toast.LENGTH_SHORT).show();
Log.d(TAG, "PreviousSetException:" + e);
}
} else { // JSON
......@@ -247,7 +246,7 @@ public class ScoreSyncManager {
syncNextElement();
} else {
Log.d(TAG, "PreviousSet:" + result);
Toast.makeText(context, "PREVIOUS_SET Error code:" + code, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "PREVIOUS_SET Error code:" + code, Toast.LENGTH_SHORT).show();
}
}
}
......@@ -274,7 +273,7 @@ public class ScoreSyncManager {
public void onCompleted(Exception e, JsonObject result) {
if (e != null) { // Exception
if (e instanceof CancellationException || e instanceof TimeoutException) {
Toast.makeText(context, "Back Cancelled", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Back Cancelled", Toast.LENGTH_SHORT).show();
// After a timeout, retry in 5 seconds
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
......@@ -284,7 +283,7 @@ public class ScoreSyncManager {
}
}, RETRY_DELAY);
} else {
Toast.makeText(context, "Back Exception:" + e, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Back Exception:" + e, Toast.LENGTH_SHORT).show();
Log.d(TAG, "BackException:" + e);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
......@@ -299,10 +298,10 @@ public class ScoreSyncManager {
if (code == 0) { // MAJ OK
syncQueue.remove(key);
syncNextElement();
Toast.makeText(context, "Back OK", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Back OK", Toast.LENGTH_SHORT).show();
} else {
Log.d(TAG, "Back:" + result);
Toast.makeText(context, "Back Error code:" + code, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Back Error code:" + code, Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
......@@ -336,7 +335,7 @@ public class ScoreSyncManager {
public void onCompleted(Exception e, JsonObject result) {
if (e != null) { // Exception
if (e instanceof CancellationException || e instanceof TimeoutException) {
Toast.makeText(context, "Winner Cancelled", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Winner Cancelled", Toast.LENGTH_SHORT).show();
// After a timeout, retry in 5 seconds
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
......@@ -346,7 +345,7 @@ public class ScoreSyncManager {
}
}, RETRY_DELAY);
} else {
Toast.makeText(context, "Winner Exception:" + e, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Winner Exception:" + e, Toast.LENGTH_SHORT).show();
Log.d(TAG, "WinnerException:" + e);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
......@@ -360,12 +359,12 @@ public class ScoreSyncManager {
int code = result.getAsJsonPrimitive("code").getAsInt();
if (code == 0) { // MAJ OK
syncQueue.remove(key);
Toast.makeText(context, "Winner OK!", Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Winner OK!", Toast.LENGTH_SHORT).show();
if (syncFinishListener != null)
syncFinishListener.onSyncFinish();
} else {
Log.d(TAG, "Winner:" + result);
Toast.makeText(context, "Winner Error code:" + code, Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "Winner Error code:" + code, Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
......
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 to comment