diff options
author | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-22 18:47:30 +0100 |
---|---|---|
committer | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-22 18:47:30 +0100 |
commit | b54b731b3333e3e7936a15ccff925ff8a203dd53 (patch) | |
tree | 3cf869121a587417e32b005bc90ef2bda200796c /app/src/main/java/xyz/adjutor/aniki/topmanga | |
parent | 2f9de2df29150d092bfaa46ea93e3aad5496a219 (diff) |
Removed justification and added links.
Justification cropped the text, decided to get rid of it.
Added a url to MAL, it's clickable.
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/topmanga')
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) } |