Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
bd7384cb39
|
@ -12,6 +12,7 @@
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<activity android:name=".QuickQuizStart"></activity>
|
<activity android:name=".QuickQuizStart"></activity>
|
||||||
|
<activity android:name=".QuizQuestionPage" />
|
||||||
<activity android:name=".UserAreaActivity" />
|
<activity android:name=".UserAreaActivity" />
|
||||||
<activity android:name=".QuickPlayMenu" />
|
<activity android:name=".QuickPlayMenu" />
|
||||||
<activity android:name=".PuzzleMainActivity"/>
|
<activity android:name=".PuzzleMainActivity"/>
|
||||||
|
@ -20,8 +21,6 @@
|
||||||
<activity android:name=".JumbleActivity" />
|
<activity android:name=".JumbleActivity" />
|
||||||
<activity android:name=".login" />
|
<activity android:name=".login" />
|
||||||
<activity android:name=".registration" />
|
<activity android:name=".registration" />
|
||||||
<activity android:name=".QuizQuestionPage" />
|
|
||||||
|
|
||||||
<activity android:name=".MainActivity">
|
<activity android:name=".MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<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);
|
timer = findViewById(R.id.time);
|
||||||
score_dis = findViewById(R.id.score);
|
score_dis = findViewById(R.id.score);
|
||||||
wordTv = findViewById(R.id.wordTv);
|
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 Button slidingTiles;
|
||||||
private long jumble_elapsed_millis = 0;
|
private long jumble_elapsed_millis = 0;
|
||||||
private String username;
|
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();
|
Intent intent = getIntent();
|
||||||
username = intent.getStringExtra(login.EXTRA_TEXT);
|
username = intent.getStringExtra(login.EXTRA_TEXT);
|
||||||
//username_text = findViewById(R.id.username);
|
game_times = findViewById(R.id.username_text);
|
||||||
//username_text.setText("username : "+ username);
|
game_times.setText("username : "+ username);
|
||||||
|
|
||||||
jumble.setOnClickListener(new View.OnClickListener() {
|
jumble.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -66,7 +67,8 @@ public class QuickPlayMenu extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(QuickPlayMenu.this,TileMatchingActivity.class);
|
Intent intent = new Intent(QuickPlayMenu.this,TileMatchingActivity.class);
|
||||||
startActivity(intent);
|
intent.putExtra("tile_elapsed_millis", tile_elapsed_millis);
|
||||||
|
startActivityForResult(intent, 2);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -103,6 +105,21 @@ public class QuickPlayMenu extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
|
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) {
|
if(jumble_elapsed_millis != 0) {
|
||||||
|
|
||||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||||
|
@ -126,22 +143,54 @@ public class QuickPlayMenu extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
JumbleSender jumble_sender = new JumbleSender(username, jumble_elapsed_millis, responseListener);
|
JumbleSender jumble_sender = new JumbleSender(username, jumble_elapsed_millis, responseListener);
|
||||||
RequestQueue queue = Volley.newRequestQueue(QuickPlayMenu.this);
|
RequestQueue queue = Volley.newRequestQueue(QuickPlayMenu.this);
|
||||||
queue.add(jumble_sender);
|
queue.add(jumble_sender);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
if (resultCode == RESULT_CANCELED) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
|
|
||||||
if (requestCode == 1) {
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (requestCode == 2) {
|
||||||
if (resultCode == RESULT_OK) {
|
if (resultCode == RESULT_OK) {
|
||||||
jumble_elapsed_millis = data.getLongExtra("jumble_elapsed_millis", 0);
|
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);
|
addQuestion(q8);
|
||||||
Question q9 = new Question("Total number of bones present in the human body is ", "204", "205", "206", 3);
|
Question q9 = new Question("Total number of bones present in the human body is ", "204", "205", "206", 3);
|
||||||
addQuestion(q9);
|
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);
|
addQuestion(q10);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,12 +11,13 @@ import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
public class QuizQuestionPage extends AppCompatActivity {
|
public class QuizQuestionPage extends AppCompatActivity {
|
||||||
|
|
||||||
public static final String EXTRA_SCORE = "extraScore";
|
public static final String EXTRA_SCORE = "extraScore";
|
||||||
|
|
|
@ -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;
|
package com.example.alzapp;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import android.content.Intent;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.content.Intent;
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
/*******
|
/*******
|
||||||
Created on: 21/01/2020
|
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>
|
</RelativeLayout>
|
|
@ -90,15 +90,17 @@
|
||||||
app:layout_constraintTop_toBottomOf="@+id/jumble"
|
app:layout_constraintTop_toBottomOf="@+id/jumble"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/username"
|
android:id="@+id/username_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="100dp"
|
android:layout_marginStart="100dp"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:layout_marginEnd="400dp"
|
android:layout_marginEnd="400dp"
|
||||||
android:layout_marginBottom="35dp"
|
android:layout_marginBottom="35dp"
|
||||||
android:text="Username:"
|
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/jumble"
|
app:layout_constraintBottom_toTopOf="@+id/jumble"
|
||||||
|
|
Loading…
Reference in New Issue