diff options
author | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-22 15:09:55 +0100 |
---|---|---|
committer | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-22 15:09:55 +0100 |
commit | 5e3f808975f32b5c3e2bd1fdf2fbe57de094b0b6 (patch) | |
tree | 52e5940f60b867538c8400e245277b211101fb70 /app/src/main/java/xyz/adjutor/aniki/topmanga | |
parent | 9ee5918fa86da6c160145498b1a95f4f4a083fdc (diff) |
Scrollview added.
Some mangas had too long background ans synopsis to fit.
Scrollview resolve the issue.
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/topmanga')
-rw-r--r-- | app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt | 13 |
1 files changed, 6 insertions, 7 deletions
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<RestMangaResponse>() {}.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" } |