Skip to content

Commit

Permalink
Merge pull request #45 from chrqls/dev
Browse files Browse the repository at this point in the history
[#40] After a reset, there is no more "Session already running" popup
  • Loading branch information
Charles Quelos committed Nov 15, 2013
2 parents a9562b8 + 4e6fa88 commit b700e0f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/bin

lint.xml
smiledb-test/
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

<string name="starting">Starting...</string>
<string name="solving">Solving...</string>
<string name="recovering">Recovering...</string>

<string name="question_number">Question Number</string>
<string name="correct_answer">Correct Answer</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "{}");
Expand Down Expand Up @@ -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);
Expand Down
33 changes: 16 additions & 17 deletions src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,25 @@ 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();
}

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() {
//
// @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);
}
}

Expand Down

0 comments on commit b700e0f

Please sign in to comment.