aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/xyz/adjutor/aniki/topmanga
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/topmanga')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt13
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"
}