mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-31 19:42:34 +00:00
Align display name of conversation to center when description is empty.
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
a2739b506c
commit
5996699812
@ -7,7 +7,9 @@
|
||||
package com.nextcloud.talk.openconversations.adapters
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -34,9 +36,17 @@ class OpenConversationsAdapter(val user: User, private val onClick: (OpenConvers
|
||||
}
|
||||
|
||||
fun bindItem(conversation: OpenConversation) {
|
||||
val nameTextLayoutParams: RelativeLayout.LayoutParams = itemBinding.nameText.layoutParams as
|
||||
RelativeLayout.LayoutParams
|
||||
|
||||
currentConversation = conversation
|
||||
itemBinding.nameText.text = conversation.displayName
|
||||
itemBinding.descriptionText.text = conversation.description
|
||||
if (conversation.description == "") {
|
||||
itemBinding.descriptionText.visibility = View.GONE
|
||||
nameTextLayoutParams.addRule(RelativeLayout.CENTER_VERTICAL)
|
||||
} else {
|
||||
itemBinding.descriptionText.text = conversation.description
|
||||
}
|
||||
|
||||
// load avatar from server when https://github.com/nextcloud/spreed/issues/9600 is solved
|
||||
// itemBinding.avatarView.loadUserAvatar(user, conversation.displayName, true, false)
|
||||
|
Loading…
Reference in New Issue
Block a user