Cleanup view extensions
This commit is contained in:
parent
d63eae4444
commit
9f2e582281
@ -27,7 +27,11 @@ fun ChipGroup.setChipsExtended(items: List<String>?, onClick: (item: String) ->
|
||||
fun makeSearchChip(item: String, onClick: (item: String) -> Unit = {}, onLongClick: (item: String) -> Unit = {}, sourceId: Long, context: Context, namespace: String? = null, type: Int? = null): Chip {
|
||||
return Chip(context).apply {
|
||||
text = item
|
||||
val search = (if (namespace != null) SourceTagsUtil.getWrappedTag(sourceId, namespace = namespace, tag = item) else SourceTagsUtil.getWrappedTag(sourceId, fullTag = item)) ?: item
|
||||
val search = if (namespace != null) {
|
||||
SourceTagsUtil.getWrappedTag(sourceId, namespace = namespace, tag = item)
|
||||
} else {
|
||||
SourceTagsUtil.getWrappedTag(sourceId, fullTag = item)
|
||||
} ?: item
|
||||
setOnClickListener { onClick(search) }
|
||||
setOnLongClickListener {
|
||||
onLongClick(search)
|
||||
|
Loading…
x
Reference in New Issue
Block a user