From 80c75eda6414a328a374eadfda9225ddc29f8a3b Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sun, 19 Oct 2025 19:51:16 +0300 Subject: [PATCH] Work on migrating from local custom colors to material theme colors --- .../kotlin/com/tutpro/baresip/AboutScreen.kt | 15 +- .../com/tutpro/baresip/AccountsScreen.kt | 40 +++-- .../tutpro/baresip/AndroidContactScreen.kt | 24 +-- .../kotlin/com/tutpro/baresip/AppTheme.kt | 93 ++++++---- .../tutpro/baresip/BaresipContactScreen.kt | 25 +-- .../com/tutpro/baresip/CallDetailsScreen.kt | 10 +- .../kotlin/com/tutpro/baresip/CallsScreen.kt | 21 +-- .../kotlin/com/tutpro/baresip/ChatScreen.kt | 170 +++++++++--------- .../kotlin/com/tutpro/baresip/ChatsScreen.kt | 66 +++---- .../kotlin/com/tutpro/baresip/CodecsScreen.kt | 3 +- .../com/tutpro/baresip/ContactsScreen.kt | 30 ++-- .../kotlin/com/tutpro/baresip/CustomColors.kt | 16 +- .../kotlin/com/tutpro/baresip/MainScreen.kt | 83 +++++---- .../com/tutpro/baresip/SettingsScreen.kt | 77 ++++---- app/src/main/res/drawable/plus.xml | 5 - app/src/main/res/drawable/send.xml | 5 - 16 files changed, 360 insertions(+), 323 deletions(-) delete mode 100644 app/src/main/res/drawable/plus.xml delete mode 100644 app/src/main/res/drawable/send.xml diff --git a/app/src/main/kotlin/com/tutpro/baresip/AboutScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/AboutScreen.kt index 90cb0cd1..23feb660 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AboutScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AboutScreen.kt @@ -16,6 +16,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar @@ -44,12 +45,12 @@ fun NavGraphBuilder.aboutScreenRoute(navController: NavController) { private fun AboutScreen(onBack: () -> Unit) { Scaffold( modifier = Modifier.fillMaxSize().imePadding(), - containerColor = LocalCustomColors.current.background, + containerColor = MaterialTheme.colorScheme.background, topBar = { Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding( top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding() ) @@ -70,9 +71,9 @@ private fun AboutScreen(onBack: () -> Unit) { } }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - titleContentColor = LocalCustomColors.current.onPrimary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, + containerColor = MaterialTheme.colorScheme.primary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, ), windowInsets = WindowInsets(0, 0, 0, 0) ) @@ -82,9 +83,9 @@ private fun AboutScreen(onBack: () -> Unit) { Text( text = AnnotatedString.fromHtml( htmlString = stringResource(R.string.about_text, BuildConfig.VERSION_NAME), - linkStyles = TextLinkStyles(SpanStyle(color = LocalCustomColors.current.accent)) + linkStyles = TextLinkStyles(SpanStyle(color = MaterialTheme.colorScheme.error)) ), - color = LocalCustomColors.current.itemText, + color = MaterialTheme.colorScheme.onBackground, modifier = Modifier .padding(horizontal = 16.dp, vertical = 16.dp) .padding(contentPadding) diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountsScreen.kt index c5df78b1..bcb2bd72 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AccountsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AccountsScreen.kt @@ -13,8 +13,13 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.navigationBarsPadding +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBars +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll @@ -66,12 +71,12 @@ fun NavGraphBuilder.accountsScreenRoute(navController: NavController) { fun AccountsScreen(navController: NavController) { Scaffold( modifier = Modifier.fillMaxSize().imePadding(), - containerColor = LocalCustomColors.current.background, + containerColor = MaterialTheme.colorScheme.background, topBar = { Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding( top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding() ) @@ -84,9 +89,9 @@ fun AccountsScreen(navController: NavController) { ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, ), navigationIcon = { IconButton(onClick = { navController.popBackStack() }) { @@ -128,17 +133,23 @@ fun AccountsContent(contentPadding: PaddingValues, navController: NavController) val showAccounts = remember { mutableStateOf(true) } if (showAccounts.value && BaresipService.uas.value.isNotEmpty()) { - val scrollState = rememberScrollState() - Column( + + val lazyListState = rememberLazyListState() + + LazyColumn( + state = lazyListState, modifier = Modifier .fillMaxWidth() .padding(contentPadding) .padding(start = 16.dp, end = 4.dp, top = 8.dp, bottom = 8.dp) - .verticalScrollbar(scrollState) - .verticalScroll(state = scrollState), + .verticalScrollbar( + state = lazyListState, + width = 4.dp, + color = MaterialTheme.colorScheme.outlineVariant + ), verticalArrangement = Arrangement.spacedBy(4.dp), ) { - for (ua in BaresipService.uas.value) { + items(BaresipService.uas.value) { ua -> val account = ua.account val aor = account.aor val text = account.text() @@ -148,13 +159,16 @@ fun AccountsContent(contentPadding: PaddingValues, navController: NavController) Text( text = text, fontSize = 20.sp, - color = LocalCustomColors.current.itemText, - modifier = Modifier.weight(1f).padding(start = 10.dp) + color = MaterialTheme.colorScheme.onBackground, + modifier = Modifier + .weight(1f) + .padding(start = 10.dp) .clickable { navController.navigate("account/$aor/old") } ) SmallFloatingActionButton( + modifier = Modifier.padding(end = 8.dp), onClick = { message.value = String.format( ctx.getString(R.string.delete_account), @@ -280,6 +294,7 @@ fun NewAccount(navController: NavController) { ) ) SmallFloatingActionButton( + modifier = Modifier.offset(y = 2.dp), onClick = { val account = createNew(ctx, newAor.trim()) if (account != null) { @@ -293,6 +308,7 @@ fun NewAccount(navController: NavController) { ) { Icon( imageVector = Icons.Filled.Add, + modifier = Modifier.size(36.dp), contentDescription = stringResource(R.string.add) ) } diff --git a/app/src/main/kotlin/com/tutpro/baresip/AndroidContactScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/AndroidContactScreen.kt index cab2e06e..a59a57ca 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AndroidContactScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AndroidContactScreen.kt @@ -29,6 +29,7 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar @@ -53,6 +54,7 @@ import androidx.navigation.NavType import androidx.navigation.compose.composable import androidx.navigation.navArgument import coil.compose.AsyncImage +import com.tutpro.baresip.CustomElements.verticalScrollbar fun NavGraphBuilder.androidContactScreenRoute(navController: NavController, viewModel: ViewModel) { composable( @@ -79,12 +81,12 @@ private fun ContactScreen(ctx: Context, viewModel: ViewModel, navController: Nav } Scaffold( modifier = Modifier.fillMaxSize().imePadding(), - containerColor = LocalCustomColors.current.background, + containerColor = MaterialTheme.colorScheme.background, topBar = { Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()) ) { TopAppBar(name, navController) @@ -107,9 +109,9 @@ private fun TopAppBar(title: String, navController: NavController) { ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, ), windowInsets = WindowInsets(0, 0, 0, 0), navigationIcon = { @@ -134,7 +136,7 @@ private fun ContactContent( Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding(contentPadding) .padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 52.dp), verticalArrangement = Arrangement.spacedBy(12.dp), @@ -192,7 +194,7 @@ private fun ContactName(name: String) { verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Start ) { - Text(name, fontSize = 24.sp, color = LocalCustomColors.current.itemText) + Text(name, fontSize = 24.sp, color = MaterialTheme.colorScheme.onBackground) } } @@ -208,7 +210,7 @@ private fun Uris( modifier = Modifier .fillMaxWidth() .padding(start = 16.dp, end = 4.dp) - .background(LocalCustomColors.current.background), + .background(MaterialTheme.colorScheme.background), state = lazyListState, verticalArrangement = Arrangement.spacedBy(12.dp), ) { @@ -220,11 +222,11 @@ private fun Uris( text = uri.substringAfter(":"), modifier = Modifier.weight(1f), fontSize = 18.sp, - color = LocalCustomColors.current.itemText, + color = MaterialTheme.colorScheme.onBackground, ) Image( painter = painterResource(R.drawable.message), - colorFilter = ColorFilter.tint(LocalCustomColors.current.itemText), + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground), contentDescription = "Send Message", modifier = Modifier.padding(end = 24.dp).clickable { val aor = viewModel.selectedAor.value @@ -245,7 +247,7 @@ private fun Uris( ) Image( painter = painterResource(R.drawable.call_small), - colorFilter = ColorFilter.tint(LocalCustomColors.current.itemText), + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground), contentDescription = "Call", modifier = Modifier.clickable { val aor = viewModel.selectedAor.value diff --git a/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt b/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt index 635f28fa..238add63 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AppTheme.kt @@ -2,6 +2,7 @@ package com.tutpro.baresip import android.app.Activity import android.os.Build.VERSION +import android.util.Log import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.MaterialTheme import androidx.compose.material3.darkColorScheme @@ -9,7 +10,6 @@ import androidx.compose.material3.dynamicDarkColorScheme import androidx.compose.material3.dynamicLightColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.SideEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.remember @@ -28,6 +28,7 @@ fun AppTheme( val useDynamicColors by remember { BaresipService.dynamicColors } val useActualDynamicColors = useDynamicColors && VERSION.SDK_INT >= 31 + Log.d(TAG, "Use actual dynamic colors: $useActualDynamicColors") val colorScheme = when { @@ -37,51 +38,71 @@ fun AppTheme( else dynamicLightColorScheme(context) } - useDarkTheme || isSystemInDarkTheme() -> darkColorScheme() - else -> lightColorScheme() - } - - val basePalette = if (useDarkTheme) DarkCustomColors else LightCustomColors - - val customColorsPalette = basePalette.copy( - background = colorScheme.background, - onBackground = if (useActualDynamicColors) - colorScheme.onBackground - else - basePalette.onBackground, - cardBackground = colorScheme.surfaceVariant, - textFieldBackground = colorScheme.surfaceVariant, - primary = if (useActualDynamicColors) - colorScheme.primary - else - basePalette.primary, - onPrimary = if (useActualDynamicColors) - colorScheme.onPrimary - else - basePalette.onPrimary + useDarkTheme || isSystemInDarkTheme() -> darkColorScheme( + primary = dark_primary, + onPrimary = dark_on_primary, + primaryContainer = dark_primary_container, + onPrimaryContainer = dark_on_primary_container, + secondary = dark_secondary, + onSecondary = dark_on_secondary, + secondaryContainer = dark_secondary_container, + onSecondaryContainer = dark_on_secondary_container, + tertiary = dark_tertiary, + onTertiary = dark_on_tertiary, + tertiaryContainer = dark_tertiary_container, + onTertiaryContainer = dark_on_tertiary_container, + error = dark_error, + onError = dark_on_error, + errorContainer = dark_error_container, + onErrorContainer = dark_on_error_container, + background = dark_background, + onBackground = dark_on_background, + surface = dark_surface, + onSurface = dark_on_surface, + surfaceVariant = dark_surfaceVariant, + onSurfaceVariant = dark_on_surfaceVariant, + outline = dark_outline ) + else -> lightColorScheme( + primary = light_primary, + onPrimary = light_on_primary, + primaryContainer = light_primary_container, + onPrimaryContainer = light_on_primary_container, + secondary = light_secondary, + onSecondary = light_on_secondary, + secondaryContainer = light_secondary_container, + onSecondaryContainer = light_on_secondary_container, + tertiary = light_tertiary, + onTertiary = light_on_tertiary, + tertiaryContainer = light_tertiary_container, + onTertiaryContainer = light_on_tertiary_container, + error = light_error, + onError = light_on_error, + errorContainer = light_error_container, + onErrorContainer = light_on_error_container, + background = light_background, + onBackground = light_on_background, + surface = light_surface, + onSurface = light_on_surface, + surfaceVariant = light_surfaceVariant, + onSurfaceVariant = light_on_surfaceVariant, + outline = light_outline + ) + } val view = LocalView.current if (!view.isInEditMode) { SideEffect { val window = (view.context as Activity).window val insetsController = WindowCompat.getInsetsController(window, view) - - // A common threshold for luminance is 0.5. Colors with luminance > 0.5 are considered light. - val isBackgroundEffectivelyLight = ColorUtils.calculateLuminance(customColorsPalette.background.toArgb()) > 0.5 - + val isBackgroundEffectivelyLight = ColorUtils.calculateLuminance(colorScheme.background.toArgb()) > 0.5 insetsController.isAppearanceLightStatusBars = isBackgroundEffectivelyLight insetsController.isAppearanceLightNavigationBars = isBackgroundEffectivelyLight } } - CompositionLocalProvider( - LocalCustomColors provides customColorsPalette - ) { - MaterialTheme( - colorScheme = colorScheme, // MaterialTheme still uses the "normal" colorScheme - content = content - ) - } - + MaterialTheme( + colorScheme = colorScheme, + content = content + ) } diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipContactScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipContactScreen.kt index 5fe4b231..f0ee3cee 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipContactScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipContactScreen.kt @@ -42,6 +42,7 @@ import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Scaffold import androidx.compose.material3.Switch @@ -196,12 +197,12 @@ private fun ContactScreen( modifier = Modifier .fillMaxSize() .imePadding(), - containerColor = LocalCustomColors.current.background, + containerColor = MaterialTheme.colorScheme.background, topBar = { Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()) ) { TopAppBar(title, onBack = onBack, onCheck = onCheck) @@ -235,10 +236,10 @@ private fun TopAppBar(title: String, onBack: () -> Unit, onCheck: () -> Unit) { ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, - actionIconContentColor = LocalCustomColors.current.onPrimary + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, + actionIconContentColor = MaterialTheme.colorScheme.onPrimary ), windowInsets = WindowInsets(0, 0, 0, 0), navigationIcon = { @@ -285,7 +286,7 @@ private fun ContactContent( Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding(contentPadding) .padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 52.dp), verticalArrangement = Arrangement.spacedBy(12.dp), @@ -438,7 +439,7 @@ private fun Avatar( @Composable private fun ContactName(name: String, new: Boolean, onNameChange: (String) -> Unit) { - val focusRequester = FocusRequester() + val focusRequester = remember { FocusRequester() } OutlinedTextField( value = name, placeholder = { Text(stringResource(R.string.contact_name)) }, @@ -447,7 +448,7 @@ private fun ContactName(name: String, new: Boolean, onNameChange: (String) -> Un .fillMaxWidth() .focusRequester(focusRequester), textStyle = androidx.compose.ui.text.TextStyle( - fontSize = 18.sp, color = LocalCustomColors.current.itemText + fontSize = 18.sp, color = MaterialTheme.colorScheme.onBackground ), label = { Text(stringResource(R.string.contact_name)) }, keyboardOptions = KeyboardOptions( @@ -469,7 +470,7 @@ private fun ContactUri(uri: String, onUriChange: (String) -> Unit) { onValueChange = onUriChange, modifier = Modifier.fillMaxWidth(), textStyle = androidx.compose.ui.text.TextStyle( - fontSize = 18.sp, color = LocalCustomColors.current.itemText + fontSize = 18.sp, color = MaterialTheme.colorScheme.onBackground ), label = { Text(stringResource(R.string.sip_or_tel_uri)) }, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text) @@ -492,7 +493,7 @@ private fun Favorite(ctx: Context, favorite: Boolean, onFavoriteChange: (Boolean alertMessage.value = ctx.getString(R.string.favorite_help) showAlert.value = true }, - color = LocalCustomColors.current.itemText, + color = MaterialTheme.colorScheme.onBackground, ) Switch( checked = favorite, @@ -511,7 +512,7 @@ private fun Android(android: Boolean, onAndroidChange: (Boolean) -> Unit) { Text( text = stringResource(R.string.android), modifier = Modifier.weight(1f), - color = LocalCustomColors.current.itemText + color = MaterialTheme.colorScheme.onBackground ) Switch( checked = android, diff --git a/app/src/main/kotlin/com/tutpro/baresip/CallDetailsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/CallDetailsScreen.kt index 5e90e79b..23f72a3d 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CallDetailsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CallDetailsScreen.kt @@ -29,6 +29,7 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar @@ -86,9 +87,9 @@ private fun CallDetailsScreen(navController: NavController, callRow: CallRow) { ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, ), windowInsets = WindowInsets(0, 0, 0, 0), navigationIcon = { @@ -164,8 +165,7 @@ private fun Details(ctx: Context, details: ArrayList
) { modifier = Modifier.fillMaxWidth() .verticalScrollbar( state = lazyListState, - width = 4.dp, - color = LocalCustomColors.current.gray + width = 4.dp ) .background(LocalCustomColors.current.background), state = lazyListState, diff --git a/app/src/main/kotlin/com/tutpro/baresip/CallsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/CallsScreen.kt index 60c3fbda..2851bff5 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CallsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CallsScreen.kt @@ -34,6 +34,7 @@ import androidx.compose.material.icons.filled.Menu import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar @@ -152,10 +153,10 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, - actionIconContentColor = LocalCustomColors.current.onPrimary + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, + actionIconContentColor = MaterialTheme.colorScheme.onPrimary ), windowInsets = WindowInsets(0, 0, 0, 0), navigationIcon = { @@ -275,9 +276,9 @@ private fun Calls( .verticalScrollbar( state = lazyListState, width = 4.dp, - color = LocalCustomColors.current.gray + color = MaterialTheme.colorScheme.outlineVariant ) - .background(LocalCustomColors.current.background), + .background(MaterialTheme.colorScheme.background), state = lazyListState, verticalArrangement = Arrangement.spacedBy(12.dp), ) { @@ -398,13 +399,13 @@ private fun Calls( count++ } if (count > 3) - Text("...", color = LocalCustomColors.current.itemText) + Text("...", color = MaterialTheme.colorScheme.onPrimaryContainer) Text(text = Utils.friendlyUri(ctx, peerUri, account), modifier = Modifier.padding(start = 8.dp), fontSize = 18.sp, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = LocalCustomColors.current.itemText + color = MaterialTheme.colorScheme.onPrimaryContainer ) } } @@ -415,9 +416,9 @@ private fun Calls( lineHeight = 16.sp, textAlign = TextAlign.End, color = if (recordings) - LocalCustomColors.current.accent + MaterialTheme.colorScheme.error else - LocalCustomColors.current.itemText, + MaterialTheme.colorScheme.onPrimaryContainer, modifier = Modifier .padding(end = 16.dp) .clickable(onClick = { diff --git a/app/src/main/kotlin/com/tutpro/baresip/ChatScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/ChatScreen.kt index 2939ef94..743c5f8c 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ChatScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ChatScreen.kt @@ -6,7 +6,6 @@ import android.text.format.DateUtils.isToday import android.widget.Toast import androidx.activity.compose.BackHandler import androidx.compose.foundation.ExperimentalFoundationApi -import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement @@ -20,6 +19,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.navigationBarsPadding +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBars @@ -34,14 +34,17 @@ import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material.icons.automirrored.filled.Send import androidx.compose.material.icons.outlined.Clear import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Scaffold +import androidx.compose.material3.SmallFloatingActionButton import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBarDefaults @@ -59,11 +62,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalSoftwareKeyboardController -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.vectorResource import androidx.compose.ui.text.TextStyle @@ -175,11 +176,11 @@ private fun ChatScreen( modifier = Modifier .fillMaxSize() .imePadding(), - containerColor = LocalCustomColors.current.background, + containerColor = MaterialTheme.colorScheme.background, topBar = { Column(modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()) ) { TopAppBar(ctx, navController, viewModel, account, peerUri) @@ -227,10 +228,10 @@ private fun TopAppBar( ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, - actionIconContentColor = LocalCustomColors.current.onPrimary + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, + actionIconContentColor = MaterialTheme.colorScheme.onPrimary ), navigationIcon = { IconButton(onClick = { backAction(navController, account, peerUri) }) { @@ -351,8 +352,9 @@ private fun Messages( .verticalScrollbar( state = lazyListState, width = 4.dp, - color = LocalCustomColors.current.gray - ), + color = MaterialTheme.colorScheme.outlineVariant + ) + .background(MaterialTheme.colorScheme.background), reverseLayout = true, state = lazyListState, verticalArrangement = Arrangement.spacedBy(16.dp), @@ -417,17 +419,10 @@ private fun Messages( RoundedCornerShape(20.dp, 10.dp, 50.dp, 20.dp), colors = ButtonDefaults.buttonColors( containerColor = - if (message.direction == MESSAGE_DOWN) { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.secondaryDark - else - LocalCustomColors.current.secondaryLight - } else { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.primaryDark - else - LocalCustomColors.current.primaryLight - } + if (message.direction == MESSAGE_DOWN) + MaterialTheme.colorScheme.secondaryContainer + else + MaterialTheme.colorScheme.primaryContainer ), modifier = Modifier .fillMaxWidth() @@ -438,19 +433,11 @@ private fun Messages( ) ) { Column { + val textColor = if (message.direction == MESSAGE_DOWN) + MaterialTheme.colorScheme.onSecondaryContainer + else + MaterialTheme.colorScheme.onPrimaryContainer Row { - val textColor = - if (message.direction == MESSAGE_DOWN) { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.secondaryLight - else - LocalCustomColors.current.secondaryDark - } else { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.primaryLight - else - LocalCustomColors.current.primaryDark - } Text(text = sender, fontSize = 12.sp, color = textColor) Spacer(modifier = Modifier.weight(1f)) Text(text = info, fontSize = 12.sp, color = textColor) @@ -459,7 +446,7 @@ private fun Messages( SelectionContainer { Text( text = message.message, - color = LocalCustomColors.current.itemText, + color = textColor, fontWeight = if (message.direction == MESSAGE_DOWN && message.new) FontWeight.Bold else FontWeight.Normal ) @@ -549,59 +536,68 @@ private fun NewMessage( if (newMessage.value.text.isNotEmpty()) focusRequester.requestFocus() } - Image( - painter = painterResource(id = R.drawable.send), - contentDescription = "Send", - contentScale = ContentScale.Crop, - modifier = Modifier - .size(36.dp) - .clickable { - val msgText = newMessage.value.text - if (msgText.isNotEmpty()) { - keyboardController?.hide() - val time = System.currentTimeMillis() - val msg = Message( - aor, - peerUri, - msgText, - time, - MESSAGE_UP_WAIT, - 0, - "", - true - ) - msg.add() - var msgUri = "" - addMessage(msg) - if (Utils.isTelUri(peerUri)) - if (ua.account.telProvider == "") { - dialogMessage.value = String.format( - ctx.getString(R.string.no_telephony_provider), - Utils.plainAor(aor) - ) - showDialog.value = true - } else { - msgUri = Utils.telToSip(peerUri, ua.account) - } - else - msgUri = peerUri - if (msgUri != "") - if (Api.message_send(ua.uap, msgUri, msgText, time.toString()) != 0 - ) { - Toast.makeText( - ctx, "${ctx.getString(R.string.message_failed)}!", - Toast.LENGTH_SHORT - ).show() - msg.direction = MESSAGE_UP_FAIL - msg.responseReason = ctx.getString(R.string.message_failed) - } else { - newMessage.value = TextFieldValue("") - viewModel.updateAorPeerMessage(aor, peerUri, "") - keyboardController?.hide() - } - } + SmallFloatingActionButton( + modifier = Modifier.offset(y = 2.dp), + onClick = { + val msgText = newMessage.value.text + if (msgText.isNotEmpty()) { + keyboardController?.hide() + val time = System.currentTimeMillis() + val msg = Message( + aor, + peerUri, + msgText, + time, + MESSAGE_UP_WAIT, + 0, + "", + true + ) + msg.add() + var msgUri = "" + addMessage(msg) + if (Utils.isTelUri(peerUri)) + if (ua.account.telProvider == "") { + dialogMessage.value = String.format( + ctx.getString(R.string.no_telephony_provider), + Utils.plainAor(aor) + ) + showDialog.value = true + } + else { + msgUri = Utils.telToSip(peerUri, ua.account) + } + else + msgUri = peerUri + if (msgUri != "") + if (Api.message_send(ua.uap, + msgUri, + msgText, + time.toString() + ) != 0) { + Toast.makeText( + ctx, "${ctx.getString(R.string.message_failed)}!", + Toast.LENGTH_SHORT + ).show() + msg.direction = MESSAGE_UP_FAIL + msg.responseReason = ctx.getString(R.string.message_failed) + } + else { + newMessage.value = TextFieldValue("") + viewModel.updateAorPeerMessage(aor, peerUri, "") + keyboardController?.hide() + } } - ) + }, + containerColor = MaterialTheme.colorScheme.secondaryContainer, + contentColor = MaterialTheme.colorScheme.onSecondaryContainer + ) { + Icon( + imageVector = Icons.AutoMirrored.Filled.Send, + modifier = Modifier.size(28.dp), + contentDescription = stringResource(R.string.add) + ) + } } } diff --git a/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt index 41d49fa5..1ba8f4ff 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ChatsScreen.kt @@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.navigationBarsPadding +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBars @@ -41,6 +42,7 @@ import androidx.compose.material.icons.outlined.Clear import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Scaffold import androidx.compose.material3.SmallFloatingActionButton @@ -132,12 +134,12 @@ private fun ChatsScreen(navController: NavController, aor: String) { modifier = Modifier .fillMaxSize() .imePadding(), - containerColor = LocalCustomColors.current.background, + containerColor = MaterialTheme.colorScheme.background, topBar = { Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()) ) { TopAppBar(navController, account, uaMessages) @@ -181,10 +183,10 @@ private fun TopAppBar( ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, - actionIconContentColor = LocalCustomColors.current.onPrimary + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, + actionIconContentColor = MaterialTheme.colorScheme.onPrimary ), navigationIcon = { IconButton(onClick = { navController.popBackStack() }) { @@ -297,9 +299,9 @@ private fun Chats( .verticalScrollbar( state = lazyListState, width = 4.dp, - color = LocalCustomColors.current.gray + color = MaterialTheme.colorScheme.outlineVariant ) - .background(LocalCustomColors.current.background), + .background(MaterialTheme.colorScheme.background), reverseLayout = true, state = lazyListState, verticalArrangement = Arrangement.spacedBy(16.dp), @@ -380,24 +382,13 @@ private fun Chats( } showDialog.value = true }, - modifier = Modifier - .fillMaxWidth() - .wrapContentHeight() - .padding(end = 6.dp), + modifier = Modifier.fillMaxWidth().wrapContentHeight().padding(end = 6.dp), shape = buttonShape, border = borderStroke, - color = - if (message.direction == MESSAGE_DOWN) { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.secondaryDark - else - LocalCustomColors.current.secondaryLight - } else { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.primaryDark - else - LocalCustomColors.current.primaryLight - }, + color = if (message.direction == MESSAGE_DOWN) + MaterialTheme.colorScheme.secondaryContainer + else + MaterialTheme.colorScheme.primaryContainer ) { val peer = Utils.friendlyUri(ctx, message.peerUri, account) val cal = GregorianCalendar() @@ -408,19 +399,11 @@ private fun Chats( DateFormat.getDateInstance(DateFormat.SHORT) val info = fmt.format(cal.time) Column { + val textColor = if (message.direction == MESSAGE_DOWN) + MaterialTheme.colorScheme.onSecondaryContainer + else + MaterialTheme.colorScheme.onPrimaryContainer Row { - val textColor = - if (message.direction == MESSAGE_DOWN) { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.secondaryLight - else - LocalCustomColors.current.secondaryDark - } else { - if (BaresipService.darkTheme.value) - LocalCustomColors.current.primaryLight - else - LocalCustomColors.current.primaryDark - } Text(text = peer, color = textColor, fontSize = 12.sp) Spacer(modifier = Modifier.weight(1f)) Text(text = info, color = textColor, fontSize = 12.sp) @@ -431,7 +414,7 @@ private fun Chats( maxLines = 1, overflow = TextOverflow.Ellipsis, style = TextStyle( - color = LocalCustomColors.current.itemText, + color = textColor, fontWeight = if (message.direction == MESSAGE_DOWN && message.new) FontWeight.Bold else FontWeight.Normal, fontSize = 16.sp @@ -537,8 +520,7 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc .fillMaxWidth() .heightIn(max = 180.dp) .verticalScrollbar( - state = lazyListState, - color = LocalCustomColors.current.gray + state = lazyListState ), horizontalAlignment = Alignment.Start, state = lazyListState @@ -619,7 +601,7 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc } Spacer(Modifier.width(4.dp)) SmallFloatingActionButton( - modifier = Modifier.padding(end = 4.dp), + modifier = Modifier.padding(end = 4.dp).offset(y = 2.dp), onClick = { showSuggestions = false val peerText = newPeer.trim() @@ -640,8 +622,8 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc newPeer = "" focusManager.clearFocus() }, - containerColor = LocalCustomColors.current.accent, - contentColor = LocalCustomColors.current.background + containerColor = MaterialTheme.colorScheme.secondaryContainer, + contentColor = MaterialTheme.colorScheme.onSecondaryContainer ) { Icon( imageVector = Icons.Filled.Add, diff --git a/app/src/main/kotlin/com/tutpro/baresip/CodecsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/CodecsScreen.kt index 4f0d11cd..24b95930 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CodecsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CodecsScreen.kt @@ -234,8 +234,7 @@ private fun Codecs(codecs: SnapshotStateList, onUpdateCodecs: (List swipeThreshold) { + } + else if (offset > swipeThreshold) { if (uas.value.isNotEmpty()) { val curPos = UserAgent.findAorIndex(viewModel.selectedAor.value) val newPos = when (curPos) { @@ -1013,7 +1020,8 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na if (Api.account_regint(acc.accp) > 0) { Api.account_set_regint(acc.accp, 0) Api.ua_unregister(ua.uap) - } else { + } + else { Api.account_set_regint( acc.accp, acc.configuredRegInt @@ -1027,8 +1035,8 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na ) }, colors = ButtonColors( - containerColor = LocalCustomColors.current.grayLight, - contentColor = LocalCustomColors.current.dark, + containerColor = MaterialTheme.colorScheme.surfaceVariant, + contentColor = MaterialTheme.colorScheme.onSurfaceVariant, disabledContainerColor = LocalCustomColors.current.grayLight, disabledContentColor = LocalCustomColors.current.dark ), @@ -1064,7 +1072,8 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na if (Api.account_regint(acc.accp) > 0) { Api.account_set_regint(acc.accp, 0) Api.ua_unregister(ua.uap) - } else { + } + else { Api.account_set_regint( acc.accp, acc.configuredRegInt @@ -1087,8 +1096,9 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na androidx.compose.material3.DropdownMenu( expanded = expanded, onDismissRequest = { expanded = false }, + containerColor = MaterialTheme.colorScheme.surfaceContainer, ) { - uas.value.forEachIndexed { _, ua -> + uas.value.forEachIndexed { index, ua -> val acc = ua.account DropdownMenuItem( onClick = { @@ -1110,6 +1120,9 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na ) } ) + if (index < uas.value.size - 1) { + HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant) + } } } } @@ -1204,8 +1217,7 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) { modifier = Modifier .fillMaxWidth() .verticalScrollbar( - state = lazyListState, - color = LocalCustomColors.current.gray + state = lazyListState ), horizontalAlignment = Alignment.Start, state = lazyListState @@ -1494,7 +1506,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) { Text( text = stringResource(R.string.call_transfer), fontSize = 20.sp, - color = LocalCustomColors.current.alert, + color = MaterialTheme.colorScheme.error, ) var transferUri by remember { mutableStateOf("") } val suggestions by remember { contactNames } @@ -1569,8 +1581,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) { modifier = Modifier .fillMaxWidth() .verticalScrollbar( - state = lazyListState, - color = LocalCustomColors.current.gray + state = lazyListState ), horizontalAlignment = Alignment.Start, state = lazyListState, @@ -1696,7 +1707,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) { else R.string.call ).uppercase(), - color = LocalCustomColors.current.primary + color = MaterialTheme.colorScheme.primary ) } } @@ -1819,7 +1830,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) { private fun OnHoldNotice() { OutlinedButton( onClick = {}, - border = BorderStroke(1.dp, LocalCustomColors.current.accent), + border = BorderStroke(1.dp, MaterialTheme.colorScheme.error), modifier = Modifier.padding(16.dp), shape = RoundedCornerShape(20) ) { diff --git a/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt index c8c12220..e1a48854 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt @@ -35,6 +35,8 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.statusBars +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll @@ -47,6 +49,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Scaffold import androidx.compose.material3.Switch @@ -148,13 +151,15 @@ private fun SettingsScreen( } Scaffold( - modifier = Modifier.fillMaxSize().imePadding(), - containerColor = LocalCustomColors.current.background, + modifier = Modifier + .fillMaxSize() + .imePadding(), + containerColor = MaterialTheme.colorScheme.background, topBar = { Column( modifier = Modifier .fillMaxWidth() - .background(LocalCustomColors.current.background) + .background(MaterialTheme.colorScheme.background) .padding( top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding() ) @@ -167,10 +172,10 @@ private fun SettingsScreen( ) }, colors = TopAppBarDefaults.topAppBarColors( - containerColor = LocalCustomColors.current.primary, - navigationIconContentColor = LocalCustomColors.current.onPrimary, - titleContentColor = LocalCustomColors.current.onPrimary, - actionIconContentColor = LocalCustomColors.current.onPrimary + containerColor = MaterialTheme.colorScheme.primary, + navigationIconContentColor = MaterialTheme.colorScheme.onPrimary, + titleContentColor = MaterialTheme.colorScheme.onPrimary, + actionIconContentColor = MaterialTheme.colorScheme.onPrimary ), navigationIcon = { IconButton(onClick = onBack) { @@ -1247,39 +1252,45 @@ private fun SettingsContent( save = true } - val scrollState = rememberScrollState() + val lazyListState = rememberLazyListState() - Column( + LazyColumn( + state = lazyListState, modifier = Modifier .fillMaxWidth() .padding(contentPadding) .padding(start = 16.dp, end = 4.dp, top = 16.dp, bottom = 8.dp) - .verticalScrollbar(scrollState) - .verticalScroll(state = scrollState), + .verticalScrollbar( + state = lazyListState, + width = 4.dp, + color = MaterialTheme.colorScheme.outlineVariant + ), verticalArrangement = Arrangement.spacedBy(8.dp), ) { - StartAutomatically() - ListenAddress() - AddressFamily() - DnsServers() - TlsCertificateFile(activity) - VerifyServer() - CaFile(activity) - UserAgent() - AudioSettings(navController) - Contacts(activity) - Ringtone(ctx) - BatteryOptimizations() - DarkTheme() - if (VERSION.SDK_INT >= 31) - DynamicColors() - ColorBlind() - ProximitySensing() - if (VERSION.SDK_INT >= 29) - DefaultDialer() - Debug() - SipTrace() - Reset(onRestartApp) + item { StartAutomatically() } + item { ListenAddress() } + item { AddressFamily() } + item { DnsServers() } + item { TlsCertificateFile(activity) } + item { VerifyServer() } + item { CaFile(activity) } + item { UserAgent() } + item { AudioSettings(navController) } + item { Contacts(activity) } + item { Ringtone(ctx) } + item { BatteryOptimizations() } + item { DarkTheme() } + if (VERSION.SDK_INT >= 31) { + item { DynamicColors() } + } + item { ColorBlind() } + item { ProximitySensing() } + if (VERSION.SDK_INT >= 29) { + item { DefaultDialer() } + } + item { Debug() } + item { SipTrace() } + item { Reset(onRestartApp) } } } diff --git a/app/src/main/res/drawable/plus.xml b/app/src/main/res/drawable/plus.xml deleted file mode 100644 index 46e3f8a2..00000000 --- a/app/src/main/res/drawable/plus.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/send.xml b/app/src/main/res/drawable/send.xml deleted file mode 100644 index 61ea51c2..00000000 --- a/app/src/main/res/drawable/send.xml +++ /dev/null @@ -1,5 +0,0 @@ - - -