From 5e3f808975f32b5c3e2bd1fdf2fbe57de094b0b6 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Mon, 22 Feb 2021 15:09:55 +0100 Subject: Scrollview added. Some mangas had too long background ans synopsis to fit. Scrollview resolve the issue. --- .../xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'app/src/main/java/xyz') diff --git a/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt b/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt index 32e3457..5950352 100644 --- a/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt +++ b/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt @@ -49,7 +49,7 @@ class DetailTopMangaActivity : AppCompatActivity() { val mangaTitle = intent.getStringExtra(intentMangaTitle) val mangaRank = intent.getStringExtra(intentMangaRank) val mangaScore = intent.getStringExtra(intentMangaScore) - val mangaImage = intent.getStringExtra(intentMangaImageUrl) + val mangaImageUrl = intent.getStringExtra(intentMangaImageUrl) val mangaVolumes = intent.getStringExtra(intentMangaVolumes) val mangaStartDate = intent.getStringExtra(intentMangaStartDate) @@ -71,7 +71,7 @@ class DetailTopMangaActivity : AppCompatActivity() { tvScore.text = mangaScore Glide .with(this) - .load(mangaImage) + .load(mangaImageUrl) .apply(RequestOptions().override(400)) .into(ivImage) @@ -98,17 +98,16 @@ class DetailTopMangaActivity : AppCompatActivity() { makeApiCall(baseUrl, mangaId.toString()) } - } private fun getDataFromCache(mangaId: String): RestMangaResponse? { val jsonManga: String?= sharedPreferences?.getString(mangaId, null) - if(jsonManga == null) { - return null + return if(jsonManga == null) { + null } else { val type: Type = object : TypeToken() {}.type - return gson.fromJson(jsonManga, type) + gson.fromJson(jsonManga, type) } } @@ -167,7 +166,7 @@ class DetailTopMangaActivity : AppCompatActivity() { fun showError(text: String) { Toast.makeText(this, text, Toast.LENGTH_LONG).show() } - fun fieldIsNull(): String{ + private fun fieldIsNull(): String{ return "Unknown" } -- cgit v1.2.3