Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ArpitAswal committed May 23, 2024
0 parents commit 7de53a9
Show file tree
Hide file tree
Showing 99 changed files with 3,516 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

6 changes: 6 additions & 0 deletions .idea/compiler.xml

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

10 changes: 10 additions & 0 deletions .idea/deploymentTargetDropDown.xml

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

19 changes: 19 additions & 0 deletions .idea/gradle.xml

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

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

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

10 changes: 10 additions & 0 deletions .idea/migrations.xml

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

9 changes: 9 additions & 0 deletions .idea/misc.xml

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

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
64 changes: 64 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")

}

android {
namespace = "com.example.quizapp"
compileSdk = 34

defaultConfig {
applicationId = "com.example.quizapp"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("com.github.bumptech.glide:glide:4.16.0")
annotationProcessor("com.github.bumptech.glide:compiler:4.12.0")
implementation("com.google.firebase:firebase-auth:22.3.1")
implementation(platform("com.google.firebase:firebase-bom:32.8.1"))
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-database:20.3.1")
implementation("com.google.android.gms:play-services-auth:21.1.0")
implementation("com.google.firebase:firebase-firestore-ktx:24.11.1")
implementation("com.google.firebase:firebase-firestore:24.11.1")
implementation("com.google.firebase:firebase-storage:20.3.0")
implementation("com.google.firebase:firebase-crashlytics-buildtools:2.9.9")
implementation("de.hdodenhof:circleimageview:3.1.0")
implementation("com.github.bumptech.glide:glide:4.16.0")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.cardview:cardview:1.0.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
48 changes: 48 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "777379066436",
"firebase_url": "https://androidquizapp-57b46-default-rtdb.firebaseio.com",
"project_id": "androidquizapp-57b46",
"storage_bucket": "androidquizapp-57b46.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:777379066436:android:a128f4c58c03ee16c00211",
"android_client_info": {
"package_name": "com.example.quizapp"
}
},
"oauth_client": [
{
"client_id": "777379066436-2tusfc4ej404rs9rgsnb63br5k665ls9.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.quizapp",
"certificate_hash": "a16e56d97c331a0055985014340aaa069973b25c"
}
},
{
"client_id": "777379066436-4o9kbofchoqt5t8c4lvo8citatn3dbmm.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCzVCDSo1bySKNukHl-habkE9fvwCS8g0k"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "777379066436-4o9kbofchoqt5t8c4lvo8citatn3dbmm.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.quizapp

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.quizapp", appContext.packageName)
}
}
54 changes: 54 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.QuizApp"
tools:targetApi="31">
<activity
android:name=".ProfileActivity"
android:exported="false" />
<activity
android:name=".ResultActivity"
android:theme="@style/ScreenTheme"
android:exported="false" />
<activity
android:name=".QuestionsActivity"
android:exported="false" />
<activity
android:name=".SignupActivity"
android:exported="false"
android:theme="@style/AppTheme.FullScreen" />
<activity
android:name=".HomeActivity"
android:exported="false"
android:theme="@style/ScreenTheme" />
<activity
android:name=".SplashActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/AppTheme.FullScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions app/src/main/java/com/example/quizapp/CustomAdapter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.example.quizapp

import android.net.Uri
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import de.hdodenhof.circleimageview.CircleImageView

class CustomAdapter(private val dataList: List<RankViewModel>) :
RecyclerView.Adapter<CustomAdapter.ViewHolder>() {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view =
LayoutInflater.from(parent.context).inflate(R.layout.user_rank_cardview, parent, false)
return ViewHolder(view)
}

override fun getItemCount(): Int {
return dataList.size
}

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val items = dataList[position]
holder.rank.text = items.pos.toString()
holder.name.text = items.name
holder.score.text = "${items.score} / 10"

if (items.imgSrc.isNotEmpty()) {
Glide.with(holder.itemView.context).load(items.imgSrc).into(holder.image)
} else {
holder.image.setImageResource(R.drawable.avatar)
}

}

class ViewHolder(ItemView: View) : RecyclerView.ViewHolder(ItemView) {
val image: CircleImageView = itemView.findViewById(R.id.rankImageView)
val rank: TextView = itemView.findViewById(R.id.rankTV)
val name: TextView = itemView.findViewById(R.id.rankNameTV)
val score: TextView = itemView.findViewById(R.id.rankScoreTV)

}
}
19 changes: 19 additions & 0 deletions app/src/main/java/com/example/quizapp/FirebaseRealtimeDatabase.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.example.quizapp

import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.database.DatabaseReference
import com.google.firebase.database.FirebaseDatabase

class FirebaseRealTimeDatabase {

companion object {
lateinit var db: DatabaseReference
lateinit var currentUserId: String

fun initializeDatabaseReference() : DatabaseReference {
currentUserId = FirebaseAuth.getInstance().currentUser!!.uid
db = FirebaseDatabase.getInstance().getReference("UserInfo").child(currentUserId)
return db
}
}
}
Loading

0 comments on commit 7de53a9

Please sign in to comment.