mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-30 00:50:45 +01:00
open chat when navigating back from thread
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
abf15ae2f2
commit
c468ba4df6
@ -393,9 +393,14 @@ class ChatActivity :
|
|||||||
|
|
||||||
private val onBackPressedCallback = object : OnBackPressedCallback(true) {
|
private val onBackPressedCallback = object : OnBackPressedCallback(true) {
|
||||||
override fun handleOnBackPressed() {
|
override fun handleOnBackPressed() {
|
||||||
val intent = Intent(this@ChatActivity, ConversationsListActivity::class.java)
|
if (isChatThread()) {
|
||||||
intent.putExtras(Bundle())
|
isEnabled = false
|
||||||
startActivity(intent)
|
onBackPressedDispatcher.onBackPressed()
|
||||||
|
} else {
|
||||||
|
val intent = Intent(this@ChatActivity, ConversationsListActivity::class.java)
|
||||||
|
intent.putExtras(Bundle())
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2603,7 +2608,7 @@ class ChatActivity :
|
|||||||
viewThemeUtils.platform.colorTextView(title, ColorRole.ON_SURFACE)
|
viewThemeUtils.platform.colorTextView(title, ColorRole.ON_SURFACE)
|
||||||
|
|
||||||
title.text =
|
title.text =
|
||||||
if (threadId != null && threadId!! > 0) {
|
if (isChatThread()) {
|
||||||
"Thread $threadId"
|
"Thread $threadId"
|
||||||
} else if (currentConversation?.displayName != null) {
|
} else if (currentConversation?.displayName != null) {
|
||||||
try {
|
try {
|
||||||
@ -4118,6 +4123,8 @@ class ChatActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isChatThread(): Boolean = threadId != null && threadId!! > 0
|
||||||
|
|
||||||
fun openThread(roomToken: String, threadId: Long) {
|
fun openThread(roomToken: String, threadId: Long) {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putString(KEY_ROOM_TOKEN, roomToken)
|
bundle.putString(KEY_ROOM_TOKEN, roomToken)
|
||||||
|
Loading…
Reference in New Issue
Block a user