diff --git a/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt b/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt index 766f600b..635f28fa 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt @@ -45,18 +45,20 @@ fun AppTheme( val customColorsPalette = basePalette.copy( background = colorScheme.background, + onBackground = if (useActualDynamicColors) + colorScheme.onBackground + else + basePalette.onBackground, cardBackground = colorScheme.surfaceVariant, textFieldBackground = colorScheme.surfaceVariant, - primary = if (useActualDynamicColors) { + primary = if (useActualDynamicColors) colorScheme.primary - } else { - basePalette.primary - }, - onPrimary = if (useActualDynamicColors) { + else + basePalette.primary, + onPrimary = if (useActualDynamicColors) colorScheme.onPrimary - } else { + else basePalette.onPrimary - } ) val view = LocalView.current diff --git a/app/src/main/kotlin/com/tutpro/baresip/CustomColors.kt b/app/src/main/kotlin/com/tutpro/baresip/CustomColors.kt index 4e4b6c9f..f50ef031 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CustomColors.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CustomColors.kt @@ -35,6 +35,7 @@ data class CustomColors( val alertText: Color = Color.Unspecified, val codec: Color = Color.Unspecified, val background: Color = Color.Unspecified, + val onBackground: Color = Color.Unspecified, val cardBackground: Color = Color.Unspecified, val textFieldBackground: Color = Color.Unspecified, val popupBackground: Color = Color.Unspecified, @@ -58,6 +59,8 @@ val light_dark = Color(0xFF383838) val light_spinner_divider = light_gray val light_item_text = light_dark val light_background = light_light + +val light_on_background = Color(0xFF00B9A1) val light_textfield_background = light_gray_light val light_card_background = light_gray_light val light_popup_background = light_secondary_dark @@ -79,6 +82,7 @@ val dark_dark = Color(0xFF121212) val dark_spinner_divider = dark_gray_dark val dark_item_text = dark_gray_light val dark_background = dark_dark +val dark_on_background = Color(0xFF00B9A1) val dark_textfield_background = dark_gray val dark_card_background = dark_gray_dark val dark_popup_background = dark_secondary_dark @@ -101,6 +105,7 @@ val LightCustomColors = CustomColors( spinnerDivider = light_spinner_divider, itemText = light_item_text, background = light_background, + onBackground = light_on_background, cardBackground = light_card_background, textFieldBackground = light_textfield_background, popupBackground = light_popup_background, @@ -124,6 +129,7 @@ val DarkCustomColors = CustomColors( spinnerDivider = dark_spinner_divider, itemText = dark_item_text, background = dark_background, + onBackground = dark_on_background, cardBackground = dark_card_background, textFieldBackground = dark_textfield_background, popupBackground = dark_popup_background, diff --git a/app/src/main/kotlin/com/tutpro/baresip/CustomElements.kt b/app/src/main/kotlin/com/tutpro/baresip/CustomElements.kt index b4488293..ec684e75 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CustomElements.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CustomElements.kt @@ -148,7 +148,7 @@ object CustomElements { DropdownMenu( expanded = expanded, onDismissRequest = onDismissRequest, - containerColor = LocalCustomColors.current.grayLight, + containerColor = LocalCustomColors.current.onPrimary, modifier = Modifier.background( LocalCustomColors.current.popupBackground.copy(alpha = 0.95f) ) diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt index 3c8903a5..70542785 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt @@ -556,7 +556,10 @@ private fun TopAppBar( showAlert.value = true } ), - tint = Color.Unspecified, + tint = if (BaresipService.isRecOn) + LocalCustomColors.current.accent + else + LocalCustomColors.current.onPrimary, contentDescription = null ) @@ -585,7 +588,10 @@ private fun TopAppBar( showAlert.value = true }, ), - tint = Color.Unspecified, + tint = if (BaresipService.isMicMuted) + LocalCustomColors.current.accent + else + LocalCustomColors.current.onPrimary, contentDescription = null ) @@ -616,7 +622,10 @@ private fun TopAppBar( showAlert.value = true }, ), - tint = Color.Unspecified, + tint = if (Utils.isSpeakerPhoneOn(am)) + LocalCustomColors.current.accent + else + LocalCustomColors.current.onPrimary, contentDescription = null ) @@ -628,7 +637,7 @@ private fun TopAppBar( Icon( imageVector = Icons.Filled.Menu, contentDescription = "Menu", - tint = LocalCustomColors.current.light + tint = LocalCustomColors.current.onPrimary ) } @@ -705,7 +714,10 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont imageVector = ImageVector.vectorResource(vmIcon), contentDescription = null, Modifier.size(buttonSize), - tint = Color.Unspecified + tint = if (vmIcon == R.drawable.voicemail) + LocalCustomColors.current.onBackground + else + LocalCustomColors.current.accent ) } @@ -719,7 +731,7 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont imageVector = ImageVector.vectorResource(R.drawable.contacts), contentDescription = null, Modifier.size(buttonSize), - tint = LocalCustomColors.current.secondary + tint = LocalCustomColors.current.onBackground ) } @@ -736,7 +748,10 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont imageVector = ImageVector.vectorResource(messagesIcon), contentDescription = null, Modifier.size(buttonSize), - tint = Color.Unspecified + tint = if (messagesIcon == R.drawable.messages) + LocalCustomColors.current.onBackground + else + LocalCustomColors.current.accent ) } @@ -753,7 +768,10 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont imageVector = ImageVector.vectorResource(callsIcon), contentDescription = null, Modifier.size(buttonSize), - tint = Color.Unspecified + tint = if (callsIcon == R.drawable.calls) + LocalCustomColors.current.onBackground + else + LocalCustomColors.current.accent ) } @@ -773,7 +791,10 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont imageVector = ImageVector.vectorResource(dialpadIcon), contentDescription = null, modifier = Modifier.size(buttonSize), - tint = Color.Unspecified + tint = if (dialpadIcon == R.drawable.dialpad_off) + LocalCustomColors.current.onBackground + else + LocalCustomColors.current.accent ) } } diff --git a/app/src/main/res/drawable/calls.xml b/app/src/main/res/drawable/calls.xml index dea22896..468a767f 100644 --- a/app/src/main/res/drawable/calls.xml +++ b/app/src/main/res/drawable/calls.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/calls_missed.xml b/app/src/main/res/drawable/calls_missed.xml index 77ab4138..468a767f 100644 --- a/app/src/main/res/drawable/calls_missed.xml +++ b/app/src/main/res/drawable/calls_missed.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/contacts.xml b/app/src/main/res/drawable/contacts.xml index fc8a097d..6d3e4620 100644 --- a/app/src/main/res/drawable/contacts.xml +++ b/app/src/main/res/drawable/contacts.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/dialpad_off.xml b/app/src/main/res/drawable/dialpad_off.xml index 432dfcf5..2fd6b9f5 100644 --- a/app/src/main/res/drawable/dialpad_off.xml +++ b/app/src/main/res/drawable/dialpad_off.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/dialpad_on.xml b/app/src/main/res/drawable/dialpad_on.xml index a27db0e6..2fd6b9f5 100644 --- a/app/src/main/res/drawable/dialpad_on.xml +++ b/app/src/main/res/drawable/dialpad_on.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/messages.xml b/app/src/main/res/drawable/messages.xml index 4491701a..17639e86 100644 --- a/app/src/main/res/drawable/messages.xml +++ b/app/src/main/res/drawable/messages.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/messages_unread.xml b/app/src/main/res/drawable/messages_unread.xml index 3d3e147d..17639e86 100644 --- a/app/src/main/res/drawable/messages_unread.xml +++ b/app/src/main/res/drawable/messages_unread.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/mic_off.xml b/app/src/main/res/drawable/mic_off.xml index 2eff6489..4b741285 100644 --- a/app/src/main/res/drawable/mic_off.xml +++ b/app/src/main/res/drawable/mic_off.xml @@ -1,5 +1,4 @@ diff --git a/app/src/main/res/drawable/rec_off.xml b/app/src/main/res/drawable/rec_off.xml index ce5c9ff7..ae0b6c01 100644 --- a/app/src/main/res/drawable/rec_off.xml +++ b/app/src/main/res/drawable/rec_off.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/rec_on.xml b/app/src/main/res/drawable/rec_on.xml index 2512585d..1de36da6 100644 --- a/app/src/main/res/drawable/rec_on.xml +++ b/app/src/main/res/drawable/rec_on.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/speaker_off.xml b/app/src/main/res/drawable/speaker_off.xml index 6bdb9f76..d91a9145 100644 --- a/app/src/main/res/drawable/speaker_off.xml +++ b/app/src/main/res/drawable/speaker_off.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/speaker_on.xml b/app/src/main/res/drawable/speaker_on.xml index 0e955a2f..d91a9145 100644 --- a/app/src/main/res/drawable/speaker_on.xml +++ b/app/src/main/res/drawable/speaker_on.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/voicemail.xml b/app/src/main/res/drawable/voicemail.xml index 169f9529..d243e512 100644 --- a/app/src/main/res/drawable/voicemail.xml +++ b/app/src/main/res/drawable/voicemail.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/voicemail_new.xml b/app/src/main/res/drawable/voicemail_new.xml index 76d4d7f0..d243e512 100644 --- a/app/src/main/res/drawable/voicemail_new.xml +++ b/app/src/main/res/drawable/voicemail_new.xml @@ -1,4 +1,4 @@ -