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 | |
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')
5 files changed, 50 insertions, 5 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) } 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" /> + /> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView + android:id="@+id/cv_background" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="4sp" @@ -258,15 +258,49 @@ android:id="@+id/tv_background" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:justificationMode="inter_word" android:text="@string/background" android:textColor="@color/slightly_desaturated_magenta" android:textIsSelectable="true" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/tv_text_background" - tools:targetApi="o" /> + app:layout_constraintTop_toBottomOf="@id/tv_text_background" /> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="4sp" + app:cardBackgroundColor="@color/black" + app:layout_constraintTop_toBottomOf="@id/cv_background"> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="10dp"> + + + <TextView + android:id="@+id/tv_text_url" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/text_url" + android:textColor="@color/strong_pink" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/tv_url" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/url" + android:textColor="@color/slightly_desaturated_magenta" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_text_url" + android:autoLink="all" + /> + + </androidx.constraintlayout.widget.ConstraintLayout> + </androidx.cardview.widget.CardView> + </androidx.constraintlayout.widget.ConstraintLayout> </ScrollView>
\ 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 @@ <string name="background">Cras molestie turpis at lorem rutrum vehicula. Fusce rutrum, enim sed laoreet semper, tortor quam semper dui, id bibendum lacus quam vitae neque.</string> <string name="text_synopsis">Synopsis</string> <string name="text_background">Background</string> + <string name="text_url">"More info at"</string> + <string name="url">https://myanimelist.net/media/id/name</string> </resources>
\ No newline at end of file |