ktlintFormat

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-10-25 20:14:01 +02:00 committed by Marcel Hibbe
parent bf3ed0ed42
commit be9bda7f04
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
4 changed files with 20 additions and 23 deletions

View File

@ -273,7 +273,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,null) hangup(true, null)
} }
private val offerMessageListener = OfferMessageListener { sessionId, roomType, sdp, nick -> private val offerMessageListener = OfferMessageListener { sessionId, roomType, sdp, nick ->
getOrCreatePeerConnectionWrapperForSessionIdAndType( getOrCreatePeerConnectionWrapperForSessionIdAndType(
@ -505,7 +505,7 @@ class CallActivity : CallBaseActivity() {
} }
.setNegativeButton(R.string.nc_no) { _, _ -> .setNegativeButton(R.string.nc_no) { _, _ ->
recordingConsentGiven = false recordingConsentGiven = false
hangup(true,null) hangup(true, null)
} }
viewThemeUtils.dialog.colorMaterialAlertDialogBackground(this, materialAlertDialogBuilder) viewThemeUtils.dialog.colorMaterialAlertDialogBackground(this, materialAlertDialogBuilder)
@ -621,7 +621,11 @@ class CallActivity : CallBaseActivity() {
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
private fun initClickListeners(isModerator:Boolean, isOneToOneConversation:Boolean, isGroupConversation:Boolean) { private fun initClickListeners(
isModerator: Boolean,
isOneToOneConversation: Boolean,
isGroupConversation: Boolean
) {
binding!!.pictureInPictureButton.setOnClickListener { enterPipMode() } binding!!.pictureInPictureButton.setOnClickListener { enterPipMode() }
binding!!.audioOutputButton.setOnClickListener { binding!!.audioOutputButton.setOnClickListener {
@ -672,19 +676,19 @@ class CallActivity : CallBaseActivity() {
} }
} }
if(isGroupConversation){ if (isGroupConversation) {
binding!!.hangupButton.setOnClickListener { binding!!.hangupButton.setOnClickListener {
hangup(true, null) hangup(true, null)
} }
} }
if(isOneToOneConversation && isModerator){ if (isOneToOneConversation && isModerator) {
binding!!.hangupButton.setOnClickListener { binding!!.hangupButton.setOnClickListener {
showPopupMenu() showPopupMenu()
} }
} }
if(isOneToOneConversation){ if (isOneToOneConversation) {
binding!!.hangupButton.setOnLongClickListener { binding!!.hangupButton.setOnLongClickListener {
hangup(true, null) hangup(true, null)
true true
@ -698,7 +702,6 @@ class CallActivity : CallBaseActivity() {
} }
} }
binding!!.popupMenu.setOnClickListener { binding!!.popupMenu.setOnClickListener {
hangup(true, true) hangup(true, true)
binding!!.popupMenu.visibility = View.GONE binding!!.popupMenu.visibility = View.GONE
@ -741,7 +744,6 @@ class CallActivity : CallBaseActivity() {
private fun showPopupMenu() { private fun showPopupMenu() {
binding!!.popupMenu.visibility = View.VISIBLE binding!!.popupMenu.visibility = View.VISIBLE
} }
private fun createCameraEnumerator() { private fun createCameraEnumerator() {
@ -1377,11 +1379,8 @@ class CallActivity : CallBaseActivity() {
} }
override fun dispatchTouchEvent(event: MotionEvent): Boolean { override fun dispatchTouchEvent(event: MotionEvent): Boolean {
if (binding!!.popupMenu.visibility == View.VISIBLE) { if (binding!!.popupMenu.visibility == View.VISIBLE) {
if (event.action == MotionEvent.ACTION_DOWN) { if (event.action == MotionEvent.ACTION_DOWN) {
val buttonLocation = IntArray(2) val buttonLocation = IntArray(2)
binding!!.popupMenu.getLocationOnScreen(buttonLocation) binding!!.popupMenu.getLocationOnScreen(buttonLocation)
@ -1403,7 +1402,6 @@ class CallActivity : CallBaseActivity() {
return super.dispatchTouchEvent(event) return super.dispatchTouchEvent(event)
} }
fun clickRaiseOrLowerHandButton() { fun clickRaiseOrLowerHandButton() {
raiseHandViewModel!!.clickHandButton() raiseHandViewModel!!.clickHandButton()
} }
@ -2026,7 +2024,7 @@ class CallActivity : CallBaseActivity() {
} }
} }
private fun hangup(shutDownView: Boolean, endCallForAll: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)
@ -2091,7 +2089,7 @@ class CallActivity : CallBaseActivity() {
ApplicationWideCurrentRoomHolder.getInstance().isInCall = false ApplicationWideCurrentRoomHolder.getInstance().isInCall = false
ApplicationWideCurrentRoomHolder.getInstance().isDialing = false ApplicationWideCurrentRoomHolder.getInstance().isDialing = false
hangupNetworkCalls(shutDownView,endCallForAll) hangupNetworkCalls(shutDownView, endCallForAll)
} }
private fun hangupNetworkCalls(shutDownView: Boolean, endCallForAll: Boolean?) { private fun hangupNetworkCalls(shutDownView: Boolean, endCallForAll: Boolean?) {
@ -2102,7 +2100,7 @@ class CallActivity : CallBaseActivity() {
callParticipantList!!.destroy() callParticipantList!!.destroy()
} }
ncApi!!.leaveCall(credentials, ApiUtils.getUrlForCall(apiVersion, baseUrl, roomToken!!),endCallForAll) ncApi!!.leaveCall(credentials, ApiUtils.getUrlForCall(apiVersion, baseUrl, roomToken!!), endCallForAll)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(object : Observer<GenericOverall> { .subscribe(object : Observer<GenericOverall> {
@ -2323,7 +2321,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,null) hangup(true, null)
return null return null
} }
peerConnectionWrapper = if (hasMCU && publisher) { peerConnectionWrapper = if (hasMCU && publisher) {

View File

@ -24,11 +24,11 @@ object ConversationUtils {
Participant.ParticipantType.USER_FOLLOWING_LINK == conversation.participantType Participant.ParticipantType.USER_FOLLOWING_LINK == conversation.participantType
} }
fun isOneToOneConversation(conversation:ConversationModel):Boolean{ fun isOneToOneConversation(conversation: ConversationModel): Boolean {
return ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL == conversation.type return ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL == conversation.type
} }
fun isGroupConversation(conversation:ConversationModel):Boolean{ fun isGroupConversation(conversation: ConversationModel): Boolean {
return ConversationEnums.ConversationType.ROOM_GROUP_CALL == conversation.type return ConversationEnums.ConversationType.ROOM_GROUP_CALL == conversation.type
} }
@ -67,5 +67,4 @@ object ConversationUtils {
return currentConversation != null && return currentConversation != null &&
currentConversation.type == ConversationEnums.ConversationType.NOTE_TO_SELF currentConversation.type == ConversationEnums.ConversationType.NOTE_TO_SELF
} }
} }

View File

@ -80,6 +80,6 @@ object BundleKeys {
const val KEY_CREDENTIALS: String = "KEY_CREDENTIALS" const val KEY_CREDENTIALS: String = "KEY_CREDENTIALS"
const val KEY_FIELD_MAP: String = "KEY_FIELD_MAP" const val KEY_FIELD_MAP: String = "KEY_FIELD_MAP"
const val KEY_CHAT_URL: String = "KEY_CHAT_URL" const val KEY_CHAT_URL: String = "KEY_CHAT_URL"
const val KEY_IS_ROOM_ONE_TO_ONE : String = "KEY_IS_ROOM_ONE_TO_ONE" const val KEY_IS_ROOM_ONE_TO_ONE: String = "KEY_IS_ROOM_ONE_TO_ONE"
const val KEY_IS_ROOM_GROUP : String = "KEY_IS_ROOM_GROUP" const val KEY_IS_ROOM_GROUP: String = "KEY_IS_ROOM_GROUP"
} }

View File

@ -310,7 +310,7 @@ 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="end_call_for_everyone">End Call for everyone</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>