mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
make snackbar clickable
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
e920a79b9c
commit
4ec2cb8e7a
@ -2906,6 +2906,12 @@ class ChatActivity :
|
|||||||
searchItem.isVisible = CapabilitiesUtil.isUnifiedSearchAvailable(spreedCapabilities) &&
|
searchItem.isVisible = CapabilitiesUtil.isUnifiedSearchAvailable(spreedCapabilities) &&
|
||||||
currentConversation!!.remoteServer.isNullOrEmpty()
|
currentConversation!!.remoteServer.isNullOrEmpty()
|
||||||
|
|
||||||
|
if (currentConversation!!.remoteServer != null ||
|
||||||
|
!CapabilitiesUtil.isSharedItemsAvailable(spreedCapabilities)
|
||||||
|
) {
|
||||||
|
menu.removeItem(R.id.shared_items)
|
||||||
|
}
|
||||||
|
|
||||||
if (CapabilitiesUtil.isAbleToCall(spreedCapabilities)) {
|
if (CapabilitiesUtil.isAbleToCall(spreedCapabilities)) {
|
||||||
conversationVoiceCallMenuItem = menu.findItem(R.id.conversation_voice_call)
|
conversationVoiceCallMenuItem = menu.findItem(R.id.conversation_voice_call)
|
||||||
conversationVideoMenuItem = menu.findItem(R.id.conversation_video_call)
|
conversationVideoMenuItem = menu.findItem(R.id.conversation_video_call)
|
||||||
@ -3583,6 +3589,11 @@ class ChatActivity :
|
|||||||
ChatMessage.MessageType.VOICE_MESSAGE -> {
|
ChatMessage.MessageType.VOICE_MESSAGE -> {
|
||||||
uploadFile(shareUri.toString(), true, token = roomToken)
|
uploadFile(shareUri.toString(), true, token = roomToken)
|
||||||
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
||||||
|
val snackBar = Snackbar.make(binding.root, R.string.nc_message_sent, Snackbar.LENGTH_LONG)
|
||||||
|
snackBar.view.setOnClickListener {
|
||||||
|
openNoteToSelfConversation(roomToken)
|
||||||
|
}
|
||||||
|
snackBar.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatMessage.MessageType.SINGLE_NC_ATTACHMENT_MESSAGE -> {
|
ChatMessage.MessageType.SINGLE_NC_ATTACHMENT_MESSAGE -> {
|
||||||
@ -3592,6 +3603,11 @@ class ChatActivity :
|
|||||||
context.contentResolver.openInputStream(shareUri)?.close()
|
context.contentResolver.openInputStream(shareUri)?.close()
|
||||||
uploadFile(shareUri.toString(), false, caption!!, roomToken)
|
uploadFile(shareUri.toString(), false, caption!!, roomToken)
|
||||||
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
||||||
|
val snackBar = Snackbar.make(binding.root, R.string.nc_message_sent, Snackbar.LENGTH_LONG)
|
||||||
|
snackBar.view.setOnClickListener {
|
||||||
|
openNoteToSelfConversation(roomToken)
|
||||||
|
}
|
||||||
|
snackBar.show()
|
||||||
} catch (e: java.lang.Exception) {
|
} catch (e: java.lang.Exception) {
|
||||||
Log.w(TAG, "File corresponding to the uri does not exist $shareUri")
|
Log.w(TAG, "File corresponding to the uri does not exist $shareUri")
|
||||||
downloadFileToCache(message, false) {
|
downloadFileToCache(message, false) {
|
||||||
@ -3601,6 +3617,11 @@ class ChatActivity :
|
|||||||
R.string.nc_message_added_to_notes,
|
R.string.nc_message_added_to_notes,
|
||||||
Snackbar.LENGTH_SHORT
|
Snackbar.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
|
val snackBar = Snackbar.make(binding.root, R.string.nc_message_sent, Snackbar.LENGTH_LONG)
|
||||||
|
snackBar.view.setOnClickListener {
|
||||||
|
openNoteToSelfConversation(roomToken)
|
||||||
|
}
|
||||||
|
snackBar.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3616,6 +3637,11 @@ class ChatActivity :
|
|||||||
metaData
|
metaData
|
||||||
)
|
)
|
||||||
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
||||||
|
val snackBar = Snackbar.make(binding.root, R.string.nc_message_sent, Snackbar.LENGTH_LONG)
|
||||||
|
snackBar.view.setOnClickListener {
|
||||||
|
openNoteToSelfConversation(roomToken)
|
||||||
|
}
|
||||||
|
snackBar.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatMessage.MessageType.REGULAR_TEXT_MESSAGE -> {
|
ChatMessage.MessageType.REGULAR_TEXT_MESSAGE -> {
|
||||||
@ -3627,12 +3653,24 @@ class ChatActivity :
|
|||||||
conversationUser!!.displayName!!
|
conversationUser!!.displayName!!
|
||||||
)
|
)
|
||||||
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
Snackbar.make(binding.root, R.string.nc_message_added_to_notes, Snackbar.LENGTH_SHORT).show()
|
||||||
|
val snackBar = Snackbar.make(binding.root, R.string.nc_message_sent, Snackbar.LENGTH_LONG)
|
||||||
|
snackBar.view.setOnClickListener {
|
||||||
|
openNoteToSelfConversation(roomToken)
|
||||||
|
}
|
||||||
|
snackBar.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun openNoteToSelfConversation(noteToSelfRoomToken:String){
|
||||||
|
val bundle = Bundle()
|
||||||
|
bundle.putString(KEY_ROOM_TOKEN, noteToSelfRoomToken)
|
||||||
|
val chatIntent = Intent(context, ChatActivity::class.java)
|
||||||
|
chatIntent.putExtras(bundle)
|
||||||
|
chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||||
|
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