From c9136cdf154953a044df143c652864b99aadf181 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Mon, 24 Mar 2025 17:07:00 +0100 Subject: [PATCH] replace snackbar with toasts for breakout room infos snackbars disaapear with the switch to a different screen. Toasts survive the switch so they are visible during the activities switch Signed-off-by: Marcel Hibbe --- .../java/com/nextcloud/talk/chat/ChatActivity.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 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 1dc84bf10..0e182dc1a 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -45,6 +45,7 @@ import android.widget.ImageView import android.widget.LinearLayout import android.widget.PopupMenu import android.widget.TextView +import android.widget.Toast import androidx.activity.OnBackPressedCallback import androidx.activity.result.ActivityResult import androidx.activity.result.ActivityResultLauncher @@ -1598,16 +1599,18 @@ class ChatActivity : if (conversationUser != null) { runOnUiThread { if (currentConversation?.objectType == ConversationEnums.ObjectType.ROOM) { - Snackbar.make( - binding.root, + // do not replace with snackbar, as it would disappear with the activity switch + Toast.makeText( + context, context.resources.getString(R.string.switch_to_main_room), - Snackbar.LENGTH_LONG + Toast.LENGTH_LONG ).show() } else { - Snackbar.make( - binding.root, + // do not replace with snackbar, as it would disappear with the activity switch + Toast.makeText( + context, context.resources.getString(R.string.switch_to_breakout_room), - Snackbar.LENGTH_LONG + Toast.LENGTH_LONG ).show() } }