-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
Issues : Words App -> NO ISSUES YET Quizime -> There's some logical error that I am skipping in the submit button of quizactivity . I checked alot and tried to implement a lot of changes. Snr. Dev's help will be appericiated .
- Loading branch information
There are no files selected for viewing
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'kotlin-android' | ||
id 'kotlin-android-extensions' | ||
} | ||
|
||
android { | ||
compileSdkVersion 30 | ||
buildToolsVersion "30.0.3" | ||
|
||
defaultConfig { | ||
applicationId "com.example.quizime" | ||
minSdkVersion 21 | ||
targetSdkVersion 30 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled 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 "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
implementation 'androidx.core:core-ktx:1.6.0' | ||
implementation 'androidx.appcompat:appcompat:1.3.1' | ||
implementation 'com.google.android.material:material:1.4.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.0' | ||
testImplementation 'junit:junit:4.+' | ||
implementation 'com.google.android.material:material:1.1.0-alpha06' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
} |
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.quizime | ||
|
||
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.quizime", appContext.packageName) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.quizime"> | ||
|
||
<application | ||
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.Quizime"> | ||
<activity android:name=".ResultActivity"></activity> | ||
<activity | ||
android:name=".QuizQuestionsActivity" | ||
android:screenOrientation="portrait" /> | ||
<activity | ||
android:name=".MainActivity" | ||
android:screenOrientation="portrait" | ||
android:theme="@style/NoActionBarTheme" | ||
android:windowSoftInputMode="adjustResize"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.example.quizime | ||
|
||
object Constants { | ||
|
||
const val USER_NAME : String = "user_name" | ||
const val TOTAL_QUESTIONS : String = "total_questions" | ||
const val CORRECT_ANSWERS : String = "correct_answers" | ||
|
||
fun getQuestions(): ArrayList<Question>{ | ||
val questionsList = ArrayList<Question>() | ||
|
||
//questions start here | ||
|
||
val que1 = Question(1,"Which Anime Character is this ?" , | ||
R.drawable.img_1 , | ||
"Monkey D. Luffy" , "Usopp" , "Marshal D. Teech" , | ||
"Gol D. Roger" ,1) | ||
questionsList.add(que1) | ||
|
||
val que2 = Question(2,"Which Anime show does this Character belongs to ?" , | ||
R.drawable.img_2 , | ||
"One Piece" , "Naruto" , "Tokyo Revengers" , | ||
"Tokyo Ghoul" ,4) | ||
questionsList.add(que2) | ||
|
||
val que3 = Question(3,"Which legendary show does this Character belongs to ?" , | ||
R.drawable.img_3, | ||
"One Piece" , "Naruto" , "Tokyo Revengers" , | ||
"Dragon Ball" ,4) | ||
questionsList.add(que3) | ||
|
||
val que4 = Question(4,"Is he Light Yagami ?" , | ||
R.drawable.img_4, | ||
"Yes" , "definiteLy" , "You're wrong , he's awesome" , | ||
"He's L" ,3) | ||
questionsList.add(que4) | ||
|
||
val que5 = Question(5,"Which fruit this guy ate ?" , | ||
R.drawable.img_5, | ||
"Gumo Gumo ni" , "Mera Mera no Mi" , "Fire-Fire fruit" , | ||
"Flame-Fist fruit" ,2) | ||
questionsList.add(que5) | ||
|
||
return questionsList | ||
} | ||
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.example.quizime | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AppCompatActivity | ||
import kotlinx.android.synthetic.main.activity_main.* | ||
|
||
class MainActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
|
||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN | ||
submitbtn.setOnClickListener{ | ||
if (eett_name.text.toString().isEmpty()){ | ||
Toast.makeText(this,"Please Enter A Valid Name",Toast.LENGTH_SHORT).show() | ||
}else{ | ||
val intent = Intent(this , QuizQuestionsActivity::class.java) | ||
intent.putExtra(Constants.USER_NAME , eett_name.text.toString()) | ||
startActivity(intent) | ||
finish() | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.quizime | ||
|
||
data class Question (val id: Int , val question :String , val image: Int , val optionOne : String , | ||
val optionTwo : String , val optionThree : String , val optionFour : String , val correctAnswer : Int) |