mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-09 23:53:04 +00:00
fix shimmer and "offlineNoMessages"-info handling
when being offline and no messages are set -> hide shimmer when messages are received -> hide shimmer and "offlineNoMessages"-info Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
7d0c6d67c7
commit
3330fc8210
@ -828,12 +828,15 @@ class ChatActivity :
|
|||||||
// Handle UI on first load
|
// Handle UI on first load
|
||||||
cancelNotificationsForCurrentConversation()
|
cancelNotificationsForCurrentConversation()
|
||||||
binding.progressBar.visibility = View.GONE
|
binding.progressBar.visibility = View.GONE
|
||||||
|
binding.offline.root.visibility = View.GONE
|
||||||
binding.messagesListView.visibility = View.VISIBLE
|
binding.messagesListView.visibility = View.VISIBLE
|
||||||
collapseSystemMessages()
|
collapseSystemMessages()
|
||||||
}
|
}
|
||||||
|
|
||||||
is ChatViewModel.ChatMessageUpdateState -> {
|
is ChatViewModel.ChatMessageUpdateState -> {
|
||||||
// unused atm
|
binding.progressBar.visibility = View.GONE
|
||||||
|
binding.offline.root.visibility = View.GONE
|
||||||
|
binding.messagesListView.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
is ChatViewModel.ChatMessageErrorState -> {
|
is ChatViewModel.ChatMessageErrorState -> {
|
||||||
@ -918,9 +921,9 @@ class ChatActivity :
|
|||||||
chatViewModel.getGeneralUIFlow.onEach { key ->
|
chatViewModel.getGeneralUIFlow.onEach { key ->
|
||||||
when (key) {
|
when (key) {
|
||||||
NO_OFFLINE_MESSAGES_FOUND -> {
|
NO_OFFLINE_MESSAGES_FOUND -> {
|
||||||
if (networkMonitor.isOnline.value.not()) {
|
binding.progressBar.visibility = View.GONE
|
||||||
binding.offline.root.visibility = View.VISIBLE
|
binding.messagesListView.visibility = View.GONE
|
||||||
}
|
binding.offline.root.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
|
@ -157,7 +157,9 @@ class OfflineFirstChatRepository @Inject constructor(
|
|||||||
} else {
|
} else {
|
||||||
if (!weAlreadyHaveSomeOfflineMessages) {
|
if (!weAlreadyHaveSomeOfflineMessages) {
|
||||||
Log.d(TAG, "An online request for newest 100 messages is made because offline chat is empty")
|
Log.d(TAG, "An online request for newest 100 messages is made because offline chat is empty")
|
||||||
_generalUIFlow.emit(ChatActivity.NO_OFFLINE_MESSAGES_FOUND)
|
if (networkMonitor.isOnline.value.not()) {
|
||||||
|
_generalUIFlow.emit(ChatActivity.NO_OFFLINE_MESSAGES_FOUND)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.d(
|
Log.d(
|
||||||
TAG,
|
TAG,
|
||||||
|
Loading…
Reference in New Issue
Block a user