mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-12-18 14:42:16 +03:00
Merge pull request #4386 from nextcloud/implement_Short_long_press_options
Add support for all parameter in leave call endpoint
This commit is contained in:
commit
7c750df6e5
7 changed files with 128 additions and 39 deletions
|
@ -117,6 +117,7 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID
|
||||||
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ONE_TO_ONE
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
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_START_CALL_AFTER_ROOM_SWITCH
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SWITCH_TO_ROOM
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SWITCH_TO_ROOM
|
||||||
|
@ -263,7 +264,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
|
|
||||||
override fun onCallEndedForAll() {
|
override fun onCallEndedForAll() {
|
||||||
Log.d(TAG, "A moderator ended the call for all.")
|
Log.d(TAG, "A moderator ended the call for all.")
|
||||||
hangup(true)
|
hangup(true, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private var callParticipantList: CallParticipantList? = null
|
private var callParticipantList: CallParticipantList? = null
|
||||||
|
@ -271,7 +272,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
private var isBreakoutRoom = false
|
private var isBreakoutRoom = false
|
||||||
private val localParticipantMessageListener = LocalParticipantMessageListener { token ->
|
private val localParticipantMessageListener = LocalParticipantMessageListener { token ->
|
||||||
switchToRoomToken = token
|
switchToRoomToken = token
|
||||||
hangup(true)
|
hangup(true, false)
|
||||||
}
|
}
|
||||||
private val offerMessageListener = OfferMessageListener { sessionId, roomType, sdp, nick ->
|
private val offerMessageListener = OfferMessageListener { sessionId, roomType, sdp, nick ->
|
||||||
getOrCreatePeerConnectionWrapperForSessionIdAndType(
|
getOrCreatePeerConnectionWrapperForSessionIdAndType(
|
||||||
|
@ -350,6 +351,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
private var isModerator = false
|
private var isModerator = false
|
||||||
private var reactionAnimator: ReactionAnimator? = null
|
private var reactionAnimator: ReactionAnimator? = null
|
||||||
private var othersInCall = false
|
private var othersInCall = false
|
||||||
|
private var isOneToOneConversation = false
|
||||||
|
|
||||||
private lateinit var micInputAudioRecorder: AudioRecord
|
private lateinit var micInputAudioRecorder: AudioRecord
|
||||||
private var micInputAudioRecordThread: Thread? = null
|
private var micInputAudioRecordThread: Thread? = null
|
||||||
|
@ -381,6 +383,8 @@ class CallActivity : CallBaseActivity() {
|
||||||
canPublishAudioStream = extras.getBoolean(KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO)
|
canPublishAudioStream = extras.getBoolean(KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO)
|
||||||
canPublishVideoStream = extras.getBoolean(KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO)
|
canPublishVideoStream = extras.getBoolean(KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO)
|
||||||
isModerator = extras.getBoolean(KEY_IS_MODERATOR, false)
|
isModerator = extras.getBoolean(KEY_IS_MODERATOR, false)
|
||||||
|
isOneToOneConversation = extras.getBoolean(KEY_ROOM_ONE_TO_ONE, false)
|
||||||
|
|
||||||
if (extras.containsKey(KEY_FROM_NOTIFICATION_START_CALL)) {
|
if (extras.containsKey(KEY_FROM_NOTIFICATION_START_CALL)) {
|
||||||
isIncomingCallFromNotification = extras.getBoolean(KEY_FROM_NOTIFICATION_START_CALL)
|
isIncomingCallFromNotification = extras.getBoolean(KEY_FROM_NOTIFICATION_START_CALL)
|
||||||
}
|
}
|
||||||
|
@ -470,7 +474,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
binding!!.callRecordingIndicator.visibility = View.GONE
|
binding!!.callRecordingIndicator.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initClickListeners()
|
initClickListeners(isModerator, isOneToOneConversation)
|
||||||
binding!!.microphoneButton.setOnTouchListener(MicrophoneButtonTouchListener())
|
binding!!.microphoneButton.setOnTouchListener(MicrophoneButtonTouchListener())
|
||||||
pulseAnimation = PulseAnimation.create().with(binding!!.microphoneButton)
|
pulseAnimation = PulseAnimation.create().with(binding!!.microphoneButton)
|
||||||
.setDuration(310)
|
.setDuration(310)
|
||||||
|
@ -498,7 +502,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
}
|
}
|
||||||
.setNegativeButton(R.string.nc_no) { _, _ ->
|
.setNegativeButton(R.string.nc_no) { _, _ ->
|
||||||
recordingConsentGiven = false
|
recordingConsentGiven = false
|
||||||
hangup(true)
|
hangup(true, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
viewThemeUtils.dialog.colorMaterialAlertDialogBackground(this, materialAlertDialogBuilder)
|
viewThemeUtils.dialog.colorMaterialAlertDialogBackground(this, materialAlertDialogBuilder)
|
||||||
|
@ -613,7 +617,8 @@ class CallActivity : CallBaseActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initClickListeners() {
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
|
private fun initClickListeners(isModerator: Boolean, isOneToOneConversation: Boolean) {
|
||||||
binding!!.pictureInPictureButton.setOnClickListener { enterPipMode() }
|
binding!!.pictureInPictureButton.setOnClickListener { enterPipMode() }
|
||||||
|
|
||||||
binding!!.audioOutputButton.setOnClickListener {
|
binding!!.audioOutputButton.setOnClickListener {
|
||||||
|
@ -663,7 +668,39 @@ class CallActivity : CallBaseActivity() {
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding!!.hangupButton.setOnClickListener { hangup(true) }
|
|
||||||
|
if (isOneToOneConversation) {
|
||||||
|
binding!!.hangupButton.setOnLongClickListener {
|
||||||
|
showLeaveCallPopupMenu()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
binding!!.hangupButton.setOnClickListener {
|
||||||
|
hangup(true, true)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isModerator) {
|
||||||
|
binding!!.hangupButton.setOnLongClickListener {
|
||||||
|
showEndCallForAllPopupMenu()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding!!.hangupButton.setOnClickListener {
|
||||||
|
hangup(true, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isOneToOneConversation) {
|
||||||
|
binding!!.endCallPopupMenu.setOnClickListener {
|
||||||
|
hangup(true, true)
|
||||||
|
binding!!.endCallPopupMenu.visibility = View.GONE
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
binding!!.endCallPopupMenu.setOnClickListener {
|
||||||
|
hangup(true, false)
|
||||||
|
binding!!.endCallPopupMenu.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
binding!!.switchSelfVideoButton.setOnClickListener { switchCamera() }
|
binding!!.switchSelfVideoButton.setOnClickListener { switchCamera() }
|
||||||
binding!!.gridview.onItemClickListener =
|
binding!!.gridview.onItemClickListener =
|
||||||
AdapterView.OnItemClickListener { _: AdapterView<*>?, _: View?, _: Int, _: Long ->
|
AdapterView.OnItemClickListener { _: AdapterView<*>?, _: View?, _: Int, _: Long ->
|
||||||
|
@ -675,7 +712,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
binding!!.callStates.callStateRelativeLayout.setOnClickListener {
|
binding!!.callStates.callStateRelativeLayout.setOnClickListener {
|
||||||
if (currentCallStatus === CallStatus.CALLING_TIMEOUT) {
|
if (currentCallStatus === CallStatus.CALLING_TIMEOUT) {
|
||||||
setCallState(CallStatus.RECONNECTING)
|
setCallState(CallStatus.RECONNECTING)
|
||||||
hangupNetworkCalls(false)
|
hangupNetworkCalls(false, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding!!.callRecordingIndicator.setOnClickListener {
|
binding!!.callRecordingIndicator.setOnClickListener {
|
||||||
|
@ -699,6 +736,16 @@ class CallActivity : CallBaseActivity() {
|
||||||
binding!!.lowerHandButton.setOnClickListener { l: View? -> raiseHandViewModel!!.lowerHand() }
|
binding!!.lowerHandButton.setOnClickListener { l: View? -> raiseHandViewModel!!.lowerHand() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showEndCallForAllPopupMenu() {
|
||||||
|
binding!!.endCallPopupMenu.visibility = View.VISIBLE
|
||||||
|
binding!!.endCallPopupMenu.text = context.getString(R.string.end_call_for_everyone)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showLeaveCallPopupMenu() {
|
||||||
|
binding!!.endCallPopupMenu.visibility = View.VISIBLE
|
||||||
|
binding!!.endCallPopupMenu.text = context.getString(R.string.leave_call)
|
||||||
|
}
|
||||||
|
|
||||||
private fun createCameraEnumerator() {
|
private fun createCameraEnumerator() {
|
||||||
var camera2EnumeratorIsSupported = false
|
var camera2EnumeratorIsSupported = false
|
||||||
try {
|
try {
|
||||||
|
@ -847,6 +894,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
val action = me.actionMasked
|
val action = me.actionMasked
|
||||||
if (action == MotionEvent.ACTION_DOWN) {
|
if (action == MotionEvent.ACTION_DOWN) {
|
||||||
animateCallControls(true, 0)
|
animateCallControls(true, 0)
|
||||||
|
binding!!.endCallPopupMenu.visibility = View.GONE
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -854,6 +902,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
val action = me.actionMasked
|
val action = me.actionMasked
|
||||||
if (action == MotionEvent.ACTION_DOWN) {
|
if (action == MotionEvent.ACTION_DOWN) {
|
||||||
animateCallControls(true, 0)
|
animateCallControls(true, 0)
|
||||||
|
binding!!.endCallPopupMenu.visibility = View.GONE
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -1442,7 +1491,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
Log.d(TAG, "localStream is null")
|
Log.d(TAG, "localStream is null")
|
||||||
}
|
}
|
||||||
if (currentCallStatus !== CallStatus.LEAVING) {
|
if (currentCallStatus !== CallStatus.LEAVING) {
|
||||||
hangup(true)
|
hangup(true, false)
|
||||||
}
|
}
|
||||||
powerManagerUtils!!.updatePhoneState(PowerManagerUtils.PhoneState.IDLE)
|
powerManagerUtils!!.updatePhoneState(PowerManagerUtils.PhoneState.IDLE)
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
|
@ -1726,7 +1775,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
Log.e(TAG, "Failed to join call", e)
|
Log.e(TAG, "Failed to join call", e)
|
||||||
Snackbar.make(binding!!.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
Snackbar.make(binding!!.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
||||||
hangup(true)
|
hangup(true, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {
|
override fun onComplete() {
|
||||||
|
@ -1746,7 +1795,8 @@ class CallActivity : CallBaseActivity() {
|
||||||
private fun startCallTimeCounter(callStartTime: Long) {
|
private fun startCallTimeCounter(callStartTime: Long) {
|
||||||
if (callStartTime != 0L &&
|
if (callStartTime != 0L &&
|
||||||
hasSpreedFeatureCapability(
|
hasSpreedFeatureCapability(
|
||||||
conversationUser!!.capabilities!!.spreedCapability!!, SpreedFeatures.RECORDING_V1
|
conversationUser!!.capabilities!!.spreedCapability!!,
|
||||||
|
SpreedFeatures.RECORDING_V1
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
binding!!.callDuration.visibility = View.VISIBLE
|
binding!!.callDuration.visibility = View.VISIBLE
|
||||||
|
@ -1877,7 +1927,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
Log.d(TAG, "onMessageEvent 'hello'")
|
Log.d(TAG, "onMessageEvent 'hello'")
|
||||||
if (!webSocketCommunicationEvent.getHashMap()!!.containsKey("oldResumeId")) {
|
if (!webSocketCommunicationEvent.getHashMap()!!.containsKey("oldResumeId")) {
|
||||||
if (currentCallStatus === CallStatus.RECONNECTING) {
|
if (currentCallStatus === CallStatus.RECONNECTING) {
|
||||||
hangup(false)
|
hangup(false, false)
|
||||||
} else {
|
} else {
|
||||||
setCallState(CallStatus.RECONNECTING)
|
setCallState(CallStatus.RECONNECTING)
|
||||||
runOnUiThread { initiateCall() }
|
runOnUiThread { initiateCall() }
|
||||||
|
@ -1953,7 +2003,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hangup(shutDownView: Boolean) {
|
private fun hangup(shutDownView: Boolean, endCallForAll: Boolean) {
|
||||||
Log.d(TAG, "hangup! shutDownView=$shutDownView")
|
Log.d(TAG, "hangup! shutDownView=$shutDownView")
|
||||||
if (shutDownView) {
|
if (shutDownView) {
|
||||||
setCallState(CallStatus.LEAVING)
|
setCallState(CallStatus.LEAVING)
|
||||||
|
@ -2018,17 +2068,19 @@ class CallActivity : CallBaseActivity() {
|
||||||
|
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().isInCall = false
|
ApplicationWideCurrentRoomHolder.getInstance().isInCall = false
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().isDialing = false
|
ApplicationWideCurrentRoomHolder.getInstance().isDialing = false
|
||||||
hangupNetworkCalls(shutDownView)
|
hangupNetworkCalls(shutDownView, endCallForAll)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hangupNetworkCalls(shutDownView: Boolean) {
|
private fun hangupNetworkCalls(shutDownView: Boolean, endCallForAll: Boolean) {
|
||||||
Log.d(TAG, "hangupNetworkCalls. shutDownView=$shutDownView")
|
Log.d(TAG, "hangupNetworkCalls. shutDownView=$shutDownView")
|
||||||
val apiVersion = ApiUtils.getCallApiVersion(conversationUser, intArrayOf(ApiUtils.API_V4, 1))
|
val apiVersion = ApiUtils.getCallApiVersion(conversationUser, intArrayOf(ApiUtils.API_V4, 1))
|
||||||
if (callParticipantList != null) {
|
if (callParticipantList != null) {
|
||||||
callParticipantList!!.removeObserver(callParticipantListObserver)
|
callParticipantList!!.removeObserver(callParticipantListObserver)
|
||||||
callParticipantList!!.destroy()
|
callParticipantList!!.destroy()
|
||||||
}
|
}
|
||||||
ncApi!!.leaveCall(credentials, ApiUtils.getUrlForCall(apiVersion, baseUrl, roomToken!!))
|
val endCall: Boolean? = if (endCallForAll) true else null
|
||||||
|
|
||||||
|
ncApi!!.leaveCall(credentials, ApiUtils.getUrlForCall(apiVersion, baseUrl, roomToken!!), endCall)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(object : Observer<GenericOverall> {
|
.subscribe(object : Observer<GenericOverall> {
|
||||||
|
@ -2122,7 +2174,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().isInCall
|
ApplicationWideCurrentRoomHolder.getInstance().isInCall
|
||||||
) {
|
) {
|
||||||
Log.d(TAG, "Most probably a moderator ended the call for all.")
|
Log.d(TAG, "Most probably a moderator ended the call for all.")
|
||||||
hangup(true)
|
hangup(true, false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2188,8 +2240,10 @@ class CallActivity : CallBaseActivity() {
|
||||||
// remote session ID. However, if the other participant does not have audio nor video that participant
|
// remote session ID. However, if the other participant does not have audio nor video that participant
|
||||||
// will not send an offer, so no connection is actually established when the remote participant has a
|
// will not send an offer, so no connection is actually established when the remote participant has a
|
||||||
// higher session ID but is not publishing media.
|
// higher session ID but is not publishing media.
|
||||||
if (hasMCU && participantHasAudioOrVideo ||
|
if (hasMCU &&
|
||||||
!hasMCU && selfParticipantHasAudioOrVideo &&
|
participantHasAudioOrVideo ||
|
||||||
|
!hasMCU &&
|
||||||
|
selfParticipantHasAudioOrVideo &&
|
||||||
(!participantHasAudioOrVideo || sessionId < currentSessionId!!)
|
(!participantHasAudioOrVideo || sessionId < currentSessionId!!)
|
||||||
) {
|
) {
|
||||||
getOrCreatePeerConnectionWrapperForSessionIdAndType(sessionId, VIDEO_STREAM_TYPE_VIDEO, false)
|
getOrCreatePeerConnectionWrapperForSessionIdAndType(sessionId, VIDEO_STREAM_TYPE_VIDEO, false)
|
||||||
|
@ -2212,15 +2266,14 @@ class CallActivity : CallBaseActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun participantInCallFlagsHaveAudioOrVideo(participant: Participant?): Boolean {
|
private fun participantInCallFlagsHaveAudioOrVideo(participant: Participant?): Boolean =
|
||||||
return if (participant == null) {
|
if (participant == null) {
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
participant.inCall and Participant.InCallFlags.WITH_AUDIO.toLong() > 0 ||
|
participant.inCall and Participant.InCallFlags.WITH_AUDIO.toLong() > 0 ||
|
||||||
!isVoiceOnlyCall &&
|
!isVoiceOnlyCall &&
|
||||||
participant.inCall and Participant.InCallFlags.WITH_VIDEO.toLong() > 0
|
participant.inCall and Participant.InCallFlags.WITH_VIDEO.toLong() > 0
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun getPeerConnectionWrapperForSessionIdAndType(sessionId: String?, type: String): PeerConnectionWrapper? {
|
private fun getPeerConnectionWrapperForSessionIdAndType(sessionId: String?, type: String): PeerConnectionWrapper? {
|
||||||
for (wrapper in peerConnectionWrapperList) {
|
for (wrapper in peerConnectionWrapperList) {
|
||||||
|
@ -2249,7 +2302,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
context.resources.getString(R.string.nc_common_error_sorry),
|
context.resources.getString(R.string.nc_common_error_sorry),
|
||||||
Snackbar.LENGTH_LONG
|
Snackbar.LENGTH_LONG
|
||||||
).show()
|
).show()
|
||||||
hangup(true)
|
hangup(true, false)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
peerConnectionWrapper = if (hasMCU && publisher) {
|
peerConnectionWrapper = if (hasMCU && publisher) {
|
||||||
|
@ -2468,10 +2521,12 @@ class CallActivity : CallBaseActivity() {
|
||||||
fun onMessageEvent(proximitySensorEvent: ProximitySensorEvent) {
|
fun onMessageEvent(proximitySensorEvent: ProximitySensorEvent) {
|
||||||
if (!isVoiceOnlyCall) {
|
if (!isVoiceOnlyCall) {
|
||||||
val enableVideo = proximitySensorEvent.proximitySensorEventType ==
|
val enableVideo = proximitySensorEvent.proximitySensorEventType ==
|
||||||
ProximitySensorEvent.ProximitySensorEventType.SENSOR_FAR && videoOn
|
ProximitySensorEvent.ProximitySensorEventType.SENSOR_FAR &&
|
||||||
|
videoOn
|
||||||
if (permissionUtil!!.isCameraPermissionGranted() &&
|
if (permissionUtil!!.isCameraPermissionGranted() &&
|
||||||
(currentCallStatus === CallStatus.CONNECTING || isConnectionEstablished) &&
|
(currentCallStatus === CallStatus.CONNECTING || isConnectionEstablished) &&
|
||||||
videoOn && enableVideo != localVideoTrack!!.enabled()
|
videoOn &&
|
||||||
|
enableVideo != localVideoTrack!!.enabled()
|
||||||
) {
|
) {
|
||||||
toggleMedia(enableVideo, true)
|
toggleMedia(enableVideo, true)
|
||||||
}
|
}
|
||||||
|
@ -2565,7 +2620,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
CallStatus.CALLING_TIMEOUT -> handler!!.post {
|
CallStatus.CALLING_TIMEOUT -> handler!!.post {
|
||||||
hangup(false)
|
hangup(false, false)
|
||||||
binding!!.callStates.callStateTextView.setText(R.string.nc_call_timeout)
|
binding!!.callStates.callStateTextView.setText(R.string.nc_call_timeout)
|
||||||
binding!!.callModeTextView.text = descriptionForCallType
|
binding!!.callModeTextView.text = descriptionForCallType
|
||||||
if (binding!!.callStates.callStateRelativeLayout.visibility != View.VISIBLE) {
|
if (binding!!.callStates.callStateRelativeLayout.visibility != View.VISIBLE) {
|
||||||
|
@ -2835,7 +2890,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
if (iceConnectionState == IceConnectionState.FAILED) {
|
if (iceConnectionState == IceConnectionState.FAILED) {
|
||||||
setCallState(CallStatus.PUBLISHER_FAILED)
|
setCallState(CallStatus.PUBLISHER_FAILED)
|
||||||
webSocketClient!!.clearResumeId()
|
webSocketClient!!.clearResumeId()
|
||||||
hangup(false)
|
hangup(false, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2868,6 +2923,7 @@ class CallActivity : CallBaseActivity() {
|
||||||
raisedHand = if (callParticipantModel.raisedHand != null) callParticipantModel.raisedHand.state else false
|
raisedHand = if (callParticipantModel.raisedHand != null) callParticipantModel.raisedHand.state else false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("StringFormatInvalid")
|
||||||
override fun onChange() {
|
override fun onChange() {
|
||||||
if (callParticipantModel.raisedHand == null || !callParticipantModel.raisedHand.state) {
|
if (callParticipantModel.raisedHand == null || !callParticipantModel.raisedHand.state) {
|
||||||
raisedHand = false
|
raisedHand = false
|
||||||
|
@ -3104,7 +3160,8 @@ class CallActivity : CallBaseActivity() {
|
||||||
get() = hasSpreedFeatureCapability(
|
get() = hasSpreedFeatureCapability(
|
||||||
conversationUser.capabilities!!.spreedCapability!!,
|
conversationUser.capabilities!!.spreedCapability!!,
|
||||||
SpreedFeatures.RAISE_HAND
|
SpreedFeatures.RAISE_HAND
|
||||||
) || isBreakoutRoom
|
) ||
|
||||||
|
isBreakoutRoom
|
||||||
|
|
||||||
private inner class SelfVideoTouchListener : OnTouchListener {
|
private inner class SelfVideoTouchListener : OnTouchListener {
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
|
|
|
@ -246,7 +246,8 @@ public interface NcApi {
|
||||||
Server URL is: baseUrl + ocsApiVersion + spreedApiVersion + /call/callToken
|
Server URL is: baseUrl + ocsApiVersion + spreedApiVersion + /call/callToken
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
Observable<GenericOverall> leaveCall(@Nullable @Header("Authorization") String authorization, @Url String url);
|
Observable<GenericOverall> leaveCall(@Nullable @Header("Authorization") String authorization, @Url String url,
|
||||||
|
@Nullable @Query("all") Boolean all);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
Observable<SignalingSettingsOverall> getSignalingSettings(@Nullable @Header("Authorization") String authorization,
|
Observable<SignalingSettingsOverall> getSignalingSettings(@Nullable @Header("Authorization") String authorization,
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.nextcloud.talk.utils.NotificationUtils
|
||||||
import com.nextcloud.talk.utils.SpreedFeatures
|
import com.nextcloud.talk.utils.SpreedFeatures
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_VOICE_ONLY
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_VOICE_ONLY
|
||||||
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ONE_TO_ONE
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
||||||
import okhttp3.Cache
|
import okhttp3.Cache
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
@ -91,7 +92,7 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||||
notificationTimestamp = extras.getInt(BundleKeys.KEY_NOTIFICATION_TIMESTAMP)
|
notificationTimestamp = extras.getInt(BundleKeys.KEY_NOTIFICATION_TIMESTAMP)
|
||||||
displayName = extras.getString(BundleKeys.KEY_CONVERSATION_DISPLAY_NAME, "")
|
displayName = extras.getString(BundleKeys.KEY_CONVERSATION_DISPLAY_NAME, "")
|
||||||
callFlag = extras.getInt(BundleKeys.KEY_CALL_FLAG)
|
callFlag = extras.getInt(BundleKeys.KEY_CALL_FLAG)
|
||||||
isOneToOneCall = extras.getBoolean(BundleKeys.KEY_ROOM_ONE_TO_ONE)
|
isOneToOneCall = extras.getBoolean(KEY_ROOM_ONE_TO_ONE)
|
||||||
conversationName = extras.getString(BundleKeys.KEY_CONVERSATION_NAME, "")
|
conversationName = extras.getString(BundleKeys.KEY_CONVERSATION_NAME, "")
|
||||||
internalUserId = extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID)
|
internalUserId = extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID)
|
||||||
}
|
}
|
||||||
|
@ -192,13 +193,12 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||||
|
|
||||||
private fun proceedToCall() {
|
private fun proceedToCall() {
|
||||||
val callIntent = Intent(this, CallActivity::class.java)
|
val callIntent = Intent(this, CallActivity::class.java)
|
||||||
|
intent.putExtra(KEY_ROOM_ONE_TO_ONE, isOneToOneCall)
|
||||||
callIntent.putExtras(intent.extras!!)
|
callIntent.putExtras(intent.extras!!)
|
||||||
startActivity(callIntent)
|
startActivity(callIntent)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isInCallWithVideo(callFlag: Int): Boolean {
|
private fun isInCallWithVideo(callFlag: Int): Boolean = (callFlag and Participant.InCallFlags.WITH_VIDEO) > 0
|
||||||
return (callFlag and Participant.InCallFlags.WITH_VIDEO) > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
val notificationManager = NotificationManagerCompat.from(context)
|
val notificationManager = NotificationManagerCompat.from(context)
|
||||||
|
|
|
@ -3072,6 +3072,7 @@ class ChatActivity :
|
||||||
BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO,
|
BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO,
|
||||||
participantPermissions.canPublishAudio()
|
participantPermissions.canPublishAudio()
|
||||||
)
|
)
|
||||||
|
bundle.putBoolean(BundleKeys.KEY_ROOM_ONE_TO_ONE, isOneToOneConversation())
|
||||||
bundle.putBoolean(
|
bundle.putBoolean(
|
||||||
BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO,
|
BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO,
|
||||||
participantPermissions.canPublishVideo()
|
participantPermissions.canPublishVideo()
|
||||||
|
|
|
@ -231,7 +231,7 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
|
||||||
bundle.putLong(KEY_INTERNAL_USER_ID, signatureVerification.user!!.id!!)
|
bundle.putLong(KEY_INTERNAL_USER_ID, signatureVerification.user!!.id!!)
|
||||||
bundle.putBoolean(KEY_FROM_NOTIFICATION_START_CALL, true)
|
bundle.putBoolean(KEY_FROM_NOTIFICATION_START_CALL, true)
|
||||||
|
|
||||||
val isOneToOneCall = conversation.type === ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
val isOneToOneCall = conversation.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
||||||
|
|
||||||
bundle.putBoolean(KEY_ROOM_ONE_TO_ONE, isOneToOneCall) // ggf change in Activity? not necessary????
|
bundle.putBoolean(KEY_ROOM_ONE_TO_ONE, isOneToOneCall) // ggf change in Activity? not necessary????
|
||||||
bundle.putString(BundleKeys.KEY_CONVERSATION_NAME, conversation.name)
|
bundle.putString(BundleKeys.KEY_CONVERSATION_NAME, conversation.name)
|
||||||
|
|
|
@ -94,7 +94,8 @@
|
||||||
android:src="@drawable/record_stop"
|
android:src="@drawable/record_stop"
|
||||||
android:translationZ="2dp"
|
android:translationZ="2dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:visibility="visible"></ImageView>
|
tools:visibility="visible">
|
||||||
|
</ImageView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -182,14 +183,37 @@
|
||||||
android:layout_marginBottom="50dp">
|
android:layout_marginBottom="50dp">
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.flexbox.FlexboxLayout
|
||||||
|
android:id="@+id/flexboxLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/standard_margin"
|
||||||
|
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||||
|
app:flexDirection="row"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
app:justifyContent="flex_end"
|
||||||
|
app:alignItems="center">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/end_call_popup_menu"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:textColor="@android:color/holo_red_light"
|
||||||
|
app:icon="@drawable/ic_call_end_white_24px"
|
||||||
|
app:iconTint="@android:color/holo_red_light"
|
||||||
|
app:iconGravity="textEnd"
|
||||||
|
app:iconPadding="16dp"
|
||||||
|
tools:text="@string/end_call_for_everyone"/>
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/lower_hand_button"
|
android:id="@+id/lower_hand_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginEnd="@dimen/standard_margin"
|
|
||||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
|
||||||
android:contentDescription="@string/lower_hand"
|
android:contentDescription="@string/lower_hand"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:backgroundTint="@color/call_buttons_background"
|
app:backgroundTint="@color/call_buttons_background"
|
||||||
|
@ -198,7 +222,11 @@
|
||||||
app:shapeAppearance="@style/fab_3_rounded"
|
app:shapeAppearance="@style/fab_3_rounded"
|
||||||
app:srcCompat="@drawable/ic_baseline_do_not_touch_24"
|
app:srcCompat="@drawable/ic_baseline_do_not_touch_24"
|
||||||
app:tint="@color/white"
|
app:tint="@color/white"
|
||||||
tools:visibility="visible" />
|
tools:visibility = "visible"/>
|
||||||
|
|
||||||
|
</com.google.android.flexbox.FlexboxLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -310,6 +310,8 @@ How to translate with transifex:
|
||||||
<string name="lower_hand">Lower hand</string>
|
<string name="lower_hand">Lower hand</string>
|
||||||
<string name="restrict_join_other_room_while_call">It\'s not possible to join other rooms while being in a call</string>
|
<string name="restrict_join_other_room_while_call">It\'s not possible to join other rooms while being in a call</string>
|
||||||
<string name="call_running_since_one_hour">The call has been running for one hour.</string>
|
<string name="call_running_since_one_hour">The call has been running for one hour.</string>
|
||||||
|
<string name="end_call_for_everyone">End call for everyone</string>
|
||||||
|
<string name="leave_call">Leave call</string>
|
||||||
|
|
||||||
<!-- Picture in Picture -->
|
<!-- Picture in Picture -->
|
||||||
<string name="nc_pip_microphone_mute">Mute microphone</string>
|
<string name="nc_pip_microphone_mute">Mute microphone</string>
|
||||||
|
|
Loading…
Reference in a new issue