Skip to content

Commit 2e1b2a3

Browse files
authored
Merge pull request #6234 from nextcloud/backport/6209/stable-24.0
[stable-24.0] Added dialog before entering a voice room + additional string
2 parents 9098d5d + 39c9ee8 commit 2e1b2a3

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ class ConversationsListActivity : BaseActivity() {
720720
showSnackbar(getString(R.string.send_to_forbidden))
721721
}
722722
} else if (conversation.checkIfVoiceRoom()) {
723-
startACall(false, true)
723+
showStartCallDialog()
724724
} else {
725725
openConversation()
726726
}
@@ -1215,6 +1215,28 @@ class ConversationsListActivity : BaseActivity() {
12151215
)
12161216
}
12171217

1218+
fun showStartCallDialog() {
1219+
val dialogBuilder = MaterialAlertDialogBuilder(this)
1220+
.setIcon(viewThemeUtils.dialog.colorMaterialAlertDialogIcon(context, R.drawable.ic_call_black_24dp))
1221+
.setTitle(R.string.join_call)
1222+
.setPositiveButton(R.string.video_call) { _, _ ->
1223+
startACall(isVoiceOnlyCall = false, callWithoutNotification = false)
1224+
}
1225+
.setNegativeButton(R.string.audio_call) { _, _ ->
1226+
startACall(isVoiceOnlyCall = true, callWithoutNotification = false)
1227+
}
1228+
.setNeutralButton(R.string.nc_cancel) { _, _ -> }
1229+
1230+
viewThemeUtils.dialog
1231+
.colorMaterialAlertDialogBackground(this, dialogBuilder)
1232+
val dialog = dialogBuilder.show()
1233+
viewThemeUtils.platform.colorTextButtons(
1234+
dialog.getButton(AlertDialog.BUTTON_POSITIVE),
1235+
dialog.getButton(AlertDialog.BUTTON_NEGATIVE),
1236+
dialog.getButton(AlertDialog.BUTTON_NEUTRAL)
1237+
)
1238+
}
1239+
12181240
private fun showUnauthorizedDialog() {
12191241
val dialogBuilder = MaterialAlertDialogBuilder(this)
12201242
.setIcon(

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ How to translate with transifex:
893893
<string name="custom">Custom</string>
894894
<string name="set">Set</string>
895895
<string name="calendar">Calendar</string>
896+
<string name="join_call">Join call</string>
896897
<string name="video_call">Video call</string>
897898
<string name="audio_call">Audio call</string>
898899
<string name="started_a_call">started a call</string>

0 commit comments

Comments
 (0)