From 59847d1aee0fe6c406a82f7180d45053c0626d67 Mon Sep 17 00:00:00 2001 From: chrqls Date: Fri, 15 Nov 2013 17:58:43 +0100 Subject: [PATCH 1/3] Updating .gitignore (smiledb-test/ added) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6718d14..fe97827 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /bin lint.xml +smiledb-test/ From 21a1e4f2a3409054aa55d0b04f50d06c449a4d3f Mon Sep 17 00:00:00 2001 From: chrqls Date: Fri, 15 Nov 2013 18:02:45 +0100 Subject: [PATCH 2/3] [#40] Alert 'Session already running' is gone --- res/values/strings.xml | 1 + .../smile/ui/ChooseActivityFlowDialog.java | 38 ++++++++++--------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 4246555..d6ddd48 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -72,6 +72,7 @@ Starting... Solving... + Recovering... Question Number Correct Answer diff --git a/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java b/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java index 45689de..4031365 100644 --- a/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java +++ b/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java @@ -98,26 +98,30 @@ private class StartButtonListener implements OnClickListener { @Override public void onClick(View v) { - if (status != null) { - if (!status.equals("")) { - AlertDialog.Builder builder = new AlertDialog.Builder( - ChooseActivityFlowDialog.this); - builder.setMessage(R.string.game_running).setCancelable(false) - .setNeutralButton("Ok", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int id) { - new LoadTask(ChooseActivityFlowDialog.this).execute(); - } - }); - AlertDialog alert = builder.create(); - alert.show(); - } else { - new LoadTask(ChooseActivityFlowDialog.this).execute(); - } + + System.out.println("READY ???"); + System.out.println(">>>>>>>>>>>> status="+status); + System.out.println("JOB IS DONE ("+status.equals("")+")"); + + if (status != null && !status.equals("")) { + +// AlertDialog.Builder builder = new AlertDialog.Builder(ChooseActivityFlowDialog.this); +// builder.setMessage(R.string.game_running).setCancelable(false).setNeutralButton("Ok", new DialogInterface.OnClickListener() { +// +// @Override +// public void onClick(DialogInterface dialog, int id) { +// new LoadTask(ChooseActivityFlowDialog.this).execute(); +// } +// }); + new LoadTask(ChooseActivityFlowDialog.this).execute(); + ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.recovering); +// AlertDialog alert = builder.create(); +// alert.show(); + } else { new LoadTask(ChooseActivityFlowDialog.this).execute(); + ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.starting); } - ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.starting); } } From 4e6fa88d097d17ab7ab4eafb5243cebd16cb5f9a Mon Sep 17 00:00:00 2001 From: chrqls Date: Fri, 15 Nov 2013 18:55:54 +0100 Subject: [PATCH 3/3] [#40] Removing console.log + fixing a bug when session is recovered or created --- .../java/org/smilec/smile/bu/SmilePlugServerManager.java | 2 +- .../java/org/smilec/smile/ui/ChooseActivityFlowDialog.java | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java b/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java index 4afbaef..99eddf0 100644 --- a/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java +++ b/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java @@ -43,7 +43,6 @@ public class SmilePlugServerManager extends AbstractBaseManager { - // XXX TODO: Add arguments to take Teacher Name, Session Name, and Group Name public void startMakingQuestions(String ip, Context context) throws NetworkErrorException { String url = SmilePlugUtil.createUrl(ip, SmilePlugUtil.START_MAKING_QUESTIONS_URL); put(ip, context, url, "{}"); @@ -86,6 +85,7 @@ public void resetGame(String ip, Context context) throws NetworkErrorException { } + // XXX TODO: Add arguments to take Teacher Name, Session Name, and Group Name public void createSession(String ip, String teacherName, String sessionTitle, String groupName, Context context) throws NetworkErrorException { String url = SmilePlugUtil.createUrl(ip, SmilePlugUtil.CREATE_SESSION); diff --git a/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java b/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java index 4031365..7a92505 100644 --- a/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java +++ b/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java @@ -99,11 +99,7 @@ private class StartButtonListener implements OnClickListener { @Override public void onClick(View v) { - System.out.println("READY ???"); - System.out.println(">>>>>>>>>>>> status="+status); - System.out.println("JOB IS DONE ("+status.equals("")+")"); - - if (status != null && !status.equals("")) { + if (status != null && !status.equals("") && !status.equals("RESET")) { // AlertDialog.Builder builder = new AlertDialog.Builder(ChooseActivityFlowDialog.this); // builder.setMessage(R.string.game_running).setCancelable(false).setNeutralButton("Ok", new DialogInterface.OnClickListener() { @@ -117,7 +113,6 @@ public void onClick(View v) { ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.recovering); // AlertDialog alert = builder.create(); // alert.show(); - } else { new LoadTask(ChooseActivityFlowDialog.this).execute(); ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.starting);