mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
open context search when message was not found or adapter was null
Opening it when adapter was null is a bit hacky but it works (better would be to make sure adapter is not null of course) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
0b40e06f46
commit
971cc79b76
@ -2180,7 +2180,7 @@ class ChatActivity :
|
|||||||
if (position != null && position >= 0) {
|
if (position != null && position >= 0) {
|
||||||
binding.messagesListView.scrollToPosition(position)
|
binding.messagesListView.scrollToPosition(position)
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "message $messageId that should be scrolled to was not found (scrollToMessageWithId)")
|
startContextChatWindowForMessage(messageId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2193,12 +2193,10 @@ class ChatActivity :
|
|||||||
binding.messagesListView.height / 2
|
binding.messagesListView.height / 2
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Log.d(
|
startContextChatWindowForMessage(messageId)
|
||||||
TAG,
|
|
||||||
"message $messageId that should be scrolled to was not found " +
|
|
||||||
"(scrollToAndCenterMessageWithId)"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
} ?: run {
|
||||||
|
startContextChatWindowForMessage(messageId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3190,9 +3188,11 @@ class ChatActivity :
|
|||||||
context.resources.getString(R.string.nc_tomorrow_meeting),
|
context.resources.getString(R.string.nc_tomorrow_meeting),
|
||||||
startDateTime.format(DateTimeFormatter.ofPattern("HH:mm"))
|
startDateTime.format(DateTimeFormatter.ofPattern("HH:mm"))
|
||||||
)
|
)
|
||||||
|
|
||||||
else -> startDateTime.format(DateTimeFormatter.ofPattern("MMM d, yyyy, HH:mm"))
|
else -> startDateTime.format(DateTimeFormatter.ofPattern("MMM d, yyyy, HH:mm"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentTime.isAfter(endDateTime) -> context.resources.getString(R.string.nc_meeting_ended)
|
currentTime.isAfter(endDateTime) -> context.resources.getString(R.string.nc_meeting_ended)
|
||||||
else -> context.resources.getString(R.string.nc_ongoing_meeting)
|
else -> context.resources.getString(R.string.nc_ongoing_meeting)
|
||||||
}
|
}
|
||||||
@ -3655,6 +3655,7 @@ class ChatActivity :
|
|||||||
)
|
)
|
||||||
showSnackBar(roomToken)
|
showSnackBar(roomToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3675,6 +3676,7 @@ class ChatActivity :
|
|||||||
chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||||
startActivity(chatIntent)
|
startActivity(chatIntent)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun openInFilesApp(message: ChatMessage) {
|
fun openInFilesApp(message: ChatMessage) {
|
||||||
val keyID = message.selectedIndividualHashMap!![PreviewMessageViewHolder.KEY_ID]
|
val keyID = message.selectedIndividualHashMap!![PreviewMessageViewHolder.KEY_ID]
|
||||||
val link = message.selectedIndividualHashMap!!["link"]
|
val link = message.selectedIndividualHashMap!!["link"]
|
||||||
|
Loading…
Reference in New Issue
Block a user