summaryrefslogtreecommitdiff
path: root/app/src/main/java/xyz/adjutor/aniki
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt5
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/topmanga/TopManga.kt2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt2
3 files changed, 9 insertions, 0 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 5950352..70e1422 100644
--- a/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt
@@ -38,6 +38,7 @@ class DetailTopMangaActivity : AppCompatActivity() {
private val intentMangaVolumes = "themangavolumes"
private val intentMangaStartDate = "themangastartdate"
private val intentMangaEndDate = "themangaenddate"
+ private val intentMangaUrl = "themangaurl"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -54,6 +55,7 @@ class DetailTopMangaActivity : AppCompatActivity() {
val mangaVolumes = intent.getStringExtra(intentMangaVolumes)
val mangaStartDate = intent.getStringExtra(intentMangaStartDate)
val mangaEndDate = intent.getStringExtra(intentMangaEndDate)
+ val mangaUrl = intent.getStringExtra(intentMangaUrl)
val tvId: TextView = findViewById(R.id.tv_detail_id)
val tvTitle: TextView = findViewById(R.id.tv_detail_title)
@@ -64,6 +66,7 @@ class DetailTopMangaActivity : AppCompatActivity() {
val tvVolumes: TextView = findViewById(R.id.tv_volumes)
val tvStartDate: TextView = findViewById(R.id.tv_start_date)
val tvEndDate: TextView = findViewById(R.id.tv_end_date)
+ val tvUrl: TextView = findViewById(R.id.tv_url)
tvId.text = mangaId
tvTitle.text = mangaTitle
@@ -90,6 +93,8 @@ class DetailTopMangaActivity : AppCompatActivity() {
fieldIsNull()
}
+ tvUrl.text = mangaUrl
+
val manga: RestMangaResponse? = getDataFromCache(mangaId.toString())
if(manga != null ){
showDetail(manga)
diff --git a/app/src/main/java/xyz/adjutor/aniki/topmanga/TopManga.kt b/app/src/main/java/xyz/adjutor/aniki/topmanga/TopManga.kt
index 0f73dd4..05f4692 100644
--- a/app/src/main/java/xyz/adjutor/aniki/topmanga/TopManga.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/topmanga/TopManga.kt
@@ -11,6 +11,8 @@ class TopManga{
var rank: Int? = null
@SerializedName("title")
var title: String? = null
+ @SerializedName("url")
+ var url: String? = null
@SerializedName("volumes")
var volumes: Int? = null
@SerializedName("start_date")
diff --git a/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt b/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt
index c6fde13..d64a744 100644
--- a/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt
@@ -61,6 +61,7 @@ class TopMangaAdapter(val mangaList: List<TopManga>) :
val currentMangaVolumes = "themangavolumes"
val currentMangaStartDate = "themangastartdate"
val currentMangaEndDate = "themangaenddate"
+ val currentMangaUrl = "themangaurl"
val intent: Intent = Intent(holder.itemView.context, DetailTopMangaActivity::class.java).apply {
putExtra(currentMangaId, currentManga.mal_id.toString())
@@ -71,6 +72,7 @@ class TopMangaAdapter(val mangaList: List<TopManga>) :
putExtra(currentMangaVolumes, currentManga.volumes.toString())
putExtra(currentMangaStartDate, currentManga.start_date)
putExtra(currentMangaEndDate, currentManga.end_date.toString())
+ putExtra(currentMangaUrl, currentManga.url.toString())
}
holder.itemView.context.startActivity(intent)
}