From b54b731b3333e3e7936a15ccff925ff8a203dd53 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Mon, 22 Feb 2021 18:47:30 +0100 Subject: Removed justification and added links. Justification cropped the text, decided to get rid of it. Added a url to MAL, it's clickable. --- .../aniki/topmanga/DetailTopMangaActivity.kt | 5 +++ .../java/xyz/adjutor/aniki/topmanga/TopManga.kt | 2 + .../xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt | 2 + .../main/res/layout/activity_detail_top_manga.xml | 44 +++++++++++++++++++--- app/src/main/res/values/strings.xml | 2 + 5 files changed, 50 insertions(+), 5 deletions(-) (limited to 'app/src/main') 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) : 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) : 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) } 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 dfeb8ba..6d069c9 100644 --- a/app/src/main/res/layout/activity_detail_top_manga.xml +++ b/app/src/main/res/layout/activity_detail_top_manga.xml @@ -222,18 +222,18 @@ android:id="@+id/tv_synopsis" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:justificationMode="inter_word" android:text="@string/synopsis" android:textColor="@color/slightly_desaturated_magenta" android:textIsSelectable="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_text_synopsis" - tools:targetApi="o" /> + /> + app:layout_constraintTop_toBottomOf="@id/tv_text_background" /> + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 311e39b..a730c17 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -31,5 +31,7 @@ Cras molestie turpis at lorem rutrum vehicula. Fusce rutrum, enim sed laoreet semper, tortor quam semper dui, id bibendum lacus quam vitae neque. Synopsis Background + "More info at" + https://myanimelist.net/media/id/name \ No newline at end of file -- cgit v1.2.3