From 289a2b14cd9754ea1a5b2873e090dbb8a52fbf54 Mon Sep 17 00:00:00 2001 From: rapterjet2004 Date: Wed, 6 Nov 2024 10:02:21 -0600 Subject: [PATCH] Got stuff set up Signed-off-by: rapterjet2004 --- .../com/nextcloud/talk/chat/ChatActivity.kt | 26 ++++--- .../talk/chat/MessageInputFragment.kt | 13 ++++ .../main/res/layout/call_started_message.xml | 11 ++- .../res/layout/fragment_message_input.xml | 70 +++++++++++-------- 4 files changed, 78 insertions(+), 42 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index 08103488ce..fb8965d31b 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -3546,15 +3546,21 @@ class ChatActivity : when (recent.systemMessageType) { ChatMessage.SystemMessageType.CALL_STARTED -> { // add CallStartedMessage with id -2 if (!callStarted) { - val callStartedChatMessage = ChatMessage() - callStartedChatMessage.jsonMessageId = CALL_STARTED_ID - callStartedChatMessage.actorId = "-2" - val name = if (recent.actorDisplayName.isNullOrEmpty()) "Guest" else recent.actorDisplayName - callStartedChatMessage.actorDisplayName = name - callStartedChatMessage.actorType = recent.actorType - callStartedChatMessage.timestamp = chatMessageList[0].timestamp - callStartedChatMessage.message = null - adapter?.addToStart(callStartedChatMessage, false) + // TODO try to keep UI intact, but come up with a pinning mechanism + // copy this code into message fragment and pass in the recent message + // also delete call started viewholder, callstarted interface and callstarted from the + // message holders somewhere below idk. In addition, impl functions and add animations. Should + // be good + + // val callStartedChatMessage = ChatMessage() + // callStartedChatMessage.jsonMessageId = CALL_STARTED_ID + // callStartedChatMessage.actorId = "-2" + // val name = if (recent.actorDisplayName.isNullOrEmpty()) "Guest" else recent.actorDisplayName + // callStartedChatMessage.actorDisplayName = name + // callStartedChatMessage.actorType = recent.actorType + // callStartedChatMessage.timestamp = chatMessageList[0].timestamp + // callStartedChatMessage.message = null + // adapter?.addToStart(callStartedChatMessage, false) callStarted = true } } // remove CallStartedMessage with id -2 @@ -3562,7 +3568,7 @@ class ChatActivity : ChatMessage.SystemMessageType.CALL_MISSED, ChatMessage.SystemMessageType.CALL_TRIED, ChatMessage.SystemMessageType.CALL_ENDED_EVERYONE -> { - adapter?.deleteById("-2") + // adapter?.deleteById("-2") callStarted = false } // remove message of id -2 else -> {} diff --git a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt index 9ddcc6c560..d0bd2b15f2 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt @@ -907,6 +907,19 @@ class MessageInputFragment : Fragment() { binding.fragmentEditView.clearEdit.let { viewThemeUtils.platform.colorImageView(it, ColorRole.PRIMARY) } + + binding.fragmentCallStarted.callStartedBackground.apply { + viewThemeUtils.talk.themeOutgoingMessageBubble(this, grouped = true, false) + } + + binding.fragmentCallStarted.callAuthorChip.apply { + viewThemeUtils.material.colorChipBackground(this) + } + + // TODO figure this out + binding.fragmentCallStarted.callStartedCloseBtn.apply { + viewThemeUtils.platform.colorImageView(this, ColorRole.ON_PRIMARY) + } } private fun cancelReply() { diff --git a/app/src/main/res/layout/call_started_message.xml b/app/src/main/res/layout/call_started_message.xml index 33360a4c02..e8f98a5d44 100644 --- a/app/src/main/res/layout/call_started_message.xml +++ b/app/src/main/res/layout/call_started_message.xml @@ -17,10 +17,19 @@ tools:background="@drawable/shape_grouped_outcoming_message" tools:backgroundTint="@color/colorPrimaryDark"> + + diff --git a/app/src/main/res/layout/fragment_message_input.xml b/app/src/main/res/layout/fragment_message_input.xml index 3b5fead297..50e1b897a0 100644 --- a/app/src/main/res/layout/fragment_message_input.xml +++ b/app/src/main/res/layout/fragment_message_input.xml @@ -13,6 +13,14 @@ xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical"> + + - - + + - + \ No newline at end of file