Adding header section only when necessary
This commit is contained in:
parent
37a990368c
commit
96ed30ccc4
|
@ -88,12 +88,18 @@ class AutocompleteMemberPresenter @AssistedInject constructor(context: Context,
|
||||||
|
|
||||||
val items = mutableListOf<AutocompleteMemberItem>().apply {
|
val items = mutableListOf<AutocompleteMemberItem>().apply {
|
||||||
if (members.isNotEmpty()) {
|
if (members.isNotEmpty()) {
|
||||||
|
if (everyone != null) {
|
||||||
|
// add header only when there is everyone tag as well
|
||||||
add(membersHeader)
|
add(membersHeader)
|
||||||
|
}
|
||||||
addAll(members)
|
addAll(members)
|
||||||
}
|
}
|
||||||
everyone?.let {
|
everyone?.let {
|
||||||
|
if (members.isNotEmpty()) {
|
||||||
|
// add header only when there are members as well
|
||||||
val everyoneHeader = createEveryoneHeader()
|
val everyoneHeader = createEveryoneHeader()
|
||||||
add(everyoneHeader)
|
add(everyoneHeader)
|
||||||
|
}
|
||||||
add(it)
|
add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue