aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/xyz/adjutor/aniki/topmanga
diff options
context:
space:
mode:
authorClyhtsuriva <aimeric@adjutor.xyz>2021-02-20 18:56:42 +0100
committerClyhtsuriva <aimeric@adjutor.xyz>2021-02-20 18:56:42 +0100
commit7c8476a2128f6c4494eaa2d0a363d8cbe3261ba6 (patch)
tree966591a50dd3672209cfac6cb9d3f28e5e6074d0 /app/src/main/java/xyz/adjutor/aniki/topmanga
parent7bc4fe28dd31176c50495b2f3b0ba5a51eca6d9e (diff)
Beginning the manga api part.
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/topmanga')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt13
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt4
2 files changed, 11 insertions, 6 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 e97ee39..2f0d2c3 100644
--- a/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt
@@ -9,26 +9,29 @@ import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
class DetailTopMangaActivity : AppCompatActivity() {
-
- private val currentMangaTitle: String = "themangatitle"
- val currentMangaRank: String = "themangarank"
- val currentMangaScore: String = "themangascore"
- val currentMangaImageUrl: String = "themangaimageurl"
+ private val currentMangaId = "themangaid"
+ private val currentMangaTitle = "themangatitle"
+ private val currentMangaRank = "themangarank"
+ private val currentMangaScore = "themangascore"
+ private val currentMangaImageUrl = "themangaimageurl"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_detail_top_manga)
+ val mangaId = intent.getStringExtra(currentMangaId)
val mangaTitle = intent.getStringExtra(currentMangaTitle)
val mangaRank = intent.getStringExtra(currentMangaRank)
val mangaScore = intent.getStringExtra(currentMangaScore)
val mangaImage = intent.getStringExtra(currentMangaImageUrl)
+ val tvId: TextView = findViewById(R.id.tv_detail_id)
val tvTitle: TextView = findViewById(R.id.tv_detail_title)
val tvRank: TextView = findViewById(R.id.tv_detail_rank)
val tvScore: TextView = findViewById(R.id.tv_detail_score)
val ivImage: ImageView = findViewById(R.id.iv_detail_image)
+ tvId.text = mangaId
tvTitle.text = mangaTitle
tvRank.text = mangaRank
tvScore.text = mangaScore
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 2eaf958..e46fc79 100644
--- a/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt
@@ -53,14 +53,16 @@ class TopMangaAdapter(val mangaList: List<TopManga>) :
.apply(RequestOptions().override(400))
.into(holder.mangaImage)
- //to go to a detail page of the selected manga
+ //to go to the detail page of the selected manga
holder.cardview.setOnClickListener {
+ val currentMangaId = "themangaid"
val currentMangaTitle = "themangatitle"
val currentMangaRank = "themangarank"
val currentMangaScore = "themangascore"
val currentMangaImageUrl = "themangaimageurl"
val intent: Intent = Intent(holder.itemView.context, DetailTopMangaActivity::class.java).apply {
+ putExtra(currentMangaId, currentManga.mal_id.toString())
putExtra(currentMangaTitle, currentManga.title)
putExtra(currentMangaRank, currentManga.rank.toString())
putExtra(currentMangaScore, currentManga.score.toString())