Skip to content

Commit

Permalink
Fixes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharkaboi committed Dec 23, 2021
1 parent f1c4ac4 commit 82b0d7e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ data class AnimeByIDResponse(
@Json(name = "end_date")
val endDate: String?,
@Json(name = "genres")
val genres: List<Genre>,
val genres: List<Genre>?,
@Json(name = "id")
val id: Int,
@Json(name = "main_picture")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data class MangaByIDResponse(
@Json(name = "end_date")
val endDate: String?,
@Json(name = "genres")
val genres: List<Genre>,
val genres: List<Genre>?,
@Json(name = "id")
val id: Int,
@Json(name = "main_picture")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import com.sharkaboi.mediahub.databinding.FragmentAnimeDetailsBinding
import com.sharkaboi.mediahub.modules.anime_details.adapters.RecommendedAnimeAdapter
import com.sharkaboi.mediahub.modules.anime_details.adapters.RelatedAnimeAdapter
import com.sharkaboi.mediahub.modules.anime_details.adapters.RelatedMangaAdapter
import com.sharkaboi.mediahub.modules.anime_details.util.AnimeDetailsUpdateClass
import com.sharkaboi.mediahub.modules.anime_details.util.*
import com.sharkaboi.mediahub.modules.anime_details.vm.AnimeDetailsState
import com.sharkaboi.mediahub.modules.anime_details.vm.AnimeDetailsViewModel
Expand Down Expand Up @@ -344,10 +343,10 @@ class AnimeDetailsFragment : Fragment() {
setupGenresChipGroup(animeByIDResponse.genres)
}

private fun setupGenresChipGroup(genres: List<AnimeByIDResponse.Genre>) {
private fun setupGenresChipGroup(genres: List<AnimeByIDResponse.Genre>?) {
val chipGroup = binding.otherDetails.genresChipGroup
chipGroup.removeAllViews()
if (genres.isEmpty()) {
if (genres.isNullOrEmpty()) {
val naChip = Chip(context)
naChip.setMediaHubChipStyle()
naChip.text = getString(R.string.n_a)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ class MangaDetailsFragment : Fragment() {
setupGenresChipGroup(mangaByIDResponse.genres)
}

private fun setupGenresChipGroup(genres: List<MangaByIDResponse.Genre>) {
private fun setupGenresChipGroup(genres: List<MangaByIDResponse.Genre>?) {
val chipGroup = binding.otherDetails.genresChipGroup
chipGroup.removeAllViews()
if (genres.isEmpty()) {
if (genres.isNullOrEmpty()) {
val naChip = Chip(context)
naChip.setMediaHubChipStyle()
naChip.text = getString(R.string.n_a)
Expand Down

0 comments on commit 82b0d7e

Please sign in to comment.