mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 05:27:28 +01:00
Add ability to copy a genre/tag to clipboard by long-pressing it's chip (#6084)
* Allow copying a genre by long-pressing it's chip * Make chip click listeners nullable, and only attach if not-null
This commit is contained in:
@@ -64,8 +64,9 @@ class MangaSummaryView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun setTags(items: List<String>?, onClick: (item: String) -> Unit) {
|
||||
binding.tagChipsShrunk.setChips(items, onClick)
|
||||
binding.tagChipsExpanded.setChips(items, onClick)
|
||||
listOfNotNull(binding.tagChipsShrunk, binding.tagChipsExpanded).forEach { chips ->
|
||||
chips.setChips(items, onClick) { tag -> context.copyToClipboard(tag, tag) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateExpandState() = binding.apply {
|
||||
|
||||
Reference in New Issue
Block a user