mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-18 19:19:33 +01:00
Merge cc50aaee52
into 2a7359c1e9
This commit is contained in:
commit
64411f8a4f
@ -159,13 +159,19 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||
binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
}
|
||||
viewThemeUtils.platform.colorTextView(binding.messageTime, ColorRole.ON_SURFACE_VARIANT)
|
||||
|
||||
// parent message handling
|
||||
if (!message.isDeleted && message.parentMessageId != null) {
|
||||
processParentMessage(message)
|
||||
binding.messageQuote.quotedChatMessageView.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.messageQuote.quotedChatMessageView.visibility = View.GONE
|
||||
}
|
||||
val chatActivity = commonMessageInterface as ChatActivity
|
||||
binding.messageQuote.quotedChatMessageView.visibility =
|
||||
// TODO replace message.parentMessageId with topmostParentId
|
||||
if (chatActivity.threadId == message.parentMessageId) {
|
||||
View.GONE
|
||||
} else if (!message.isDeleted && message.parentMessageId != null) {
|
||||
processParentMessage(message)
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
itemView.setTag(R.string.replyable_message_view_tag, message.replyable)
|
||||
|
||||
@ -362,6 +368,14 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||
viewThemeUtils
|
||||
)
|
||||
|
||||
// TODO replace message.parentMessageId!! with topmostParentId (=threadId)
|
||||
binding.messageQuote.threadIcon.setOnClickListener {
|
||||
chatActivity.openThread(
|
||||
chatActivity.roomToken,
|
||||
message.parentMessageId!!
|
||||
)
|
||||
}
|
||||
|
||||
viewThemeUtils.talk.themeParentMessage(
|
||||
parentChatMessage,
|
||||
message,
|
||||
|
@ -195,6 +195,7 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_START_CALL_AFTER_ROOM_SWITCH
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SWITCH_TO_ROOM
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_THREAD_ID
|
||||
import com.nextcloud.talk.utils.permissions.PlatformPermissionUtil
|
||||
import com.nextcloud.talk.utils.rx.DisposableSet
|
||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder
|
||||
@ -348,6 +349,7 @@ class ChatActivity :
|
||||
|
||||
var sessionIdAfterRoomJoined: String? = null
|
||||
lateinit var roomToken: String
|
||||
var threadId: Long? = null
|
||||
var conversationUser: User? = null
|
||||
lateinit var spreedCapabilities: SpreedCapability
|
||||
var chatApiVersion: Int = 1
|
||||
@ -472,7 +474,8 @@ class ChatActivity :
|
||||
chatViewModel.initData(
|
||||
credentials!!,
|
||||
urlForChatting,
|
||||
roomToken
|
||||
roomToken,
|
||||
threadId
|
||||
)
|
||||
|
||||
messageInputFragment = getMessageInputFragment()
|
||||
@ -526,6 +529,7 @@ class ChatActivity :
|
||||
val extras: Bundle? = intent.extras
|
||||
|
||||
roomToken = extras?.getString(KEY_ROOM_TOKEN).orEmpty()
|
||||
threadId = extras?.getLong(KEY_THREAD_ID)
|
||||
|
||||
sharedText = extras?.getString(BundleKeys.KEY_SHARED_TEXT).orEmpty()
|
||||
|
||||
@ -2576,7 +2580,9 @@ class ChatActivity :
|
||||
viewThemeUtils.platform.colorTextView(title, ColorRole.ON_SURFACE)
|
||||
|
||||
title.text =
|
||||
if (currentConversation?.displayName != null) {
|
||||
if (threadId != null && threadId!! > 0) {
|
||||
"Thread $threadId"
|
||||
} else if (currentConversation?.displayName != null) {
|
||||
try {
|
||||
EmojiCompat.get().process(currentConversation?.displayName as CharSequence).toString()
|
||||
} catch (e: java.lang.IllegalStateException) {
|
||||
@ -4089,6 +4095,15 @@ class ChatActivity :
|
||||
}
|
||||
}
|
||||
|
||||
fun openThread(roomToken: String, threadId: Long) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ROOM_TOKEN, roomToken)
|
||||
bundle.putLong(KEY_THREAD_ID, threadId)
|
||||
val chatIntent = Intent(context, ChatActivity::class.java)
|
||||
chatIntent.putExtras(bundle)
|
||||
startActivity(chatIntent)
|
||||
}
|
||||
|
||||
override fun joinAudioCall() {
|
||||
startACall(true, false)
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ interface ChatMessageRepository : LifecycleAwareManager {
|
||||
|
||||
val removeMessageFlow: Flow<ChatMessage>
|
||||
|
||||
fun initData(credentials: String, urlForChatting: String, roomToken: String)
|
||||
fun initData(credentials: String, urlForChatting: String, roomToken: String, threadId: Long?)
|
||||
|
||||
fun updateConversation(conversationModel: ConversationModel)
|
||||
|
||||
|
@ -118,11 +118,14 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
private lateinit var conversationModel: ConversationModel
|
||||
private lateinit var credentials: String
|
||||
private lateinit var urlForChatting: String
|
||||
private var threadId: Long? = null
|
||||
|
||||
override fun initData(credentials: String, urlForChatting: String, roomToken: String) {
|
||||
override fun initData(credentials: String, urlForChatting: String, roomToken: String, threadId: Long?) {
|
||||
internalConversationId = currentUser.id.toString() + "@" + roomToken
|
||||
this.credentials = credentials
|
||||
this.urlForChatting = urlForChatting
|
||||
this.threadId = threadId // TODO: use this threadId in API requests when fetching messages? +
|
||||
// TODO Introduce ChatBlocks for threads
|
||||
}
|
||||
|
||||
override fun updateConversation(conversationModel: ConversationModel) {
|
||||
|
@ -272,8 +272,8 @@ class ChatViewModel @Inject constructor(
|
||||
val reactionDeletedViewState: LiveData<ViewState>
|
||||
get() = _reactionDeletedViewState
|
||||
|
||||
fun initData(credentials: String, urlForChatting: String, roomToken: String) {
|
||||
chatRepository.initData(credentials, urlForChatting, roomToken)
|
||||
fun initData(credentials: String, urlForChatting: String, roomToken: String, threadId: Long?) {
|
||||
chatRepository.initData(credentials, urlForChatting, roomToken, threadId)
|
||||
}
|
||||
|
||||
fun updateConversation(currentConversation: ConversationModel) {
|
||||
|
@ -82,4 +82,5 @@ object BundleKeys {
|
||||
const val KEY_CHAT_URL: String = "KEY_CHAT_URL"
|
||||
const val KEY_SCROLL_TO_NOTIFICATION_CATEGORY: String = "KEY_SCROLL_TO_NOTIFICATION_CATEGORY"
|
||||
const val KEY_FOCUS_INPUT: String = "KEY_FOCUS_INPUT"
|
||||
const val KEY_THREAD_ID = "KEY_THREAD_ID"
|
||||
}
|
||||
|
12
app/src/main/res/drawable/outline_thread_unread_24.xml
Normal file
12
app/src/main/res/drawable/outline_thread_unread_24.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<!--
|
||||
~ Nextcloud Talk - Android Client
|
||||
~
|
||||
~ SPDX-FileCopyrightText: 2025 Your Name <your@email.com>
|
||||
~ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#000000" android:viewportWidth="960" android:viewportHeight="960">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M554,840Q500,840 463,803Q426,766 426,714Q426,638 487.5,576.5Q549,515 641,500Q638,464 623,445.5Q608,427 582,427Q552,427 517,452Q482,477 434,534Q356,627 319.5,655Q283,683 241,683Q190,683 155,645Q120,607 120,553Q120,499 143.5,442.5Q167,386 223,307Q242,281 251,263Q260,245 260,234Q260,227 257.5,223.5Q255,220 250,220Q240,220 225,232.5Q210,245 190,271L120,200Q152,161 185,140.5Q218,120 250,120Q296,120 328,152Q360,184 360,232Q360,261 345,296Q330,331 295,380Q257,434 238.5,475Q220,516 220,547Q220,564 225.5,573.5Q231,583 241,583Q251,583 258.5,577.5Q266,572 286,551Q299,537 317,516.5Q335,496 361,466Q424,391 475,359Q526,327 582,327Q649,327 692,372Q735,417 741,495L840,495L840,595L741,595Q733,707 682.5,773.5Q632,840 554,840ZM556,740Q588,740 610,703.5Q632,667 640,602Q594,613 560,645.5Q526,678 526,710Q526,724 534,732Q542,740 556,740ZM800,280Q750,280 715,245Q680,210 680,160Q680,110 715,75Q750,40 800,40Q850,40 885,75Q920,110 920,160Q920,210 885,245Q850,280 800,280Z"/>
|
||||
|
||||
</vector>
|
@ -64,7 +64,6 @@
|
||||
app:layout_wrapBefore="true"
|
||||
tools:text="Talk to you later!" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/checkboxContainer"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -84,6 +84,17 @@
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/threadIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@color/transparent"
|
||||
android:src="@drawable/outline_thread_unread_24" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/cancelReplyButton"
|
||||
android:layout_width="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user