From 13fdfd28b10cdac6e5b901d3947ba02fa744df4b Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Fri, 19 Feb 2021 20:33:21 +0100 Subject: Adding scores to the recyclerview layout. --- .../java/xyz/adjutor/aniki/topanime/TopAnimeAdapter.kt | 2 ++ .../java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt | 2 ++ app/src/main/res/layout/item_layout.xml | 13 ++++++++++++- app/src/main/res/values/strings.xml | 16 +--------------- 4 files changed, 17 insertions(+), 16 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/xyz/adjutor/aniki/topanime/TopAnimeAdapter.kt b/app/src/main/java/xyz/adjutor/aniki/topanime/TopAnimeAdapter.kt index a036c15..68a2c7b 100644 --- a/app/src/main/java/xyz/adjutor/aniki/topanime/TopAnimeAdapter.kt +++ b/app/src/main/java/xyz/adjutor/aniki/topanime/TopAnimeAdapter.kt @@ -24,6 +24,7 @@ class TopAnimeAdapter(val animeList: List) : class AnimeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val animeTitle: TextView = itemView.findViewById(R.id.tv_title) val animeRank: TextView = itemView.findViewById(R.id.tv_rank) + val animeScore: TextView = itemView.findViewById(R.id.tv_score) val animeImage: ImageView = itemView.findViewById(R.id.iv_image) } @@ -46,6 +47,7 @@ class TopAnimeAdapter(val animeList: List) : val currentAnime: TopAnime = animeList[position] holder.animeTitle.text = currentAnime.title holder.animeRank.text = currentAnime.rank.toString() + holder.animeScore.text = currentAnime.score.toString() DownloadImageFromInternet(holder.animeImage).execute(currentAnime.image_url) } 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 18fd7a0..22872b2 100644 --- a/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt +++ b/app/src/main/java/xyz/adjutor/aniki/topmanga/TopMangaAdapter.kt @@ -22,6 +22,7 @@ class TopMangaAdapter(val mangaList: List) : class MangaViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val mangaTitle: TextView = itemView.findViewById(R.id.tv_title) val mangaRank: TextView = itemView.findViewById(R.id.tv_rank) + val mangaScore: TextView = itemView.findViewById(R.id.tv_score) val mangaImage: ImageView = itemView.findViewById(R.id.iv_image) } @@ -44,6 +45,7 @@ class TopMangaAdapter(val mangaList: List) : val currentManga: TopManga = mangaList[position] holder.mangaTitle.text = currentManga.title holder.mangaRank.text = currentManga.rank.toString() + holder.mangaScore.text = currentManga.score.toString() DownloadImageFromInternet(holder.mangaImage).execute(currentManga.image_url) } diff --git a/app/src/main/res/layout/item_layout.xml b/app/src/main/res/layout/item_layout.xml index 32bea24..8d7a792 100644 --- a/app/src/main/res/layout/item_layout.xml +++ b/app/src/main/res/layout/item_layout.xml @@ -26,7 +26,7 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - android:src="@mipmap/ic_launcher_round" + android:src="@mipmap/ic_launcher" android:contentDescription="@string/rv_image" /> + \ 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 403a883..636de76 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,20 +18,6 @@ Image of manga Top Anime Page Top Anime - - - Dragon Ball - Naruto - Fairy Tail - Shokugeki no Souma - Ajin - Komi-san no Komyushu - Hunter x Hunter - Detective Conan - Swortd Art Online - Scumbag Loser - Ana Satsujin - Samurai Deeper Kyou - + 00.00 \ No newline at end of file -- cgit v1.2.3