aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt13
-rw-r--r--app/src/main/res/layout/activity_detail_top_manga.xml15
2 files changed, 15 insertions, 13 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"
}
diff --git a/app/src/main/res/layout/activity_detail_top_manga.xml b/app/src/main/res/layout/activity_detail_top_manga.xml
index f5ce8b9..655b687 100644
--- a/app/src/main/res/layout/activity_detail_top_manga.xml
+++ b/app/src/main/res/layout/activity_detail_top_manga.xml
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
+<ScrollView android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:background="@color/very_dark_purple">
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
tools:context=".topmanga.DetailTopMangaActivity"
- android:background="@color/very_dark_purple">
+ >
<androidx.cardview.widget.CardView
android:id="@+id/cv_header"
android:layout_width="match_parent"
@@ -53,7 +56,7 @@
android:text="@string/title"
android:textAlignment="center"
android:textColor="@color/strong_pink"
- android:textSize="40sp"
+ android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_detail_image"
@@ -262,5 +265,5 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
-
</androidx.constraintlayout.widget.ConstraintLayout>
+</ScrollView> \ No newline at end of file