From 10237c99f06ac9c6f081faa720f3b9e9f2c95cde Mon Sep 17 00:00:00 2001 From: TanishMoral11 Date: Tue, 16 Jul 2024 20:57:02 +0530 Subject: [PATCH] Complete --- app/build.gradle.kts | 2 ++ app/src/main/AndroidManifest.xml | 3 +++ .../main/java/com/example/randommemes/MainActivity.kt | 10 ++++++++++ app/src/main/res/layout/activity_main.xml | 8 ++++---- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 66f65ae..aa3cf26 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -51,4 +51,6 @@ dependencies { implementation ("com.google.code.gson:gson:2.9.1") implementation ("com.squareup.retrofit2:retrofit:2.9.0") implementation("com.squareup.retrofit2:converter-gson:2.9.0") + implementation ("com.github.bumptech.glide:glide:4.16.0") + } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 165a6b6..3d31dbb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,9 @@ + + + , response: Response ) { + + binding.memeAuthor.text = response.body()?.author + binding.memeTitle.text = response.body()?.title + Glide.with(this@MainActivity).load(response.body()?.url).into(binding.memeImage); + progressDialog.dismiss() } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index edca390..d0897f5 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -11,10 +11,10 @@ + android:layout_height="370dp" + android:scaleType="fitCenter" + /> - \ No newline at end of file +