Improved mainscreen call row layout
This commit is contained in:
@@ -1472,7 +1472,8 @@ private fun CallRow(
|
||||
Row( modifier = Modifier
|
||||
.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center
|
||||
horizontalArrangement = if (isDialer || call?.showCancelButton?.value == true || call?.showAnswerRejectButtons?.value == true)
|
||||
Arrangement.Center else Arrangement.SpaceBetween
|
||||
) {
|
||||
if (isDialer) {
|
||||
if (dialerState.showCallButton.value)
|
||||
@@ -1524,8 +1525,6 @@ private fun CallRow(
|
||||
}
|
||||
else {
|
||||
if (call!!.showCancelButton.value) {
|
||||
if (!call.conferenceCall)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
IconButton(
|
||||
modifier = Modifier.size(48.dp),
|
||||
enabled = !call.terminated.value,
|
||||
@@ -1543,11 +1542,9 @@ private fun CallRow(
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
}
|
||||
|
||||
if (call.showHangupButton.value) {
|
||||
|
||||
IconButton(
|
||||
modifier = Modifier.size(48.dp),
|
||||
enabled = !call.terminated.value,
|
||||
@@ -1565,8 +1562,9 @@ private fun CallRow(
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (!call.conferenceCall)
|
||||
if (call.showHangupButton.value && !call.conferenceCall)
|
||||
IconButton( modifier = Modifier.size(48.dp),
|
||||
onClick = {
|
||||
if (call.callOnHold.value) {
|
||||
@@ -1591,7 +1589,7 @@ private fun CallRow(
|
||||
|
||||
var showTransferDialog by remember { mutableStateOf(false) }
|
||||
|
||||
if (!call.conferenceCall)
|
||||
if (call.showHangupButton.value && !call.conferenceCall && !call.ua.account.isMobile)
|
||||
IconButton(
|
||||
modifier = Modifier.size(48.dp),
|
||||
enabled = call.transferButtonEnabled.value,
|
||||
@@ -1870,6 +1868,7 @@ private fun CallRow(
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
val shouldRequestFocus by call.focusDtmf
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
if (call.showHangupButton.value)
|
||||
BasicTextField(
|
||||
value = call.dtmfText.value,
|
||||
onValueChange = { newText ->
|
||||
@@ -1924,6 +1923,7 @@ private fun CallRow(
|
||||
)
|
||||
}
|
||||
)
|
||||
if (call.showHangupButton.value)
|
||||
LaunchedEffect(shouldRequestFocus) {
|
||||
if (shouldRequestFocus) {
|
||||
focusRequester.requestFocus()
|
||||
@@ -1931,6 +1931,7 @@ private fun CallRow(
|
||||
}
|
||||
}
|
||||
|
||||
if (call.showHangupButton.value && !call.ua.account.isMobile)
|
||||
IconButton(
|
||||
modifier = Modifier.size(48.dp),
|
||||
onClick = {
|
||||
@@ -1970,7 +1971,6 @@ private fun CallRow(
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (call.showAnswerRejectButtons.value) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user