mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 22:29:09 +00:00
remove flickering of status icons
by moving networkMonitor.isOnline to separate check and by setting binding.checkMark.visibility = View.INVISIBLE binding.sendingProgress.visibility = View.GONE before setting the status icons to to handle recyclerview behavior Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
f665b1c116
commit
1731ca0985
@ -120,26 +120,31 @@ class OutcomingTextMessageViewHolder(itemView: View) :
|
||||
binding.messageQuote.quotedChatMessageView.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.checkMark.visibility = View.INVISIBLE
|
||||
binding.sendingProgress.visibility = View.GONE
|
||||
|
||||
if (message.sendingFailed) {
|
||||
updateStatus(
|
||||
R.drawable.baseline_report_problem_24,
|
||||
"failed"
|
||||
)
|
||||
binding.bubble.setOnClickListener {
|
||||
commonMessageInterface.onOpenMessageActionsDialog(message)
|
||||
}
|
||||
} else if (message.isTemporary) {
|
||||
showSendingSpinner()
|
||||
} else if (message.readStatus == ReadStatus.READ) {
|
||||
updateStatus(R.drawable.ic_check_all, context.resources?.getString(R.string.nc_message_read))
|
||||
} else if (message.readStatus == ReadStatus.SENT) {
|
||||
updateStatus(R.drawable.ic_check, context.resources?.getString(R.string.nc_message_sent))
|
||||
}
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
if (message.isTemporary && !networkMonitor.isOnline.first()) {
|
||||
updateStatus(
|
||||
R.drawable.ic_signal_wifi_off_white_24dp,
|
||||
"offline"
|
||||
)
|
||||
} else if (message.sendingFailed) {
|
||||
updateStatus(
|
||||
R.drawable.baseline_report_problem_24,
|
||||
"failed"
|
||||
)
|
||||
binding.bubble.setOnClickListener {
|
||||
commonMessageInterface.onOpenMessageActionsDialog(message)
|
||||
}
|
||||
} else if (message.isTemporary) {
|
||||
showSendingSpinner()
|
||||
} else if (message.readStatus == ReadStatus.READ) {
|
||||
updateStatus(R.drawable.ic_check_all, context.resources?.getString(R.string.nc_message_read))
|
||||
} else if (message.readStatus == ReadStatus.SENT) {
|
||||
updateStatus(R.drawable.ic_check, context.resources?.getString(R.string.nc_message_sent))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user