Completed app bar icon tooltips

This commit is contained in:
Juha Heinanen
2025-04-26 10:46:47 +03:00
parent d19bf4db78
commit 04d5fa2bf1
2 changed files with 56 additions and 64 deletions
+2 -2
View File
@@ -11,8 +11,8 @@ android {
applicationId = "com.tutpro.baresip" applicationId = "com.tutpro.baresip"
minSdk = 28 minSdk = 28
targetSdk = 35 targetSdk = 35
versionCode = 426 versionCode = 427
versionName = "65.3.0" versionName = "66.0.0"
externalNativeBuild { externalNativeBuild {
cmake { cmake {
cFlags += "-DHAVE_INTTYPES_H -lstdc++" cFlags += "-DHAVE_INTTYPES_H -lstdc++"
@@ -678,8 +678,9 @@ class MainActivity : ComponentActivity() {
), ),
actions = { actions = {
IconButton( Icon(
modifier = Modifier.combinedClickable( imageVector = recImage,
modifier = Modifier.size(40.dp).combinedClickable(
onClick = { onClick = {
if (Call.call("connected") == null) { if (Call.call("connected") == null) {
BaresipService.isRecOn = !BaresipService.isRecOn BaresipService.isRecOn = !BaresipService.isRecOn
@@ -696,77 +697,68 @@ class MainActivity : ComponentActivity() {
onLongClick = { onLongClick = {
alertTitle.value = "Call Recording" alertTitle.value = "Call Recording"
alertMessage.value = "If activated, new incoming and outgoing calls will be recorded." + alertMessage.value = "If activated, new incoming and outgoing calls will be recorded." +
"Recordings can be played on Call Details page" " Recordings can be played on Call Details page"
showAlert.value = true showAlert.value = true
} }
), ),
onClick = {} tint = Color.Unspecified,
) { contentDescription = null
Icon( )
imageVector = recImage,
tint = Color.Unspecified,
contentDescription = null
)
}
Spacer(modifier = Modifier.width(16.dp)) Spacer(modifier = Modifier.width(22.dp))
IconButton( Icon(
modifier = Modifier.padding(end=12.dp) imageVector = ImageVector.vectorResource(micIcon),
.combinedClickable( modifier = Modifier.size(40.dp).combinedClickable(
onClick = {
if (Call.call("connected") != null) {
BaresipService.isMicMuted = !BaresipService.isMicMuted
if (BaresipService.isMicMuted) {
micIcon = R.drawable.mic_off
Api.calls_mute(true)
} else {
micIcon = R.drawable.mic_on
Api.calls_mute(false)
}
}
},
onLongClick = {
alertTitle.value = "Microphone"
alertMessage.value = "If activated, microphone is muted."
showAlert.value = true
},
),
onClick = {}
) {
Icon(
imageVector = ImageVector.vectorResource(micIcon),
tint = Color.Unspecified,
contentDescription = null)
}
IconButton(
modifier = Modifier.padding(end=6.dp)
.combinedClickable(
onClick = { onClick = {
if (Build.VERSION.SDK_INT >= 31) if (Call.call("connected") != null) {
Log.d(TAG, "Toggling speakerphone when dev/mode is " + BaresipService.isMicMuted = !BaresipService.isMicMuted
"${am.communicationDevice!!.type}/${am.mode}" if (BaresipService.isMicMuted) {
) micIcon = R.drawable.mic_off
Utils.toggleSpeakerPhone(ContextCompat.getMainExecutor(ctx), am) Api.calls_mute(true)
speakerIcon = if (Utils.isSpeakerPhoneOn(am)) } else {
R.drawable.speaker_on micIcon = R.drawable.mic_on
else Api.calls_mute(false)
R.drawable.speaker_off }
}
}, },
onLongClick = { onLongClick = {
alertTitle.value = "Speakerphone" alertTitle.value = "Microphone"
alertMessage.value = "If activated, audio is player via speakerphone." alertMessage.value = "If activated during call, microphone is muted."
showAlert.value = true showAlert.value = true
}, },
), ),
onClick = {} tint = Color.Unspecified,
) { contentDescription = null
Icon( )
imageVector = ImageVector.vectorResource(speakerIcon),
tint = Color.Unspecified, Spacer(modifier = Modifier.width(16.dp))
contentDescription = null)
} Icon(
imageVector = ImageVector.vectorResource(speakerIcon),
modifier = Modifier.size(40.dp).combinedClickable(
onClick = {
if (Build.VERSION.SDK_INT >= 31)
Log.d(TAG, "Toggling speakerphone when dev/mode is " +
"${am.communicationDevice!!.type}/${am.mode}"
)
Utils.toggleSpeakerPhone(ContextCompat.getMainExecutor(ctx), am)
speakerIcon = if (Utils.isSpeakerPhoneOn(am))
R.drawable.speaker_on
else
R.drawable.speaker_off
},
onLongClick = {
alertTitle.value = "Speakerphone"
alertMessage.value = "If activated, audio is player via device speakerphone."
showAlert.value = true
},
),
tint = Color.Unspecified,
contentDescription = null
)
Spacer(modifier = Modifier.width(8.dp))
IconButton( IconButton(
onClick = { menuExpanded = !menuExpanded } onClick = { menuExpanded = !menuExpanded }