Skip to content

Commit

Permalink
collapse by clicking children
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
  • Loading branch information
mahibi committed Aug 31, 2023
1 parent 4a91bfe commit 7098e78
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,15 @@ class SystemMessageViewHolder(itemView: View) : MessageHolders.IncomingTextMessa
binding.expandCollapseIcon.setImageDrawable(
ContextCompat.getDrawable(context!!, R.drawable.baseline_unfold_more_24)
)
binding.systemMessageLayout.setOnClickListener {
systemMessageInterface.expandSystemMessage(message)
}
binding.messageText.setOnClickListener {
systemMessageInterface.expandSystemMessage(message)
}
binding.systemMessageLayout.setOnClickListener { systemMessageInterface.expandSystemMessage(message) }
binding.messageText.setOnClickListener { systemMessageInterface.expandSystemMessage(message) }
} else {
binding.messageText.text = messageString
binding.expandCollapseIcon.setImageDrawable(
ContextCompat.getDrawable(context!!, R.drawable.baseline_unfold_less_24)
)
binding.systemMessageLayout.setOnClickListener {
systemMessageInterface.collapseSystemMessages()
}
binding.messageText.setOnClickListener {
systemMessageInterface.collapseSystemMessages()
}
binding.systemMessageLayout.setOnClickListener { systemMessageInterface.collapseSystemMessages() }
binding.messageText.setOnClickListener { systemMessageInterface.collapseSystemMessages() }
}
} else if (message.hiddenByCollapse) {
binding.systemMessageLayout.visibility = View.GONE
Expand All @@ -134,9 +126,10 @@ class SystemMessageViewHolder(itemView: View) : MessageHolders.IncomingTextMessa
binding.systemMessageLayout.setOnClickListener(null)
}

// if (!message.expandableParent && message.lastExpandedItemOfGroup != 0) {
// binding.systemMessageLayout.setOnClickListener { systemMessageInterface.collapseSystemMessages() }
// }
if (!message.expandableParent && message.lastItemOfExpandableGroup != 0) {
binding.systemMessageLayout.setOnClickListener { systemMessageInterface.collapseSystemMessages() }
binding.messageText.setOnClickListener { systemMessageInterface.collapseSystemMessages() }
}

binding.messageTime.text = dateUtils!!.getLocalTimeStringFromTimestamp(message.timestamp)
itemView.setTag(R.string.replyable_message_view_tag, message.replyable)
Expand Down

0 comments on commit 7098e78

Please sign in to comment.