Show yellow call button when call button has been touched, but call has not been made yet
This commit is contained in:
@ -1293,7 +1293,10 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
||||
enabled=callButtonEnabled.value
|
||||
) {
|
||||
Icon(
|
||||
imageVector = ImageVector.vectorResource(id = R.drawable.call),
|
||||
imageVector = if (callButtonEnabled.value)
|
||||
ImageVector.vectorResource(id = R.drawable.call)
|
||||
else
|
||||
ImageVector.vectorResource(id = R.drawable.call_yellow),
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = Color.Unspecified,
|
||||
contentDescription = null,
|
||||
@ -1794,7 +1797,6 @@ private fun callClick(ctx: Context, viewModel: ViewModel) {
|
||||
return
|
||||
val uriText = callUri.value.trim()
|
||||
if (uriText.isNotEmpty()) {
|
||||
callButtonEnabled.value = false
|
||||
val uris = Contact.contactUris(uriText)
|
||||
if (uris.isEmpty())
|
||||
makeCall(ctx, viewModel, uriText)
|
||||
@ -1847,6 +1849,7 @@ private fun makeCall(ctx: Context, viewModel: ViewModel, uriText: String) {
|
||||
else if (!BaresipService.requestAudioFocus(ctx))
|
||||
Toast.makeText(ctx, R.string.audio_focus_denied, Toast.LENGTH_SHORT).show()
|
||||
else {
|
||||
callButtonEnabled.value = false
|
||||
if (Build.VERSION.SDK_INT < 31) {
|
||||
Log.d(TAG, "Setting audio mode to MODE_IN_COMMUNICATION")
|
||||
am.mode = AudioManager.MODE_IN_COMMUNICATION
|
||||
|
||||
5
app/src/main/res/drawable/call_yellow.xml
Normal file
5
app/src/main/res/drawable/call_yellow.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="48dp" android:width="48dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@color/colorTrafficYellow" android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z"/>
|
||||
</vector>
|
||||
Reference in New Issue
Block a user