Skip to content

Commit

Permalink
updated ui and release v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
W1LDN16H7 committed Dec 10, 2021
1 parent b4e9b1a commit 68a8882
Show file tree
Hide file tree
Showing 22 changed files with 1,346 additions and 477 deletions.
44 changes: 39 additions & 5 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 30 additions & 15 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,50 @@
package="com.theknight.quizeo">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<application
android:name="com.theknight.quizeo.controller.AppController"
android:name=".controller.AppController"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Trivia">
android:theme="@style/Theme.Quizeo">
<activity
android:name="com.theknight.quizeo.FinishQuiz"
android:exported="true" />
<activity
android:name="com.theknight.quizeo.createAccount"
android:exported="true" />
<activity
android:name="com.theknight.quizeo.Login"
android:exported="true" />
<activity android:name="com.theknight.quizeo.MainActivity2" />
<activity android:name="com.theknight.quizeo.OptionActivity" />
<activity android:name="com.theknight.quizeo.MainActivity" />
<activity android:name="com.theknight.quizeo.FrontActivity">
android:name=".SplashScreen"
android:theme="@style/SplashTheme"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ForgotPass"
android:exported="false" />
<activity
android:name=".FinishQuiz"
android:exported="true" />
<activity
android:name=".createAccount"
android:exported="true" />
<activity
android:name=".Login"
android:exported="true" />
<activity android:name=".MainActivity2" />
<activity android:name=".OptionActivity" />
<activity android:name=".MainActivity" />
<activity android:name=".FrontActivity"/>
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->

<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->

<meta-data
android:name="preloaded_fonts"
Expand Down
Binary file removed app/src/main/ic_launcher-playstore.png
Binary file not shown.
73 changes: 67 additions & 6 deletions app/src/main/java/com/theknight/quizeo/FinishQuiz.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,27 @@
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.google.rpc.context.AttributeContext;
import com.theknight.quizeo.data.Repository;
import com.theknight.quizeo.databinding.ActivityFinishQuizBinding;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.theknight.quizeo.model.Question;

public class FinishQuiz extends AppCompatActivity {

private ActivityFinishQuizBinding binding;
private Button logout,credit;
private Button logout,credit,play_again;
private TextView correct_answer,incorrect_answer;

private FirebaseAuth firebaseAuth;
private FirebaseAuth.AuthStateListener authStateListener;
Expand All @@ -31,22 +39,54 @@ public class FinishQuiz extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_finish_quiz);
firebaseAuth = FirebaseAuth.getInstance();
user = firebaseAuth.getCurrentUser();
binding = DataBindingUtil.setContentView(this, R.layout.activity_finish_quiz);
int ans = getScore()/10;
correct_answer = findViewById(R.id.correct);
incorrect_answer = findViewById(R.id.incorrect);

binding.finishScore.setText("Final Score : " + String.valueOf(getScore()));
correct_answer.setText("Correct : " + String.valueOf(ans));
int total = 10-ans;
incorrect_answer.setText("Incorrect : " + String.valueOf(total));

logout = findViewById(R.id.Logoutbutton);
credit = findViewById(R.id.about);
play_again = findViewById(R.id.option);
play_again.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {


startActivity(new Intent(FinishQuiz.this,OptionActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK));
finish();

}
});


logout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

if(user!= null && firebaseAuth != null) {
if(user != null){
firebaseAuth.signOut();
}
startActivity(new Intent(FinishQuiz.this,FrontActivity.class));
finish();
finishAffinity();
Toast.makeText(FinishQuiz.this, "Logged Out", Toast.LENGTH_SHORT).show();


}
else{
Toast.makeText(FinishQuiz.this, "Something went wrong", Toast.LENGTH_SHORT).show();


}






}
});
Expand All @@ -61,8 +101,29 @@ public void onClick(View view) {
public void showDialog(){
Dialog dialog = new Dialog(this,R.style.DiaglogStyle);
dialog.setContentView(R.layout.credit_popup);
dialog.getWindow().setBackgroundDrawableResource(R.drawable.dialogbg);
dialog.getWindow().setBackgroundDrawableResource(R.drawable.dialogbg1);
ImageView close = dialog.findViewById(R.id.imageView);
TextView tx = dialog.findViewById(R.id.owner);
Button source = dialog.findViewById(R.id.source);
source.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.github.com/SmartApps-Ind/Quizeo/tree/v0.1.3"));
startActivity(i);

}
});

tx.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
tx.setTextColor(Color.CYAN);

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.github.com/W1LDN16H7"));
startActivity(i);
tx.setTextColor(Color.GREEN);
}
});
close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
117 changes: 110 additions & 7 deletions app/src/main/java/com/theknight/quizeo/FrontActivity.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,128 @@
package com.theknight.quizeo;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.FirebaseFirestore;
import com.theknight.quizeo.controller.Connection;

public class FrontActivity extends AppCompatActivity {
private Button startButton;
private ProgressBar progressBar;
private TextView textView;
private FirebaseAuth firebaseAuth;
private FirebaseUser currentUser;




//Firestore connection


/* access modifiers changed from: protected */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView((int) R.layout.activity_front);
Button button = (Button) findViewById(R.id.start_button);
this.startButton = button;
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
FrontActivity.this.startActivity(new Intent(FrontActivity.this, Login.class));
setContentView(R.layout.activity_front);
firebaseAuth = FirebaseAuth.getInstance();



final ProgressBar progress = (ProgressBar) findViewById(R.id.check);
final Button button = (Button) findViewById(R.id.start_button);






if(progress != null){

TextView text = (TextView) findViewById(R.id.set);
if(button !=null){
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
text.setText("");
text.setTextColor(0);

progress.setVisibility(View.VISIBLE);
Handler h = new Handler();
h.postDelayed(new Runnable() {
@Override
public void run() {
if(Connection.checkConnection(FrontActivity.this)){

progress.setVisibility(View.INVISIBLE);
text.setText(R.string.connected);
currentUser = firebaseAuth.getCurrentUser();
Toast.makeText(FrontActivity.this, "Connected", Toast.LENGTH_SHORT).show();
if(currentUser != null){
startActivity(new Intent(FrontActivity.this,OptionActivity.class));


}
else{
FrontActivity.this.startActivity(new Intent(FrontActivity.this, Login.class));


}



//




}else{
if(text != null){
progress.setVisibility(View.INVISIBLE);

text.setText(R.string.notConnected);
text.setTextColor(Color.RED);
Toast.makeText(FrontActivity.this, "Please check your internet connection", Toast.LENGTH_SHORT).show();





}





}

}
},2000);





}
});

}
});

}






}
}
Loading

0 comments on commit 68a8882

Please sign in to comment.