Changed some vars to vals
This commit is contained in:
@@ -136,8 +136,8 @@ import java.text.SimpleDateFormat
|
|||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
private var dialpadButtonEnabled by mutableStateOf(true)
|
private val dialpadButtonEnabled = mutableStateOf(true)
|
||||||
private var pullToRefreshEnabled by mutableStateOf(true)
|
private var pullToRefreshEnabled = mutableStateOf(true)
|
||||||
|
|
||||||
private var downloadsInputUri: Uri? = null
|
private var downloadsInputUri: Uri? = null
|
||||||
private var downloadsOutputUri: Uri? = null
|
private var downloadsOutputUri: Uri? = null
|
||||||
@@ -741,7 +741,7 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.size(buttonSize),
|
.size(buttonSize),
|
||||||
enabled = dialpadButtonEnabled
|
enabled = dialpadButtonEnabled.value
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = ImageVector.vectorResource(dialpadIcon),
|
imageVector = ImageVector.vectorResource(dialpadIcon),
|
||||||
@@ -768,11 +768,11 @@ private val showAnswerRejectButtons = mutableStateOf(false)
|
|||||||
private val showHangupButton = mutableStateOf(false)
|
private val showHangupButton = mutableStateOf(false)
|
||||||
private val showOnHoldNotice = mutableStateOf(false)
|
private val showOnHoldNotice = mutableStateOf(false)
|
||||||
private var holdIcon = mutableIntStateOf(R.drawable.call_hold)
|
private var holdIcon = mutableIntStateOf(R.drawable.call_hold)
|
||||||
private var transferButtonEnabled = mutableStateOf(false)
|
private val transferButtonEnabled = mutableStateOf(false)
|
||||||
private val transferIcon = mutableIntStateOf(R.drawable.call_transfer)
|
private val transferIcon = mutableIntStateOf(R.drawable.call_transfer)
|
||||||
private var dtmfText = mutableStateOf("")
|
private var dtmfText = mutableStateOf("")
|
||||||
private val dtmfEnabled = mutableStateOf(false)
|
private val dtmfEnabled = mutableStateOf(false)
|
||||||
private var focusDtmf = mutableStateOf(false)
|
private val focusDtmf = mutableStateOf(false)
|
||||||
|
|
||||||
private val alertTitle = mutableStateOf("")
|
private val alertTitle = mutableStateOf("")
|
||||||
private val alertMessage = mutableStateOf("")
|
private val alertMessage = mutableStateOf("")
|
||||||
@@ -850,7 +850,7 @@ private fun MainContent(navController: NavController, viewModel: ViewModel, cont
|
|||||||
Api.ua_register(ua.uap)
|
Api.ua_register(ua.uap)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
enabled = pullToRefreshEnabled,
|
enabled = pullToRefreshEnabled.value,
|
||||||
)
|
)
|
||||||
.pointerInput(Unit) {
|
.pointerInput(Unit) {
|
||||||
detectHorizontalDragGestures(
|
detectHorizontalDragGestures(
|
||||||
@@ -1992,7 +1992,7 @@ private fun showCall(ctx: Context, viewModel: ViewModel, ua: UserAgent?, showCal
|
|||||||
return
|
return
|
||||||
val call = showCall ?: ua.currentCall()
|
val call = showCall ?: ua.currentCall()
|
||||||
if (call == null) {
|
if (call == null) {
|
||||||
pullToRefreshEnabled = true
|
pullToRefreshEnabled.value = true
|
||||||
if (ua.account.resumeUri != "")
|
if (ua.account.resumeUri != "")
|
||||||
callUri.value = ua.account.resumeUri
|
callUri.value = ua.account.resumeUri
|
||||||
else
|
else
|
||||||
@@ -2012,13 +2012,13 @@ private fun showCall(ctx: Context, viewModel: ViewModel, ua: UserAgent?, showCal
|
|||||||
showCancelButton.value = false
|
showCancelButton.value = false
|
||||||
showAnswerRejectButtons.value = false
|
showAnswerRejectButtons.value = false
|
||||||
showOnHoldNotice.value = false
|
showOnHoldNotice.value = false
|
||||||
dialpadButtonEnabled = true
|
dialpadButtonEnabled.value = true
|
||||||
if (BaresipService.isMicMuted) {
|
if (BaresipService.isMicMuted) {
|
||||||
BaresipService.isMicMuted = false
|
BaresipService.isMicMuted = false
|
||||||
viewModel.updateMicIcon(R.drawable.mic_on)
|
viewModel.updateMicIcon(R.drawable.mic_on)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pullToRefreshEnabled = false
|
pullToRefreshEnabled.value = false
|
||||||
callUriEnabled.value = false
|
callUriEnabled.value = false
|
||||||
when (call.status) {
|
when (call.status) {
|
||||||
"outgoing", "transferring", "answered" -> {
|
"outgoing", "transferring", "answered" -> {
|
||||||
@@ -2034,7 +2034,7 @@ private fun showCall(ctx: Context, viewModel: ViewModel, ua: UserAgent?, showCal
|
|||||||
showHangupButton.value = !showCancelButton.value
|
showHangupButton.value = !showCancelButton.value
|
||||||
showAnswerRejectButtons.value = false
|
showAnswerRejectButtons.value = false
|
||||||
showOnHoldNotice.value = false
|
showOnHoldNotice.value = false
|
||||||
dialpadButtonEnabled = false
|
dialpadButtonEnabled.value = false
|
||||||
}
|
}
|
||||||
"incoming" -> {
|
"incoming" -> {
|
||||||
showCallTimer.value = false
|
showCallTimer.value = false
|
||||||
@@ -2053,7 +2053,7 @@ private fun showCall(ctx: Context, viewModel: ViewModel, ua: UserAgent?, showCal
|
|||||||
showHangupButton.value = false
|
showHangupButton.value = false
|
||||||
showAnswerRejectButtons.value = true
|
showAnswerRejectButtons.value = true
|
||||||
showOnHoldNotice.value = false
|
showOnHoldNotice.value = false
|
||||||
dialpadButtonEnabled = false
|
dialpadButtonEnabled.value = false
|
||||||
}
|
}
|
||||||
"connected" -> {
|
"connected" -> {
|
||||||
if (call.referTo != "") {
|
if (call.referTo != "") {
|
||||||
|
|||||||
Reference in New Issue
Block a user