diff --git a/Team414/.gitignore b/Team414/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/Team414/.gitignore @@ -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 diff --git a/Team414/.idea/.gitignore b/Team414/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/Team414/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/Team414/.idea/.name b/Team414/.idea/.name new file mode 100644 index 0000000..b3405b3 --- /dev/null +++ b/Team414/.idea/.name @@ -0,0 +1 @@ +My Application \ No newline at end of file diff --git a/Team414/.idea/AndroidProjectSystem.xml b/Team414/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/Team414/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Team414/.idea/compiler.xml b/Team414/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/Team414/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Team414/.idea/deploymentTargetSelector.xml b/Team414/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/Team414/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/Team414/.idea/deviceManager.xml b/Team414/.idea/deviceManager.xml new file mode 100644 index 0000000..91f9558 --- /dev/null +++ b/Team414/.idea/deviceManager.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/Team414/.idea/gradle.xml b/Team414/.idea/gradle.xml new file mode 100644 index 0000000..97f0a8e --- /dev/null +++ b/Team414/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/Team414/.idea/migrations.xml b/Team414/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/Team414/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/Team414/.idea/misc.xml b/Team414/.idea/misc.xml new file mode 100644 index 0000000..74dd639 --- /dev/null +++ b/Team414/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/Team414/.idea/runConfigurations.xml b/Team414/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/Team414/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/Team414/.idea/vcs.xml b/Team414/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Team414/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Team414/app/.gitignore b/Team414/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Team414/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Team414/app/build.gradle.kts b/Team414/app/build.gradle.kts new file mode 100644 index 0000000..0067327 --- /dev/null +++ b/Team414/app/build.gradle.kts @@ -0,0 +1,59 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + +} + +android { + namespace = "com.example.myapplication" + compileSdk { + version = release(36) + } + + defaultConfig { + applicationId = "com.example.myapplication" + minSdk = 24 + targetSdk = 36 + 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_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.material) + implementation(libs.androidx.activity) + implementation(libs.androidx.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + implementation("com.squareup.retrofit2:retrofit:2.9.0") + implementation("com.squareup.retrofit2:converter-gson:2.9.0") + implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation("com.github.bumptech.glide:glide:4.16.0") + + + + + +} \ No newline at end of file diff --git a/Team414/app/proguard-rules.pro b/Team414/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/Team414/app/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/Team414/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.kt b/Team414/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..e9283cf --- /dev/null +++ b/Team414/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.myapplication + +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.myapplication", appContext.packageName) + } +} \ No newline at end of file diff --git a/Team414/app/src/main/AndroidManifest.xml b/Team414/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..49b414a --- /dev/null +++ b/Team414/app/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/ApiService.kt b/Team414/app/src/main/java/com/example/myapplication/ApiService.kt new file mode 100644 index 0000000..7518b30 --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/ApiService.kt @@ -0,0 +1,24 @@ +package com.example.myapplication + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path + +interface ApiService { + + // 🔥 Rick & Morty (RANDOM CHARACTER) + @GET("api/character/{id}") + fun getCharacter(@Path("id") id: Int): Call + + // 🃏 Card API + @GET("api/deck/new/draw/?count=1") + fun getCard(): Call + + // 🤖 Yes/No API (winner decision) + @GET("api") + fun getDecision(): Call + + // 💀 Insult API (roast) + @GET("generate_insult.php?lang=en&type=json") + fun getInsult(): Call +} \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/Card.kt b/Team414/app/src/main/java/com/example/myapplication/Card.kt new file mode 100644 index 0000000..ced2dd5 --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/Card.kt @@ -0,0 +1,9 @@ +package com.example.myapplication + +data class Card( + val code: String, + val image: String, + val images: Images, + val suit: String, + val value: String +) \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/CardInstance.kt b/Team414/app/src/main/java/com/example/myapplication/CardInstance.kt new file mode 100644 index 0000000..8721540 --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/CardInstance.kt @@ -0,0 +1,17 @@ +package com.example.myapplication + +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory + +object CardInstance { + + private const val BASE_URL = "https://deckofcardsapi.com/" + + val api: ApiService by lazy { + Retrofit.Builder() + .baseUrl(BASE_URL) + .addConverterFactory(GsonConverterFactory.create()) + .build() + .create(ApiService::class.java) + } +} \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/CardResponse.kt b/Team414/app/src/main/java/com/example/myapplication/CardResponse.kt new file mode 100644 index 0000000..fa1cb9c --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/CardResponse.kt @@ -0,0 +1,8 @@ +package com.example.myapplication + +data class CardResponse( + val cards: List, + val deck_id: String, + val remaining: Int, + val success: Boolean +) \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/Character.kt b/Team414/app/src/main/java/com/example/myapplication/Character.kt new file mode 100644 index 0000000..32834d1 --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/Character.kt @@ -0,0 +1,6 @@ +package com.example.myapplication + +data class Character( + val name: String, + val image: String +) \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/Images.kt b/Team414/app/src/main/java/com/example/myapplication/Images.kt new file mode 100644 index 0000000..e88dfbf --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/Images.kt @@ -0,0 +1,6 @@ +package com.example.myapplication + +data class Images( + val png: String, + val svg: String +) \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/Info.kt b/Team414/app/src/main/java/com/example/myapplication/Info.kt new file mode 100644 index 0000000..7084122 --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/Info.kt @@ -0,0 +1,8 @@ +package com.example.myapplication + +data class Info( + val count: Int, + val next: String, + val pages: Int, + val prev: Any +) \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/Insult.kt b/Team414/app/src/main/java/com/example/myapplication/Insult.kt new file mode 100644 index 0000000..5b51bd1 --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/Insult.kt @@ -0,0 +1,12 @@ +package com.example.myapplication + +data class Insult( + val active: String, + val comment: String, + val created: String, + val createdby: String, + val insult: String, + val language: String, + val number: String, + val shown: String +) \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/InsultInstance.kt b/Team414/app/src/main/java/com/example/myapplication/InsultInstance.kt new file mode 100644 index 0000000..d6f04e9 --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/InsultInstance.kt @@ -0,0 +1,17 @@ +package com.example.myapplication + +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory + +object InsultInstance { + + private const val BASE_URL = "https://evilinsult.com/" + + val api: ApiService by lazy { + Retrofit.Builder() + .baseUrl(BASE_URL) + .addConverterFactory(GsonConverterFactory.create()) + .build() + .create(ApiService::class.java) + } +} \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/Location.kt b/Team414/app/src/main/java/com/example/myapplication/Location.kt new file mode 100644 index 0000000..e462faa --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/Location.kt @@ -0,0 +1,6 @@ +package com.example.myapplication + +data class Location( + val name: String, + val url: String +) \ No newline at end of file diff --git a/Team414/app/src/main/java/com/example/myapplication/MainActivity.kt b/Team414/app/src/main/java/com/example/myapplication/MainActivity.kt new file mode 100644 index 0000000..416c1ce --- /dev/null +++ b/Team414/app/src/main/java/com/example/myapplication/MainActivity.kt @@ -0,0 +1,136 @@ +package com.example.myapplication + +import android.os.Bundle +import android.util.Log +import android.widget.* +import androidx.appcompat.app.AppCompatActivity +import com.bumptech.glide.Glide +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response + +class MainActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val c1 = findViewById(R.id.character1) + val c2 = findViewById(R.id.character2) + val img1 = findViewById(R.id.image1) + val img2 = findViewById(R.id.image2) + val winnerText = findViewById(R.id.winner) + val roastText = findViewById(R.id.joke) + val cardText = findViewById(R.id.cardText) + val cardImage = findViewById(R.id.cardImage) + val btn = findViewById