mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 19:36:08 +03:00
Adding header section only when necessary
This commit is contained in:
parent
37a990368c
commit
96ed30ccc4
1 changed files with 9 additions and 3 deletions
|
@ -88,12 +88,18 @@ class AutocompleteMemberPresenter @AssistedInject constructor(context: Context,
|
|||
|
||||
val items = mutableListOf<AutocompleteMemberItem>().apply {
|
||||
if (members.isNotEmpty()) {
|
||||
add(membersHeader)
|
||||
if (everyone != null) {
|
||||
// add header only when there is everyone tag as well
|
||||
add(membersHeader)
|
||||
}
|
||||
addAll(members)
|
||||
}
|
||||
everyone?.let {
|
||||
val everyoneHeader = createEveryoneHeader()
|
||||
add(everyoneHeader)
|
||||
if (members.isNotEmpty()) {
|
||||
// add header only when there are members as well
|
||||
val everyoneHeader = createEveryoneHeader()
|
||||
add(everyoneHeader)
|
||||
}
|
||||
add(it)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue