Show manga source in details

This commit is contained in:
Koitharu
2021-01-24 08:53:04 +02:00
parent 85c424580a
commit 5cbc592d23
3 changed files with 18 additions and 1 deletions

View File

@@ -97,6 +97,12 @@ class DetailsFragment : BaseFragment<FragmentDetailsBinding>(), View.OnClickList
)
}
}
} ?: chipsTags.addChips(listOf(manga.source)) {
create(
text = it.title,
iconRes = R.drawable.ic_chip_web,
tag = it
)
}
imageViewFavourite.setOnClickListener(this@DetailsFragment)
buttonRead.setOnClickListener(this@DetailsFragment)

View File

@@ -47,7 +47,7 @@ var TextView.textAndVisible: CharSequence?
isGone = value.isNullOrEmpty()
}
fun <T> ChipGroup.addChips(data: Iterable<T>, action: ChipsFactory.(T) -> Chip) {
inline fun <T> ChipGroup.addChips(data: Iterable<T>, action: ChipsFactory.(T) -> Chip) {
val factory = ChipsFactory(context)
data.forEach {
val chip = factory.action(it)