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 <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2025-03-24 17:07:00 +01:00
parent 190bdbb470
commit c9136cdf15
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -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()
}
}