Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
bd7384cb39
|
@ -12,6 +12,7 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<activity android:name=".QuickQuizStart"></activity>
|
||||
<activity android:name=".QuizQuestionPage" />
|
||||
<activity android:name=".UserAreaActivity" />
|
||||
<activity android:name=".QuickPlayMenu" />
|
||||
<activity android:name=".PuzzleMainActivity"/>
|
||||
|
@ -20,8 +21,6 @@
|
|||
<activity android:name=".JumbleActivity" />
|
||||
<activity android:name=".login" />
|
||||
<activity android:name=".registration" />
|
||||
<activity android:name=".QuizQuestionPage" />
|
||||
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
|
|
@ -46,8 +46,7 @@ public class JumbleActivity extends AppCompatActivity {
|
|||
|
||||
|
||||
|
||||
pauser = findViewById(R.id.pause);
|
||||
resumer = findViewById(R.id.resume);
|
||||
|
||||
timer = findViewById(R.id.time);
|
||||
score_dis = findViewById(R.id.score);
|
||||
wordTv = findViewById(R.id.wordTv);
|
||||
|
@ -105,19 +104,7 @@ public class JumbleActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
|
||||
pauser.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
pauseChronometer();
|
||||
}
|
||||
});
|
||||
|
||||
resumer.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startChronometer();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
private Button slidingTiles;
|
||||
private long jumble_elapsed_millis = 0;
|
||||
private String username;
|
||||
private TextView username_text;
|
||||
private TextView game_times;
|
||||
private long tile_elapsed_millis = 0;
|
||||
|
||||
|
||||
|
||||
|
@ -49,8 +50,8 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
|
||||
Intent intent = getIntent();
|
||||
username = intent.getStringExtra(login.EXTRA_TEXT);
|
||||
//username_text = findViewById(R.id.username);
|
||||
//username_text.setText("username : "+ username);
|
||||
game_times = findViewById(R.id.username_text);
|
||||
game_times.setText("username : "+ username);
|
||||
|
||||
jumble.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -66,7 +67,8 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this,TileMatchingActivity.class);
|
||||
startActivity(intent);
|
||||
intent.putExtra("tile_elapsed_millis", tile_elapsed_millis);
|
||||
startActivityForResult(intent, 2);
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -103,33 +105,9 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
|
||||
if(jumble_elapsed_millis != 0) {
|
||||
|
||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
try {
|
||||
JSONObject jsonResponse = new JSONObject(response);
|
||||
boolean success = jsonResponse.getBoolean("success");
|
||||
if (success) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this, UserAreaActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(QuickPlayMenu.this);
|
||||
builder.setMessage("Register Failed")
|
||||
.setNegativeButton("Retry", null)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
JumbleSender jumble_sender = new JumbleSender(username, jumble_elapsed_millis, responseListener);
|
||||
RequestQueue queue = Volley.newRequestQueue(QuickPlayMenu.this);
|
||||
queue.add(jumble_sender);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -141,7 +119,78 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
if (requestCode == 1) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
jumble_elapsed_millis = data.getLongExtra("jumble_elapsed_millis", 0);
|
||||
game_times.setText("username : "+ username+ " " + jumble_elapsed_millis);
|
||||
if(jumble_elapsed_millis != 0) {
|
||||
|
||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
try {
|
||||
JSONObject jsonResponse = new JSONObject(response);
|
||||
boolean success = jsonResponse.getBoolean("success");
|
||||
if (success) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this, UserAreaActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(QuickPlayMenu.this);
|
||||
builder.setMessage("Register Failed")
|
||||
.setNegativeButton("Retry", null)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
JumbleSender jumble_sender = new JumbleSender(username, jumble_elapsed_millis, responseListener);
|
||||
RequestQueue queue = Volley.newRequestQueue(QuickPlayMenu.this);
|
||||
queue.add(jumble_sender);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (resultCode == RESULT_CANCELED) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (requestCode == 2) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
tile_elapsed_millis = data.getLongExtra("tile_elapsed_millis", 0);
|
||||
game_times.setText("username : "+ username+ " " + tile_elapsed_millis);
|
||||
|
||||
if(tile_elapsed_millis!= 0) {
|
||||
|
||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
try {
|
||||
JSONObject jsonResponse = new JSONObject(response);
|
||||
boolean success = jsonResponse.getBoolean("success");
|
||||
if (success) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this, UserAreaActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(QuickPlayMenu.this);
|
||||
builder.setMessage("Register Failed")
|
||||
.setNegativeButton("Retry", null)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TileSender tile_sender = new TileSender(username, tile_elapsed_millis, responseListener);
|
||||
RequestQueue queue = Volley.newRequestQueue(QuickPlayMenu.this);
|
||||
queue.add(tile_sender);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class QuizDbHelper extends SQLiteOpenHelper {
|
|||
addQuestion(q8);
|
||||
Question q9 = new Question("Total number of bones present in the human body is ", "204", "205", "206", 3);
|
||||
addQuestion(q9);
|
||||
Question q10 = new Question("Novak Djokovic is a famous player associated with the game of ", "Basketball", "Tennis", "Cricket", 1);
|
||||
Question q10 = new Question("Novak Djokovic is a famous player associated with the game of ", "Basketball", "Tennis", "Cricket", 2);
|
||||
addQuestion(q10);
|
||||
|
||||
}
|
||||
|
|
|
@ -11,12 +11,13 @@ import android.widget.RadioButton;
|
|||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class QuizQuestionPage extends AppCompatActivity {
|
||||
|
||||
public static final String EXTRA_SCORE = "extraScore";
|
||||
|
@ -168,21 +169,21 @@ public class QuizQuestionPage extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private void showSolution() {
|
||||
/** rb1.setTextColor(Color.RED);
|
||||
rb2.setTextColor(Color.RED);
|
||||
rb3.setTextColor(Color.RED); **/
|
||||
/** rb1.setTextColor(Color.RED);
|
||||
rb2.setTextColor(Color.RED);
|
||||
rb3.setTextColor(Color.RED); **/
|
||||
|
||||
switch (currentQuestion.getAnswerNr()) {
|
||||
case 1:
|
||||
// rb1.setTextColor(Color.GREEN);
|
||||
// rb1.setTextColor(Color.GREEN);
|
||||
textViewQuestion.setText("Answer 1 is correct");
|
||||
break;
|
||||
case 2:
|
||||
// rb2.setTextColor(Color.GREEN);
|
||||
// rb2.setTextColor(Color.GREEN);
|
||||
textViewQuestion.setText("Answer 2 is correct");
|
||||
break;
|
||||
case 3:
|
||||
// rb3.setTextColor(Color.GREEN);
|
||||
// rb3.setTextColor(Color.GREEN);
|
||||
textViewQuestion.setText("Answer 3 is correct");
|
||||
break;
|
||||
}
|
||||
|
@ -207,7 +208,7 @@ public class QuizQuestionPage extends AppCompatActivity {
|
|||
finishQuiz();
|
||||
}
|
||||
else {
|
||||
Toast.makeText(this,"Press back again to finish",Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this,"Press back again to finish",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
backPressedTime = System.currentTimeMillis();
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TileSender extends StringRequest {
|
||||
private static final String REQUEST_URL = "https://eclectic-sweeps.000webhostapp.com/tile_sender.php";
|
||||
private Map<String, String> params;
|
||||
|
||||
TileSender(String username,long times , Response.Listener<String> listener) {
|
||||
super(Method.POST, REQUEST_URL, listener, null);
|
||||
params = new HashMap<>();
|
||||
params.put("username", username);
|
||||
params.put("tile",times+"");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
||||
|
@ -55,5 +55,10 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// Do Here what ever you want do on back press;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,24 +76,7 @@
|
|||
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/chronometer"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="-59dp"
|
||||
android:text = "pause"
|
||||
android:id="@+id/pause"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/resume"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/pause"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="-60dp"
|
||||
android:text="resume" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
|
@ -90,15 +90,17 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/jumble"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:id="@+id/username_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="100dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="400dp"
|
||||
android:layout_marginBottom="35dp"
|
||||
android:text="Username:"
|
||||
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/jumble"
|
||||
|
|
Loading…
Reference in New Issue