diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..a1cd3ba --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/PhantomTroupe/.gitignore b/PhantomTroupe/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/PhantomTroupe/.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/PhantomTroupe/.idea/.gitignore b/PhantomTroupe/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/PhantomTroupe/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/PhantomTroupe/.idea/AndroidProjectSystem.xml b/PhantomTroupe/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/PhantomTroupe/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/PhantomTroupe/.idea/compiler.xml b/PhantomTroupe/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/PhantomTroupe/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PhantomTroupe/.idea/deploymentTargetSelector.xml b/PhantomTroupe/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..ca16a99 --- /dev/null +++ b/PhantomTroupe/.idea/deploymentTargetSelector.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/PhantomTroupe/.idea/gradle.xml b/PhantomTroupe/.idea/gradle.xml new file mode 100644 index 0000000..cdbc250 --- /dev/null +++ b/PhantomTroupe/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/PhantomTroupe/.idea/misc.xml b/PhantomTroupe/.idea/misc.xml new file mode 100644 index 0000000..74dd639 --- /dev/null +++ b/PhantomTroupe/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/PhantomTroupe/.idea/runConfigurations.xml b/PhantomTroupe/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/PhantomTroupe/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/PhantomTroupe/.idea/vcs.xml b/PhantomTroupe/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/PhantomTroupe/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PhantomTroupe/app/.gitignore b/PhantomTroupe/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/PhantomTroupe/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/PhantomTroupe/app/build.gradle.kts b/PhantomTroupe/app/build.gradle.kts new file mode 100644 index 0000000..a65f05c --- /dev/null +++ b/PhantomTroupe/app/build.gradle.kts @@ -0,0 +1,50 @@ +plugins { + alias(libs.plugins.android.application) +} + +android { + namespace = "com.example.phantomtroupe" + compileSdk { + version = release(36) { + minorApiLevel = 1 + } + } + + defaultConfig { + applicationId = "com.example.phantomtroupe" + 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 + } +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.material) + implementation(libs.androidx.activity) + implementation(libs.androidx.constraintlayout) + implementation("com.squareup.retrofit2:retrofit:2.9.0") + implementation("com.squareup.retrofit2:converter-gson:2.9.0") + implementation("com.squareup.picasso:picasso:2.8") + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) +} \ No newline at end of file diff --git a/PhantomTroupe/app/proguard-rules.pro b/PhantomTroupe/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/PhantomTroupe/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/PhantomTroupe/app/src/androidTest/java/com/example/phantomtroupe/ExampleInstrumentedTest.kt b/PhantomTroupe/app/src/androidTest/java/com/example/phantomtroupe/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..182670a --- /dev/null +++ b/PhantomTroupe/app/src/androidTest/java/com/example/phantomtroupe/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.phantomtroupe + +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.phantomtroupe", appContext.packageName) + } +} \ No newline at end of file diff --git a/PhantomTroupe/app/src/main/AndroidManifest.xml b/PhantomTroupe/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..702d239 --- /dev/null +++ b/PhantomTroupe/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/AdviceResponse.kt b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/AdviceResponse.kt new file mode 100644 index 0000000..3945b90 --- /dev/null +++ b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/AdviceResponse.kt @@ -0,0 +1,4 @@ +package com.example.phantomtroupe + +data class AdviceSlip(val advice: String) +data class AdviceResponse(val slip: AdviceSlip) \ No newline at end of file diff --git a/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/ApiService.kt b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/ApiService.kt new file mode 100644 index 0000000..026623e --- /dev/null +++ b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/ApiService.kt @@ -0,0 +1,13 @@ +package com.example.phantomtroupe + +import retrofit2.Call +import retrofit2.http.GET + +interface ApiService { + // Fetches products - we will pick a random one from the list + @GET("https://dummyjson.com/products") + fun getCareers(): Call + + @GET("https://api.adviceslip.com/advice") + fun getAdvice(): Call +} \ No newline at end of file diff --git a/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/CareerResponse.kt b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/CareerResponse.kt new file mode 100644 index 0000000..cef18ab --- /dev/null +++ b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/CareerResponse.kt @@ -0,0 +1,4 @@ +package com.example.phantomtroupe + +data class Product(val title: String) +data class CareerResponse(val products: List) \ No newline at end of file diff --git a/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/MainActivity.kt b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/MainActivity.kt new file mode 100644 index 0000000..a01a491 --- /dev/null +++ b/PhantomTroupe/app/src/main/java/com/example/phantomtroupe/MainActivity.kt @@ -0,0 +1,60 @@ +package com.example.phantomtroupe + +import android.os.Bundle +import android.view.View +import android.widget.* +import androidx.appcompat.app.AppCompatActivity +import com.squareup.picasso.Picasso +import retrofit2.* +import retrofit2.converter.gson.GsonConverterFactory +import kotlin.random.Random + +class MainActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val nameInput = findViewById(R.id.nameInput) + val btnFindJob = findViewById