mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
VoIP : clean code
This commit is contained in:
parent
0f77c5be90
commit
1ef9ed5202
7 changed files with 5 additions and 15 deletions
|
@ -29,4 +29,4 @@ data class CallCapabilities(
|
|||
@Json(name = "m.call.transferee") val transferee: Boolean? = null
|
||||
)
|
||||
|
||||
fun CallCapabilities?.supportCallTransfer() = true//this?.transferee.orFalse()
|
||||
fun CallCapabilities?.supportCallTransfer() = this?.transferee.orFalse()
|
||||
|
|
|
@ -48,7 +48,6 @@ class CallAudioManager(
|
|||
|
||||
private var savedIsSpeakerPhoneOn = false
|
||||
private var savedIsMicrophoneMute = false
|
||||
private var savedAudioMode = AudioManager.MODE_INVALID
|
||||
|
||||
private var connectedBlueToothHeadset: BluetoothProfile? = null
|
||||
private var wantsBluetoothConnection = false
|
||||
|
@ -100,8 +99,6 @@ class CallAudioManager(
|
|||
val audioManager = audioManager ?: return
|
||||
savedIsSpeakerPhoneOn = audioManager.isSpeakerphoneOn
|
||||
savedIsMicrophoneMute = audioManager.isMicrophoneMute
|
||||
savedAudioMode = audioManager.mode
|
||||
|
||||
// Request audio playout focus (without ducking) and install listener for changes in focus.
|
||||
|
||||
// Remove the deprecation forces us to use 2 different method depending on API level
|
||||
|
@ -171,8 +168,6 @@ class CallAudioManager(
|
|||
// Restore previously stored audio states.
|
||||
setSpeakerphoneOn(savedIsSpeakerPhoneOn)
|
||||
setMicrophoneMute(savedIsMicrophoneMute)
|
||||
audioManager?.mode = savedAudioMode
|
||||
|
||||
connectedBlueToothHeadset?.let {
|
||||
if (audioManager != null && isBluetoothHeadsetConnected(audioManager!!)) {
|
||||
audioManager?.stopBluetoothSco()
|
||||
|
|
|
@ -20,7 +20,6 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import com.airbnb.mvrx.MvRx
|
||||
import com.airbnb.mvrx.viewModel
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
|
@ -31,7 +30,6 @@ import im.vector.app.core.platform.VectorBaseActivity
|
|||
import im.vector.app.databinding.ActivityCallTransferBinding
|
||||
import im.vector.app.features.contactsbook.ContactsBookViewModel
|
||||
import im.vector.app.features.contactsbook.ContactsBookViewState
|
||||
import im.vector.app.features.userdirectory.UserListSharedActionViewModel
|
||||
import im.vector.app.features.userdirectory.UserListViewModel
|
||||
import im.vector.app.features.userdirectory.UserListViewState
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
|
|
@ -29,7 +29,7 @@ import im.vector.app.features.userdirectory.UserListFragmentArgs
|
|||
|
||||
class CallTransferPagerAdapter(
|
||||
private val fragmentActivity: FragmentActivity
|
||||
) : FragmentStateAdapter(fragmentActivity), Restorable{
|
||||
) : FragmentStateAdapter(fragmentActivity), Restorable {
|
||||
|
||||
val userListFragment: UserListFragment?
|
||||
get() = findFragmentAtPosition(0) as? UserListFragment
|
||||
|
@ -76,7 +76,7 @@ class CallTransferPagerAdapter(
|
|||
dialPadFragment?.applyCallback()
|
||||
}
|
||||
|
||||
private fun DialPadFragment.applyCallback(): DialPadFragment{
|
||||
private fun DialPadFragment.applyCallback(): DialPadFragment {
|
||||
callback = object : DialPadFragment.Callback {
|
||||
override fun onOkClicked(formatted: String?, raw: String?) {
|
||||
if (raw.isNullOrEmpty()) return
|
||||
|
@ -85,6 +85,4 @@ class CallTransferPagerAdapter(
|
|||
}
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -103,5 +103,4 @@ class CallTransferViewModel @AssistedInject constructor(@Assisted initialState:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class UserListController @Inject constructor(private val session: Session,
|
|||
})
|
||||
}
|
||||
}
|
||||
if(currentState.showContactBookAction) {
|
||||
if (currentState.showContactBookAction) {
|
||||
actionItem {
|
||||
id(R.drawable.ic_baseline_perm_contact_calendar_24)
|
||||
title(stringProvider.getString(R.string.contacts_book_title))
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
android:textSize="16sp"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottomSheetActionSubTitle"
|
||||
app:layout_constraintEnd_toStartOf="@+id/itemVerificationActionIcon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/bottomSheetActionIcon"
|
||||
app:layout_constraintStart_toEndOf="@+id/bottomSheetActionLeftIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
|
|
Loading…
Reference in a new issue