aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/xyz/adjutor/aniki/topmanga/DetailTopMangaActivity.kt
blob: 2f0d2c3ab8847b9437cb334b35007e0932ee0e3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package xyz.adjutor.aniki.topmanga

import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R

class DetailTopMangaActivity : AppCompatActivity() {
    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
        Glide
            .with(this)
            .load(mangaImage)
            .apply(RequestOptions().override(400))
            .into(ivImage)
    }
}