More work on Material3 colors migration
This commit is contained in:
@@ -28,6 +28,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
|
|||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Switch
|
import androidx.compose.material3.Switch
|
||||||
@@ -65,7 +66,6 @@ import androidx.navigation.NavType
|
|||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.navArgument
|
import androidx.navigation.navArgument
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -141,12 +141,12 @@ private fun AccountScreen(
|
|||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.fillMaxSize().imePadding(),
|
modifier = Modifier.fillMaxSize().imePadding(),
|
||||||
containerColor = LocalCustomColors.current.background,
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
topBar = {
|
topBar = {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(LocalCustomColors.current.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(
|
.padding(
|
||||||
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
||||||
)
|
)
|
||||||
@@ -159,10 +159,10 @@ private fun AccountScreen(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
colors = TopAppBarDefaults.topAppBarColors(
|
colors = TopAppBarDefaults.topAppBarColors(
|
||||||
containerColor = LocalCustomColors.current.primary,
|
containerColor = MaterialTheme.colorScheme.primary,
|
||||||
navigationIconContentColor = LocalCustomColors.current.onPrimary,
|
navigationIconContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
titleContentColor = LocalCustomColors.current.onPrimary,
|
titleContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
actionIconContentColor = LocalCustomColors.current.onPrimary
|
actionIconContentColor = MaterialTheme.colorScheme.onPrimary
|
||||||
),
|
),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
IconButton(onClick = onBack) {
|
IconButton(onClick = onBack) {
|
||||||
@@ -234,13 +234,9 @@ private fun AccountContent(
|
|||||||
enabled = false,
|
enabled = false,
|
||||||
onValueChange = {},
|
onValueChange = {},
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
),
|
|
||||||
label = {
|
label = {
|
||||||
LabelText(text = stringResource(R.string.sip_uri),
|
Text(text = stringResource(R.string.sip_uri), fontWeight = FontWeight.Bold)
|
||||||
fontWeight = FontWeight.Bold)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -266,9 +262,8 @@ private fun AccountContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.nickname)) },
|
||||||
label = { LabelText(stringResource(R.string.nickname)) },
|
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
capitalization = KeyboardCapitalization.Words,
|
capitalization = KeyboardCapitalization.Words,
|
||||||
keyboardType = KeyboardType.Text),
|
keyboardType = KeyboardType.Text),
|
||||||
@@ -297,12 +292,12 @@ private fun AccountContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.display_name)) },
|
||||||
label = { LabelText(stringResource(R.string.display_name)) },
|
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
capitalization = KeyboardCapitalization.Sentences,
|
capitalization = KeyboardCapitalization.Sentences,
|
||||||
keyboardType = KeyboardType.Text),
|
keyboardType = KeyboardType.Text
|
||||||
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -327,9 +322,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.authentication_username_help)
|
alertMessage.value = ctx.getString(R.string.authentication_username_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.authentication_username)) },
|
||||||
label = { LabelText(stringResource(R.string.authentication_username)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -364,7 +358,7 @@ private fun AccountContent(
|
|||||||
else
|
else
|
||||||
ImageVector.vectorResource(R.drawable.visibility_off),
|
ImageVector.vectorResource(R.drawable.visibility_off),
|
||||||
contentDescription = "Visibility",
|
contentDescription = "Visibility",
|
||||||
tint = LocalCustomColors.current.itemText
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -375,9 +369,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.authentication_password_help)
|
alertMessage.value = ctx.getString(R.string.authentication_password_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.authentication_password)) },
|
||||||
label = { LabelText(stringResource(R.string.authentication_password)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -411,7 +404,6 @@ private fun AccountContent(
|
|||||||
fun Outbound() {
|
fun Outbound() {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.outbound_proxies),
|
Text(text = stringResource(R.string.outbound_proxies),
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 8.dp)
|
.padding(top = 8.dp)
|
||||||
@@ -433,9 +425,8 @@ private fun AccountContent(
|
|||||||
onValueChange = { viewModel.outbound1.value = it },
|
onValueChange = { viewModel.outbound1.value = it },
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.sip_uri_of_proxy_server)) },
|
||||||
label = { LabelText(stringResource(R.string.sip_uri_of_proxy_server)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -451,9 +442,8 @@ private fun AccountContent(
|
|||||||
onValueChange = { viewModel.outbound2.value = it },
|
onValueChange = { viewModel.outbound2.value = it },
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.sip_uri_of_another_proxy_server)) },
|
||||||
label = { LabelText(stringResource(R.string.sip_uri_of_another_proxy_server)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -476,7 +466,7 @@ private fun AccountContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
color = LocalCustomColors.current.itemText)
|
)
|
||||||
val register by viewModel.register.collectAsState()
|
val register by viewModel.register.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = register,
|
checked = register,
|
||||||
@@ -506,10 +496,8 @@ private fun AccountContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp,
|
label = { Text(stringResource(R.string.reg_int)) },
|
||||||
color = LocalCustomColors.current.itemText),
|
|
||||||
label = { LabelText(stringResource(R.string.reg_int)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -532,7 +520,6 @@ private fun AccountContent(
|
|||||||
val route = "codecs/$aor/audio"
|
val route = "codecs/$aor/audio"
|
||||||
navController.navigate(route)
|
navController.navigate(route)
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
@@ -555,8 +542,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.media_encryption_help)
|
alertMessage.value = ctx.getString(R.string.media_encryption_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val isDropDownExpanded = remember { mutableStateOf(false) }
|
val isDropDownExpanded = remember { mutableStateOf(false) }
|
||||||
val mediaEnc by viewModel.mediaEnc.collectAsState()
|
val mediaEnc by viewModel.mediaEnc.collectAsState()
|
||||||
Box {
|
Box {
|
||||||
@@ -567,10 +554,8 @@ private fun AccountContent(
|
|||||||
isDropDownExpanded.value = true
|
isDropDownExpanded.value = true
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = mediaEncMap[mediaEnc]!!,
|
Text(text = mediaEncMap[mediaEnc]!!)
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
@@ -579,19 +564,14 @@ private fun AccountContent(
|
|||||||
}) {
|
}) {
|
||||||
var index = 0
|
var index = 0
|
||||||
mediaEncMap.forEach {
|
mediaEncMap.forEach {
|
||||||
DropdownMenuItem(text = {
|
DropdownMenuItem(text = { Text(text = it.value) },
|
||||||
Text(text = it.value,
|
|
||||||
color = LocalCustomColors.current.itemText)
|
|
||||||
},
|
|
||||||
onClick = {
|
onClick = {
|
||||||
isDropDownExpanded.value = false
|
isDropDownExpanded.value = false
|
||||||
viewModel.mediaEnc.value = it.key
|
viewModel.mediaEnc.value = it.key
|
||||||
})
|
}
|
||||||
|
)
|
||||||
if (index < 4)
|
if (index < 4)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -615,8 +595,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.media_nat_help)
|
alertMessage.value = ctx.getString(R.string.media_nat_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val isDropDownExpanded = remember { mutableStateOf(false) }
|
val isDropDownExpanded = remember { mutableStateOf(false) }
|
||||||
val mediaNat by viewModel.mediaNat.collectAsState()
|
val mediaNat by viewModel.mediaNat.collectAsState()
|
||||||
Box {
|
Box {
|
||||||
@@ -627,30 +607,25 @@ private fun AccountContent(
|
|||||||
isDropDownExpanded.value = true
|
isDropDownExpanded.value = true
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = mediaNatMap[mediaNat]!!,
|
Text(text = mediaNatMap[mediaNat]!!)
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
isDropDownExpanded.value = false
|
isDropDownExpanded.value = false
|
||||||
}) {
|
}
|
||||||
|
) {
|
||||||
var index = 0
|
var index = 0
|
||||||
mediaNatMap.forEach {
|
mediaNatMap.forEach {
|
||||||
DropdownMenuItem(text = {
|
DropdownMenuItem(text = { Text(text = it.value) },
|
||||||
Text(text = it.value)
|
|
||||||
},
|
|
||||||
onClick = {
|
onClick = {
|
||||||
isDropDownExpanded.value = false
|
isDropDownExpanded.value = false
|
||||||
viewModel.mediaNat.value = it.key
|
viewModel.mediaNat.value = it.key
|
||||||
})
|
}
|
||||||
|
)
|
||||||
if (index < 3)
|
if (index < 3)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -677,9 +652,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.stun_server_help)
|
alertMessage.value = ctx.getString(R.string.stun_server_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.stun_server)) },
|
||||||
label = { LabelText(stringResource(R.string.stun_server)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -704,9 +678,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.stun_username_help)
|
alertMessage.value = ctx.getString(R.string.stun_username_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.stun_username)) },
|
||||||
label = { LabelText(stringResource(R.string.stun_username)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -738,7 +711,7 @@ private fun AccountContent(
|
|||||||
else
|
else
|
||||||
ImageVector.vectorResource(R.drawable.visibility_off),
|
ImageVector.vectorResource(R.drawable.visibility_off),
|
||||||
contentDescription = "Visibility",
|
contentDescription = "Visibility",
|
||||||
tint = LocalCustomColors.current.itemText
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -749,9 +722,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.stun_password_help)
|
alertMessage.value = ctx.getString(R.string.stun_password_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.stun_password)) },
|
||||||
label = { LabelText(stringResource(R.string.stun_password)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -773,8 +745,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.rtcp_mux_help)
|
alertMessage.value = ctx.getString(R.string.rtcp_mux_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp
|
||||||
color = LocalCustomColors.current.itemText)
|
)
|
||||||
Switch(
|
Switch(
|
||||||
checked = rtcpMux,
|
checked = rtcpMux,
|
||||||
onCheckedChange = { viewModel.rtcpMux.value = it }
|
onCheckedChange = { viewModel.rtcpMux.value = it }
|
||||||
@@ -798,8 +770,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.rel_100_help)
|
alertMessage.value = ctx.getString(R.string.rel_100_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp
|
||||||
color = LocalCustomColors.current.itemText)
|
)
|
||||||
Switch(
|
Switch(
|
||||||
checked = rel100,
|
checked = rel100,
|
||||||
onCheckedChange = { viewModel.rel100.value = it }
|
onCheckedChange = { viewModel.rel100.value = it }
|
||||||
@@ -826,8 +798,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.dtmf_mode_help)
|
alertMessage.value = ctx.getString(R.string.dtmf_mode_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val isDropDownExpanded = remember { mutableStateOf(false) }
|
val isDropDownExpanded = remember { mutableStateOf(false) }
|
||||||
Box {
|
Box {
|
||||||
Row(
|
Row(
|
||||||
@@ -837,10 +809,8 @@ private fun AccountContent(
|
|||||||
isDropDownExpanded.value = true
|
isDropDownExpanded.value = true
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = dtmfModeMap[dtmfMode]!!,
|
Text(text = dtmfModeMap[dtmfMode]!!)
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
@@ -849,18 +819,14 @@ private fun AccountContent(
|
|||||||
}) {
|
}) {
|
||||||
var index = 0
|
var index = 0
|
||||||
dtmfModeMap.forEach {
|
dtmfModeMap.forEach {
|
||||||
DropdownMenuItem(text = {
|
DropdownMenuItem(text = { Text(text = it.value) },
|
||||||
Text(text = it.value)
|
|
||||||
},
|
|
||||||
onClick = {
|
onClick = {
|
||||||
isDropDownExpanded.value = false
|
isDropDownExpanded.value = false
|
||||||
viewModel.dtmfMode.value = it.key
|
viewModel.dtmfMode.value = it.key
|
||||||
})
|
}
|
||||||
|
)
|
||||||
if (index < 2)
|
if (index < 2)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -886,27 +852,22 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.answer_mode_help)
|
alertMessage.value = ctx.getString(R.string.answer_mode_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val isDropDownExpanded = remember { mutableStateOf(false) }
|
val isDropDownExpanded = remember { mutableStateOf(false) }
|
||||||
Box {
|
Box {
|
||||||
Row(
|
Row(
|
||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable { isDropDownExpanded.value = true }
|
||||||
isDropDownExpanded.value = true
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
Text(text = answerModeMap[answerMode]!!,
|
Text(text = answerModeMap[answerMode]!!)
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
onDismissRequest = {
|
onDismissRequest = { isDropDownExpanded.value = false }
|
||||||
isDropDownExpanded.value = false
|
) {
|
||||||
}) {
|
|
||||||
var index = 0
|
var index = 0
|
||||||
answerModeMap.forEach {
|
answerModeMap.forEach {
|
||||||
DropdownMenuItem(text = { Text(text = it.value) },
|
DropdownMenuItem(text = { Text(text = it.value) },
|
||||||
@@ -915,10 +876,7 @@ private fun AccountContent(
|
|||||||
viewModel.answerMode.value = it.key
|
viewModel.answerMode.value = it.key
|
||||||
})
|
})
|
||||||
if (index < 1)
|
if (index < 1)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -944,41 +902,33 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.redirect_mode_help)
|
alertMessage.value = ctx.getString(R.string.redirect_mode_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val isDropDownExpanded = remember { mutableStateOf(false) }
|
val isDropDownExpanded = remember { mutableStateOf(false) }
|
||||||
Box {
|
Box {
|
||||||
Row(
|
Row(
|
||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable { isDropDownExpanded.value = true }
|
||||||
isDropDownExpanded.value = true
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
Text(text = redirectModeMap[autoRedirect]!!,
|
Text(text = redirectModeMap[autoRedirect]!!)
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
onDismissRequest = {
|
onDismissRequest = { isDropDownExpanded.value = false }
|
||||||
isDropDownExpanded.value = false
|
) {
|
||||||
}) {
|
|
||||||
var index = 0
|
var index = 0
|
||||||
redirectModeMap.forEach {
|
redirectModeMap.forEach {
|
||||||
DropdownMenuItem(text = {
|
DropdownMenuItem(
|
||||||
Text(text = it.value)
|
text = { Text(text = it.value) },
|
||||||
},
|
|
||||||
onClick = {
|
onClick = {
|
||||||
isDropDownExpanded.value = false
|
isDropDownExpanded.value = false
|
||||||
viewModel.autoRedirect.value = it.key
|
viewModel.autoRedirect.value = it.key
|
||||||
})
|
}
|
||||||
|
)
|
||||||
if (index < 1)
|
if (index < 1)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1006,9 +956,8 @@ private fun AccountContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.voicemail_uri)) },
|
||||||
label = { LabelText(stringResource(R.string.voicemail_uri)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1034,9 +983,8 @@ private fun AccountContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.country_code)) },
|
||||||
label = { LabelText(stringResource(R.string.country_code)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1062,9 +1010,8 @@ private fun AccountContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.telephony_provider)) },
|
||||||
label = { LabelText(stringResource(R.string.telephony_provider)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1086,8 +1033,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.numeric_keypad_help)
|
alertMessage.value = ctx.getString(R.string.numeric_keypad_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp
|
||||||
color = LocalCustomColors.current.itemText)
|
)
|
||||||
Switch(
|
Switch(
|
||||||
checked = numericKeypad,
|
checked = numericKeypad,
|
||||||
onCheckedChange = { viewModel.numericKeypad.value = it }
|
onCheckedChange = { viewModel.numericKeypad.value = it }
|
||||||
@@ -1111,8 +1058,8 @@ private fun AccountContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.default_account_help)
|
alertMessage.value = ctx.getString(R.string.default_account_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp
|
||||||
color = LocalCustomColors.current.itemText)
|
)
|
||||||
Switch(
|
Switch(
|
||||||
checked = defaultAccount,
|
checked = defaultAccount,
|
||||||
onCheckedChange = { viewModel.defaultAccount.value = it }
|
onCheckedChange = { viewModel.defaultAccount.value = it }
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ import androidx.navigation.NavController
|
|||||||
import androidx.navigation.NavGraphBuilder
|
import androidx.navigation.NavGraphBuilder
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
|
|
||||||
fun NavGraphBuilder.accountsScreenRoute(navController: NavController) {
|
fun NavGraphBuilder.accountsScreenRoute(navController: NavController) {
|
||||||
@@ -283,11 +282,12 @@ fun NewAccount(navController: NavController) {
|
|||||||
Icon(
|
Icon(
|
||||||
Icons.Outlined.Clear,
|
Icons.Outlined.Clear,
|
||||||
contentDescription = "Clear",
|
contentDescription = "Clear",
|
||||||
modifier = Modifier.clickable { newAor = "" }
|
modifier = Modifier.clickable { newAor = "" },
|
||||||
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label = { LabelText(stringResource(R.string.new_account)) },
|
label = { Text(stringResource(R.string.new_account)) },
|
||||||
textStyle = TextStyle(fontSize = 18.sp),
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
keyboardType = KeyboardType.Text,
|
keyboardType = KeyboardType.Text,
|
||||||
@@ -303,8 +303,8 @@ fun NewAccount(navController: NavController) {
|
|||||||
focusManager.clearFocus()
|
focusManager.clearFocus()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
containerColor = MaterialTheme.colorScheme.secondaryContainer,
|
containerColor = MaterialTheme.colorScheme.secondary,
|
||||||
contentColor = MaterialTheme.colorScheme.onSecondaryContainer
|
contentColor = MaterialTheme.colorScheme.onSecondary
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Add,
|
imageVector = Icons.Filled.Add,
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ import androidx.navigation.NavType
|
|||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.navArgument
|
import androidx.navigation.navArgument
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
|
||||||
|
|
||||||
fun NavGraphBuilder.androidContactScreenRoute(navController: NavController, viewModel: ViewModel) {
|
fun NavGraphBuilder.androidContactScreenRoute(navController: NavController, viewModel: ViewModel) {
|
||||||
composable(
|
composable(
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
|
|||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Switch
|
import androidx.compose.material3.Switch
|
||||||
@@ -52,7 +53,6 @@ import androidx.navigation.NavController
|
|||||||
import androidx.navigation.NavGraphBuilder
|
import androidx.navigation.NavGraphBuilder
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
|
|
||||||
fun NavGraphBuilder.audioScreenRoute(
|
fun NavGraphBuilder.audioScreenRoute(
|
||||||
@@ -83,12 +83,12 @@ private fun AudioScreen(
|
|||||||
) {
|
) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.fillMaxSize().imePadding(),
|
modifier = Modifier.fillMaxSize().imePadding(),
|
||||||
containerColor = LocalCustomColors.current.background,
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
topBar = {
|
topBar = {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(LocalCustomColors.current.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(
|
.padding(
|
||||||
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
||||||
)
|
)
|
||||||
@@ -101,10 +101,10 @@ private fun AudioScreen(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
colors = TopAppBarDefaults.topAppBarColors(
|
colors = TopAppBarDefaults.topAppBarColors(
|
||||||
containerColor = LocalCustomColors.current.primary,
|
containerColor = MaterialTheme.colorScheme.primary,
|
||||||
navigationIconContentColor = LocalCustomColors.current.onPrimary,
|
navigationIconContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
titleContentColor = LocalCustomColors.current.onPrimary,
|
titleContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
actionIconContentColor = LocalCustomColors.current.onPrimary
|
actionIconContentColor = MaterialTheme.colorScheme.onPrimary
|
||||||
),
|
),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
IconButton(onClick = onBack) {
|
IconButton(onClick = onBack) {
|
||||||
@@ -200,14 +200,12 @@ private fun CallVolume() {
|
|||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.default_call_volume),
|
Text(text = stringResource(R.string.default_call_volume),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.default_call_volume)
|
alertTitle.value = ctx.getString(R.string.default_call_volume)
|
||||||
alertMessage.value = ctx.getString(R.string.default_call_volume_help)
|
alertMessage.value = ctx.getString(R.string.default_call_volume_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp)
|
fontSize = 18.sp)
|
||||||
val isDropDownExpanded = remember {
|
val isDropDownExpanded = remember {
|
||||||
mutableStateOf(false)
|
mutableStateOf(false)
|
||||||
@@ -225,10 +223,8 @@ private fun CallVolume() {
|
|||||||
isDropDownExpanded.value = true
|
isDropDownExpanded.value = true
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = volNames[itemPosition.intValue],
|
Text(text = volNames[itemPosition.intValue])
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
@@ -245,10 +241,7 @@ private fun CallVolume() {
|
|||||||
newCallVolume = volValues[index]
|
newCallVolume = volValues[index]
|
||||||
})
|
})
|
||||||
if (index < 10)
|
if (index < 10)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -280,10 +273,8 @@ private fun MicGain() {
|
|||||||
alertMessage.value = ctx.getString(R.string.microphone_gain_help)
|
alertMessage.value = ctx.getString(R.string.microphone_gain_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText
|
label = { Text(stringResource(R.string.microphone_gain)) },
|
||||||
),
|
|
||||||
label = { LabelText(stringResource(R.string.microphone_gain)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -298,14 +289,12 @@ private fun SpeakerPhone() {
|
|||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.speaker_phone),
|
Text(text = stringResource(R.string.speaker_phone),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.speaker_phone)
|
alertTitle.value = ctx.getString(R.string.speaker_phone)
|
||||||
alertMessage.value = ctx.getString(R.string.speaker_phone_help)
|
alertMessage.value = ctx.getString(R.string.speaker_phone_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp)
|
fontSize = 18.sp)
|
||||||
var speakerPhone by remember { mutableStateOf(BaresipService.speakerPhone) }
|
var speakerPhone by remember { mutableStateOf(BaresipService.speakerPhone) }
|
||||||
Switch(
|
Switch(
|
||||||
@@ -326,7 +315,6 @@ private fun AudioModules() {
|
|||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.audio_modules_title),
|
Text(text = stringResource(R.string.audio_modules_title),
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.audio_modules_title)
|
alertTitle.value = ctx.getString(R.string.audio_modules_title)
|
||||||
@@ -338,9 +326,7 @@ private fun AudioModules() {
|
|||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.padding(start = 18.dp, end = 10.dp)
|
modifier = Modifier.padding(start = 18.dp, end = 10.dp)
|
||||||
) {
|
) {
|
||||||
Text(text = String.format(ctx.getString(R.string.bullet_item), module),
|
Text(text = String.format(ctx.getString(R.string.bullet_item), module), fontSize = 18.sp)
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp)
|
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
var checked by remember { mutableStateOf(oldAudioModules.contains("${module}.so")) }
|
var checked by remember { mutableStateOf(oldAudioModules.contains("${module}.so")) }
|
||||||
Switch(
|
Switch(
|
||||||
@@ -379,9 +365,8 @@ private fun OpusBitRate() {
|
|||||||
alertMessage.value = ctx.getString(R.string.opus_bit_rate_help)
|
alertMessage.value = ctx.getString(R.string.opus_bit_rate_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.opus_bit_rate)) },
|
||||||
label = { LabelText(stringResource(R.string.opus_bit_rate)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -411,9 +396,8 @@ private fun OpusPacketLoss() {
|
|||||||
alertMessage.value = ctx.getString(R.string.opus_packet_loss_help)
|
alertMessage.value = ctx.getString(R.string.opus_packet_loss_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.opus_packet_loss)) },
|
||||||
label = { LabelText(stringResource(R.string.opus_packet_loss)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -443,9 +427,8 @@ private fun AudioDelay() {
|
|||||||
alertMessage.value = ctx.getString(R.string.audio_delay_help)
|
alertMessage.value = ctx.getString(R.string.audio_delay_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.audio_delay)) },
|
||||||
label = { LabelText(stringResource(R.string.audio_delay)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -460,14 +443,12 @@ private fun ToneCountry() {
|
|||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.tone_country),
|
Text(text = stringResource(R.string.tone_country),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.tone_country)
|
alertTitle.value = ctx.getString(R.string.tone_country)
|
||||||
alertMessage.value = ctx.getString(R.string.tone_country_help)
|
alertMessage.value = ctx.getString(R.string.tone_country_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp)
|
fontSize = 18.sp)
|
||||||
val isDropDownExpanded = remember {
|
val isDropDownExpanded = remember {
|
||||||
mutableStateOf(false)
|
mutableStateOf(false)
|
||||||
@@ -485,10 +466,8 @@ private fun ToneCountry() {
|
|||||||
isDropDownExpanded.value = true
|
isDropDownExpanded.value = true
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = countryNames[itemPosition.intValue],
|
Text(text = countryNames[itemPosition.intValue])
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
@@ -505,10 +484,7 @@ private fun ToneCountry() {
|
|||||||
newToneCountry = countryValues[index]
|
newToneCountry = countryValues[index]
|
||||||
})
|
})
|
||||||
if (index < 10)
|
if (index < 10)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -447,9 +447,7 @@ private fun ContactName(name: String, new: Boolean, onNameChange: (String) -> Un
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = MaterialTheme.colorScheme.onBackground
|
|
||||||
),
|
|
||||||
label = { Text(stringResource(R.string.contact_name)) },
|
label = { Text(stringResource(R.string.contact_name)) },
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
keyboardType = KeyboardType.Text,
|
keyboardType = KeyboardType.Text,
|
||||||
@@ -469,9 +467,7 @@ private fun ContactUri(uri: String, onUriChange: (String) -> Unit) {
|
|||||||
placeholder = { Text(stringResource(R.string.user_domain_or_number)) },
|
placeholder = { Text(stringResource(R.string.user_domain_or_number)) },
|
||||||
onValueChange = onUriChange,
|
onValueChange = onUriChange,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = MaterialTheme.colorScheme.onBackground
|
|
||||||
),
|
|
||||||
label = { Text(stringResource(R.string.sip_or_tel_uri)) },
|
label = { Text(stringResource(R.string.sip_or_tel_uri)) },
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
@@ -486,8 +482,7 @@ private fun Favorite(ctx: Context, favorite: Boolean, onFavoriteChange: (Boolean
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.favorite),
|
text = stringResource(R.string.favorite),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.favorite)
|
alertTitle.value = ctx.getString(R.string.favorite)
|
||||||
alertMessage.value = ctx.getString(R.string.favorite_help)
|
alertMessage.value = ctx.getString(R.string.favorite_help)
|
||||||
@@ -512,7 +507,7 @@ private fun Android(android: Boolean, onAndroidChange: (Boolean) -> Unit) {
|
|||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.android),
|
text = stringResource(R.string.android),
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
color = MaterialTheme.colorScheme.onBackground
|
//color = MaterialTheme.colorScheme.onBackground
|
||||||
)
|
)
|
||||||
Switch(
|
Switch(
|
||||||
checked = android,
|
checked = android,
|
||||||
|
|||||||
@@ -71,12 +71,12 @@ private fun CallDetailsScreen(navController: NavController, callRow: CallRow) {
|
|||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.fillMaxSize().imePadding(),
|
modifier = Modifier.fillMaxSize().imePadding(),
|
||||||
containerColor = LocalCustomColors.current.background,
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
topBar = {
|
topBar = {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(LocalCustomColors.current.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding())
|
.padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding())
|
||||||
) {
|
) {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
@@ -132,7 +132,6 @@ private fun Peer(ctx: Context, callRow: CallRow) {
|
|||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -141,21 +140,18 @@ private fun Peer(ctx: Context, callRow: CallRow) {
|
|||||||
private fun Details(ctx: Context, details: ArrayList<Details>) {
|
private fun Details(ctx: Context, details: ArrayList<Details>) {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Text(text = stringResource(R.string.direction),
|
Text(text = stringResource(R.string.direction),
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
modifier = Modifier.width(96.dp)
|
modifier = Modifier.width(96.dp)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(6.dp))
|
Spacer(modifier = Modifier.width(6.dp))
|
||||||
Text(text = stringResource(R.string.time),
|
Text(text = stringResource(R.string.time),
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.SemiBold
|
fontWeight = FontWeight.SemiBold
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Text(text = stringResource(R.string.calls_duration),
|
Text(text = stringResource(R.string.calls_duration),
|
||||||
modifier = Modifier.padding(end = 12.dp),
|
modifier = Modifier.padding(end = 12.dp),
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.SemiBold
|
fontWeight = FontWeight.SemiBold
|
||||||
)
|
)
|
||||||
@@ -167,7 +163,7 @@ private fun Details(ctx: Context, details: ArrayList<Details>) {
|
|||||||
state = lazyListState,
|
state = lazyListState,
|
||||||
width = 4.dp
|
width = 4.dp
|
||||||
)
|
)
|
||||||
.background(LocalCustomColors.current.background),
|
.background(MaterialTheme.colorScheme.background),
|
||||||
state = lazyListState,
|
state = lazyListState,
|
||||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
) {
|
) {
|
||||||
@@ -235,7 +231,7 @@ private fun startTime(detail: Details): String {
|
|||||||
durationText = DateUtils.formatElapsedTime(duration)
|
durationText = DateUtils.formatElapsedTime(duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text(text = startTimeText, color = LocalCustomColors.current.itemText)
|
Text(text = startTimeText)
|
||||||
return durationText
|
return durationText
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +252,7 @@ private fun Duration(ctx: Context, detail: Details, durationText: String) {
|
|||||||
if (recording[0] != "") {
|
if (recording[0] != "") {
|
||||||
Text(
|
Text(
|
||||||
text = durationText,
|
text = durationText,
|
||||||
color = LocalCustomColors.current.accent,
|
color = MaterialTheme.colorScheme.error,
|
||||||
modifier = Modifier.padding(end = 12.dp)
|
modifier = Modifier.padding(end = 12.dp)
|
||||||
.clickable(onClick = {
|
.clickable(onClick = {
|
||||||
if (!decPlayer.isPlaying && !encPlayer.isPlaying) {
|
if (!decPlayer.isPlaying && !encPlayer.isPlaying) {
|
||||||
@@ -334,9 +330,7 @@ private fun Duration(ctx: Context, detail: Details, durationText: String) {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Text(text = durationText,
|
Text(text = durationText, modifier = Modifier.padding(end = 12.dp))
|
||||||
modifier = Modifier.padding(end = 12.dp),
|
|
||||||
color = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class CallHistoryNew(val aor: String, val peerUri: String, val direction: String
|
|||||||
|
|
||||||
fun add() {
|
fun add() {
|
||||||
BaresipService.callHistory.add(this)
|
BaresipService.callHistory.add(this)
|
||||||
var aorSpecificHistory = BaresipService.callHistory.filter { it.aor == this.aor }
|
val aorSpecificHistory = BaresipService.callHistory.filter { it.aor == this.aor }
|
||||||
if (aorSpecificHistory.size > CALL_HISTORY_SIZE) {
|
if (aorSpecificHistory.size > CALL_HISTORY_SIZE) {
|
||||||
val oldestToRemove = aorSpecificHistory.first()
|
val oldestToRemove = aorSpecificHistory.first()
|
||||||
if (oldestToRemove.recording[0].isNotEmpty())
|
if (oldestToRemove.recording[0].isNotEmpty())
|
||||||
|
|||||||
@@ -98,12 +98,12 @@ private fun CallsScreen(navController: NavController, viewModel: ViewModel, aor:
|
|||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.fillMaxSize().imePadding(),
|
modifier = Modifier.fillMaxSize().imePadding(),
|
||||||
containerColor = LocalCustomColors.current.background,
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
topBar = {
|
topBar = {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(LocalCustomColors.current.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding())
|
.padding(top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding())
|
||||||
) {
|
) {
|
||||||
TopAppBar(navController, account, callHistory)
|
TopAppBar(navController, account, callHistory)
|
||||||
@@ -237,7 +237,6 @@ private fun Account(account: Account) {
|
|||||||
.padding(top = 8.dp),
|
.padding(top = 8.dp),
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -399,13 +398,12 @@ private fun Calls(
|
|||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
if (count > 3)
|
if (count > 3)
|
||||||
Text("...", color = MaterialTheme.colorScheme.onPrimaryContainer)
|
Text("...", color = MaterialTheme.colorScheme.onBackground)
|
||||||
Text(text = Utils.friendlyUri(ctx, peerUri, account),
|
Text(text = Utils.friendlyUri(ctx, peerUri, account),
|
||||||
modifier = Modifier.padding(start = 8.dp),
|
modifier = Modifier.padding(start = 8.dp),
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis
|
||||||
color = MaterialTheme.colorScheme.onPrimaryContainer
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -418,7 +416,7 @@ private fun Calls(
|
|||||||
color = if (recordings)
|
color = if (recordings)
|
||||||
MaterialTheme.colorScheme.error
|
MaterialTheme.colorScheme.error
|
||||||
else
|
else
|
||||||
MaterialTheme.colorScheme.onPrimaryContainer,
|
MaterialTheme.colorScheme.onBackground,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(end = 16.dp)
|
.padding(end = 16.dp)
|
||||||
.clickable(onClick = {
|
.clickable(onClick = {
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ import androidx.navigation.NavType
|
|||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.navArgument
|
import androidx.navigation.navArgument
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.lang.String.format
|
import java.lang.String.format
|
||||||
@@ -521,10 +520,12 @@ private fun NewMessage(
|
|||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable {
|
||||||
newMessage.value = TextFieldValue("")
|
newMessage.value = TextFieldValue("")
|
||||||
viewModel.updateAorPeerMessage(aor, peerUri, "")
|
viewModel.updateAorPeerMessage(aor, peerUri, "")
|
||||||
}
|
},
|
||||||
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
} },
|
}
|
||||||
label = { LabelText(stringResource(R.string.new_message)) },
|
},
|
||||||
|
label = { Text(stringResource(R.string.new_message)) },
|
||||||
textStyle = TextStyle(fontSize = 18.sp),
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
capitalization = KeyboardCapitalization.Sentences,
|
capitalization = KeyboardCapitalization.Sentences,
|
||||||
@@ -589,8 +590,8 @@ private fun NewMessage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
containerColor = MaterialTheme.colorScheme.secondaryContainer,
|
containerColor = MaterialTheme.colorScheme.secondary,
|
||||||
contentColor = MaterialTheme.colorScheme.onSecondaryContainer
|
contentColor = MaterialTheme.colorScheme.onSecondary
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.AutoMirrored.Filled.Send,
|
imageVector = Icons.AutoMirrored.Filled.Send,
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ import coil.compose.AsyncImage
|
|||||||
import com.tutpro.baresip.BaresipService.Companion.contactNames
|
import com.tutpro.baresip.BaresipService.Companion.contactNames
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.DropdownMenu
|
import com.tutpro.baresip.CustomElements.DropdownMenu
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
|
||||||
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
import java.text.DateFormat
|
import java.text.DateFormat
|
||||||
@@ -252,10 +251,7 @@ private fun ChatsContent(
|
|||||||
private fun Account(account: Account) {
|
private fun Account(account: Account) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.account) + " " + account.text(),
|
text = stringResource(R.string.account) + " " + account.text(),
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxWidth().padding(top = 8.dp, bottom = 8.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(top = 8.dp, bottom = 8.dp),
|
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
@@ -345,7 +341,7 @@ private fun Chats(
|
|||||||
RoundedCornerShape(20.dp, 10.dp, 50.dp, 20.dp)
|
RoundedCornerShape(20.dp, 10.dp, 50.dp, 20.dp)
|
||||||
}
|
}
|
||||||
val borderStroke = if (account.unreadMessages && Message.unreadMessagesFromPeer(aor, message.peerUri)) {
|
val borderStroke = if (account.unreadMessages && Message.unreadMessagesFromPeer(aor, message.peerUri)) {
|
||||||
BorderStroke(width = 2.dp, color = LocalCustomColors.current.alert)
|
BorderStroke(width = 2.dp, color = MaterialTheme.colorScheme.error)
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
@@ -506,21 +502,20 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.shadow(8.dp, RoundedCornerShape(8.dp))
|
.shadow(8.dp, RoundedCornerShape(8.dp))
|
||||||
.background(
|
.background(
|
||||||
LocalCustomColors.current.grayLight,
|
color = MaterialTheme.colorScheme.surfaceContainer,
|
||||||
shape = RoundedCornerShape(8.dp)
|
shape = RoundedCornerShape(8.dp)
|
||||||
)
|
)
|
||||||
.animateContentSize()
|
.animateContentSize()
|
||||||
) {
|
) {
|
||||||
Box(modifier = Modifier
|
Box(modifier = Modifier.fillMaxWidth().heightIn(max = 150.dp)
|
||||||
.fillMaxWidth()
|
|
||||||
.heightIn(max = 150.dp)
|
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.heightIn(max = 180.dp)
|
.heightIn(max = 180.dp)
|
||||||
.verticalScrollbar(
|
.verticalScrollbar(
|
||||||
state = lazyListState
|
state = lazyListState,
|
||||||
|
color = MaterialTheme.colorScheme.outlineVariant
|
||||||
),
|
),
|
||||||
horizontalAlignment = Alignment.Start,
|
horizontalAlignment = Alignment.Start,
|
||||||
state = lazyListState
|
state = lazyListState
|
||||||
@@ -541,7 +536,7 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc
|
|||||||
Text(
|
Text(
|
||||||
text = suggestion,
|
text = suggestion,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
color = LocalCustomColors.current.grayDark,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
fontSize = 18.sp
|
fontSize = 18.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -577,22 +572,17 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc
|
|||||||
Icon(
|
Icon(
|
||||||
Icons.Outlined.Clear,
|
Icons.Outlined.Clear,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier
|
modifier = Modifier.clickable {
|
||||||
.clickable {
|
if (showSuggestions)
|
||||||
if (showSuggestions)
|
showSuggestions = false
|
||||||
showSuggestions = false
|
else
|
||||||
else
|
newPeer = ""
|
||||||
newPeer = ""
|
},
|
||||||
}
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
label = {
|
label = { Text(stringResource(R.string.new_chat_peer)) },
|
||||||
LabelText(stringResource(R.string.new_chat_peer))
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
},
|
|
||||||
textStyle = TextStyle(
|
|
||||||
fontSize = 18.sp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
),
|
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
keyboardType = KeyboardType.Text,
|
keyboardType = KeyboardType.Text,
|
||||||
imeAction = ImeAction.Done
|
imeAction = ImeAction.Done
|
||||||
@@ -622,8 +612,8 @@ private fun NewChatPeer(ctx: Context, navController: NavController, account: Acc
|
|||||||
newPeer = ""
|
newPeer = ""
|
||||||
focusManager.clearFocus()
|
focusManager.clearFocus()
|
||||||
},
|
},
|
||||||
containerColor = MaterialTheme.colorScheme.secondaryContainer,
|
containerColor = MaterialTheme.colorScheme.secondary,
|
||||||
contentColor = MaterialTheme.colorScheme.onSecondaryContainer
|
contentColor = MaterialTheme.colorScheme.onSecondary
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Add,
|
imageVector = Icons.Filled.Add,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import androidx.compose.material3.Icon
|
|||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.ListItem
|
import androidx.compose.material3.ListItem
|
||||||
import androidx.compose.material3.ListItemDefaults
|
import androidx.compose.material3.ListItemDefaults
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TopAppBar
|
import androidx.compose.material3.TopAppBar
|
||||||
@@ -36,6 +37,7 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.compose.runtime.snapshots.SnapshotStateList
|
import androidx.compose.runtime.snapshots.SnapshotStateList
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.alpha
|
import androidx.compose.ui.draw.alpha
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.res.vectorResource
|
import androidx.compose.ui.res.vectorResource
|
||||||
@@ -101,12 +103,12 @@ private fun CodecsScreen(
|
|||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.fillMaxSize().imePadding(),
|
modifier = Modifier.fillMaxSize().imePadding(),
|
||||||
containerColor = LocalCustomColors.current.background,
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
topBar = {
|
topBar = {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(LocalCustomColors.current.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(
|
.padding(
|
||||||
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
||||||
)
|
)
|
||||||
@@ -122,10 +124,10 @@ private fun CodecsScreen(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
colors = TopAppBarDefaults.topAppBarColors(
|
colors = TopAppBarDefaults.topAppBarColors(
|
||||||
containerColor = LocalCustomColors.current.primary,
|
containerColor = MaterialTheme.colorScheme.primary,
|
||||||
navigationIconContentColor = LocalCustomColors.current.onPrimary,
|
navigationIconContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
titleContentColor = LocalCustomColors.current.onPrimary,
|
titleContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
actionIconContentColor = LocalCustomColors.current.onPrimary
|
actionIconContentColor = MaterialTheme.colorScheme.onPrimary
|
||||||
),
|
),
|
||||||
windowInsets = WindowInsets(0, 0, 0, 0),
|
windowInsets = WindowInsets(0, 0, 0, 0),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
@@ -207,7 +209,7 @@ private fun CodecsContent(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(LocalCustomColors.current.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(contentPadding)
|
.padding(contentPadding)
|
||||||
.padding(bottom = 16.dp),
|
.padding(bottom = 16.dp),
|
||||||
) {
|
) {
|
||||||
@@ -248,9 +250,9 @@ private fun Codecs(codecs: SnapshotStateList<Codec>, onUpdateCodecs: (List<Codec
|
|||||||
ListItem(
|
ListItem(
|
||||||
colors = ListItemDefaults.colors(
|
colors = ListItemDefaults.colors(
|
||||||
containerColor = if (isDragging)
|
containerColor = if (isDragging)
|
||||||
LocalCustomColors.current.grayLight
|
MaterialTheme.colorScheme.surfaceContainer
|
||||||
else
|
else
|
||||||
LocalCustomColors.current.background
|
Color.Transparent
|
||||||
),
|
),
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
Text(text = item.name,
|
Text(text = item.name,
|
||||||
@@ -289,7 +291,7 @@ private fun Codecs(codecs: SnapshotStateList<Codec>, onUpdateCodecs: (List<Codec
|
|||||||
)
|
)
|
||||||
if (codecs.indexOf(item) > 0)
|
if (codecs.indexOf(item) > 0)
|
||||||
HorizontalDivider(
|
HorizontalDivider(
|
||||||
color = LocalCustomColors.current.gray,
|
color = MaterialTheme.colorScheme.outlineVariant,
|
||||||
modifier = Modifier.padding(horizontal = 12.dp),
|
modifier = Modifier.padding(horizontal = 12.dp),
|
||||||
thickness = 1.dp
|
thickness = 1.dp
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ private fun ContactsScreen(navController: NavController, viewModel: ViewModel) {
|
|||||||
SmallFloatingActionButton(
|
SmallFloatingActionButton(
|
||||||
modifier = Modifier.offset(x = 2.dp),
|
modifier = Modifier.offset(x = 2.dp),
|
||||||
onClick = { navController.navigate("baresip_contact//new") },
|
onClick = { navController.navigate("baresip_contact//new") },
|
||||||
containerColor = MaterialTheme.colorScheme.secondaryContainer,
|
containerColor = MaterialTheme.colorScheme.secondary,
|
||||||
contentColor = MaterialTheme.colorScheme.onSecondaryContainer
|
contentColor = MaterialTheme.colorScheme.onSecondary
|
||||||
) {
|
) {
|
||||||
Icon(imageVector = Icons.Filled.Add,
|
Icon(imageVector = Icons.Filled.Add,
|
||||||
modifier = Modifier.size(36.dp),
|
modifier = Modifier.size(36.dp),
|
||||||
@@ -148,8 +148,6 @@ private fun ContactsContent(
|
|||||||
val neutralText = remember { mutableStateOf("") }
|
val neutralText = remember { mutableStateOf("") }
|
||||||
val neutralAction = remember { mutableStateOf({}) }
|
val neutralAction = remember { mutableStateOf({}) }
|
||||||
|
|
||||||
Log.d("THEME_TEST", "ContactsScreen Primary: ${MaterialTheme.colorScheme.primary}")
|
|
||||||
|
|
||||||
if (showDialog.value)
|
if (showDialog.value)
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
showDialog = showDialog,
|
showDialog = showDialog,
|
||||||
@@ -225,7 +223,6 @@ private fun ContactsContent(
|
|||||||
Text(text = name,
|
Text(text = name,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
fontStyle = if (contact.favorite()) FontStyle.Italic else FontStyle.Normal,
|
fontStyle = if (contact.favorite()) FontStyle.Italic else FontStyle.Normal,
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(start = 10.dp)
|
.padding(start = 10.dp)
|
||||||
@@ -309,7 +306,6 @@ private fun ContactsContent(
|
|||||||
Text(text = name,
|
Text(text = name,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
fontStyle = if (contact.favorite()) FontStyle.Italic else FontStyle.Normal,
|
fontStyle = if (contact.favorite()) FontStyle.Italic else FontStyle.Normal,
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(start = 10.dp, top = 4.dp, bottom = 4.dp)
|
.padding(start = 10.dp, top = 4.dp, bottom = 4.dp)
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ data class CustomColors(
|
|||||||
val primaryLight: Color = Color.Unspecified,
|
val primaryLight: Color = Color.Unspecified,
|
||||||
val secondaryDark: Color = Color.Unspecified,
|
val secondaryDark: Color = Color.Unspecified,
|
||||||
val secondaryLight: Color = Color.Unspecified,
|
val secondaryLight: Color = Color.Unspecified,
|
||||||
val gray: Color = Color.Unspecified,
|
|
||||||
val grayDark: Color = Color.Unspecified,
|
val grayDark: Color = Color.Unspecified,
|
||||||
val grayLight: Color = Color.Unspecified,
|
val grayLight: Color = Color.Unspecified,
|
||||||
val accent: Color = Color.Unspecified,
|
val accent: Color = Color.Unspecified,
|
||||||
@@ -47,7 +46,6 @@ data class CustomColors(
|
|||||||
val dark: Color = Color.Unspecified,
|
val dark: Color = Color.Unspecified,
|
||||||
val spinnerText: Color = Color.Unspecified,
|
val spinnerText: Color = Color.Unspecified,
|
||||||
val spinnerDropdown: Color = Color.Unspecified,
|
val spinnerDropdown: Color = Color.Unspecified,
|
||||||
val spinnerDivider: Color = Color.Unspecified,
|
|
||||||
val itemText: Color = Color.Unspecified,
|
val itemText: Color = Color.Unspecified,
|
||||||
val alertText: Color = Color.Unspecified,
|
val alertText: Color = Color.Unspecified,
|
||||||
val codec: Color = Color.Unspecified,
|
val codec: Color = Color.Unspecified,
|
||||||
@@ -69,7 +67,7 @@ val light_tertiary = Color(0xFF9885B5)
|
|||||||
val light_on_tertiary = Color(0xffe0e0e0)
|
val light_on_tertiary = Color(0xffe0e0e0)
|
||||||
val light_tertiary_container = Color(0xFFDAD2E6)
|
val light_tertiary_container = Color(0xFFDAD2E6)
|
||||||
val light_on_tertiary_container = Color(0xFF2B2533)
|
val light_on_tertiary_container = Color(0xFF2B2533)
|
||||||
val light_error = Color(0xFFF77445)
|
val light_error = Color(0xFFB3261E) // Color(0xFFF77445)
|
||||||
val light_on_error = Color(0xffe0e0e0)
|
val light_on_error = Color(0xffe0e0e0)
|
||||||
val light_error_container = Color(0xFFE6BFB1)
|
val light_error_container = Color(0xFFE6BFB1)
|
||||||
val light_on_error_container = Color(0xFF33180E)
|
val light_on_error_container = Color(0xFF33180E)
|
||||||
@@ -84,13 +82,11 @@ val light_primary_dark = Color(0xff0073c9)
|
|||||||
val light_primary_light = Color(0xff6ad2ff)
|
val light_primary_light = Color(0xff6ad2ff)
|
||||||
val light_secondary_dark = Color(0xFF008873)
|
val light_secondary_dark = Color(0xFF008873)
|
||||||
val light_secondary_light = Color(0xff5cecd2)
|
val light_secondary_light = Color(0xff5cecd2)
|
||||||
val light_gray = Color(0xff9e9e9e)
|
|
||||||
val light_gray_dark = Color(0xFF424242)
|
val light_gray_dark = Color(0xFF424242)
|
||||||
val light_gray_light = Color(0xffe0e0e0)
|
val light_gray_light = Color(0xffe0e0e0)
|
||||||
val light_accent = Color(0xFFF77445)
|
val light_accent = Color(0xFFF77445)
|
||||||
val light_light = Color(0xfffcfcfc)
|
val light_light = Color(0xfffcfcfc)
|
||||||
val light_dark = Color(0xFF383838)
|
val light_dark = Color(0xFF383838)
|
||||||
val light_spinner_divider = light_gray
|
|
||||||
val light_item_text = light_dark
|
val light_item_text = light_dark
|
||||||
val light_textfield_background = light_gray_light
|
val light_textfield_background = light_gray_light
|
||||||
val light_card_background = light_gray_light
|
val light_card_background = light_gray_light
|
||||||
@@ -130,7 +126,6 @@ val dark_gray_light = Color(0xffe0e0e0)
|
|||||||
val dark_accent = Color(0xFFF77445)
|
val dark_accent = Color(0xFFF77445)
|
||||||
val dark_light = dark_gray_light
|
val dark_light = dark_gray_light
|
||||||
val dark_dark = Color(0xFF121212)
|
val dark_dark = Color(0xFF121212)
|
||||||
val dark_spinner_divider = dark_gray_dark
|
|
||||||
val dark_item_text = dark_gray_light
|
val dark_item_text = dark_gray_light
|
||||||
val dark_textfield_background = dark_gray
|
val dark_textfield_background = dark_gray
|
||||||
val dark_card_background = dark_gray_dark
|
val dark_card_background = dark_gray_dark
|
||||||
@@ -166,13 +161,11 @@ val LightCustomColors = CustomColors(
|
|||||||
primaryLight = light_primary_light,
|
primaryLight = light_primary_light,
|
||||||
secondaryDark = light_secondary_dark,
|
secondaryDark = light_secondary_dark,
|
||||||
secondaryLight = light_secondary_light,
|
secondaryLight = light_secondary_light,
|
||||||
gray = light_gray,
|
|
||||||
grayDark = light_gray_dark,
|
grayDark = light_gray_dark,
|
||||||
grayLight = light_gray_light,
|
grayLight = light_gray_light,
|
||||||
accent = light_accent,
|
accent = light_accent,
|
||||||
light = light_light,
|
light = light_light,
|
||||||
dark = light_dark,
|
dark = light_dark,
|
||||||
spinnerDivider = light_spinner_divider,
|
|
||||||
itemText = light_item_text,
|
itemText = light_item_text,
|
||||||
cardBackground = light_card_background,
|
cardBackground = light_card_background,
|
||||||
textFieldBackground = light_textfield_background,
|
textFieldBackground = light_textfield_background,
|
||||||
@@ -209,13 +202,11 @@ val DarkCustomColors = CustomColors(
|
|||||||
primaryLight = dark_primary_light,
|
primaryLight = dark_primary_light,
|
||||||
secondaryDark = dark_secondary_dark,
|
secondaryDark = dark_secondary_dark,
|
||||||
secondaryLight = dark_secondary_light,
|
secondaryLight = dark_secondary_light,
|
||||||
gray = dark_gray,
|
|
||||||
grayDark = dark_gray_dark,
|
grayDark = dark_gray_dark,
|
||||||
grayLight = dark_gray_light,
|
grayLight = dark_gray_light,
|
||||||
accent = dark_accent,
|
accent = dark_accent,
|
||||||
light = dark_light,
|
light = dark_light,
|
||||||
dark = dark_dark,
|
dark = dark_dark,
|
||||||
spinnerDivider = dark_spinner_divider,
|
|
||||||
itemText = dark_item_text,
|
itemText = dark_item_text,
|
||||||
cardBackground = dark_card_background,
|
cardBackground = dark_card_background,
|
||||||
textFieldBackground = dark_textfield_background,
|
textFieldBackground = dark_textfield_background,
|
||||||
|
|||||||
@@ -72,40 +72,17 @@ import androidx.compose.ui.res.painterResource
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.res.vectorResource
|
import androidx.compose.ui.res.vectorResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||||
import androidx.compose.ui.text.input.VisualTransformation
|
import androidx.compose.ui.text.input.VisualTransformation
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.Dp
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.TextUnit
|
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
|
|
||||||
object CustomElements {
|
object CustomElements {
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun LabelText(
|
|
||||||
text: String,
|
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
color: Color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize: TextUnit = 16.sp,
|
|
||||||
fontWeight: FontWeight = FontWeight.Normal,
|
|
||||||
textAlign: TextAlign? = null,
|
|
||||||
maxLines: Int = 1,
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = text,
|
|
||||||
modifier = modifier,
|
|
||||||
color = color,
|
|
||||||
fontSize = fontSize,
|
|
||||||
fontWeight = fontWeight,
|
|
||||||
textAlign = textAlign,
|
|
||||||
maxLines = maxLines
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Button(
|
fun Button(
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
@@ -214,7 +191,7 @@ object CustomElements {
|
|||||||
state: ScrollState,
|
state: ScrollState,
|
||||||
scrollbarWidth: Dp = 4.dp,
|
scrollbarWidth: Dp = 4.dp,
|
||||||
alwaysShow: Boolean = true,
|
alwaysShow: Boolean = true,
|
||||||
color: Color = LocalCustomColors.current.gray
|
color: Color = MaterialTheme.colorScheme.outlineVariant
|
||||||
): Modifier {
|
): Modifier {
|
||||||
val alpha by animateFloatAsState(
|
val alpha by animateFloatAsState(
|
||||||
targetValue = if(state.isScrollInProgress || alwaysShow) 1f else 0f,
|
targetValue = if(state.isScrollInProgress || alwaysShow) 1f else 0f,
|
||||||
@@ -242,7 +219,7 @@ object CustomElements {
|
|||||||
state: LazyListState,
|
state: LazyListState,
|
||||||
width: Dp = 8.dp,
|
width: Dp = 8.dp,
|
||||||
alwaysShow: Boolean = true,
|
alwaysShow: Boolean = true,
|
||||||
color: Color = LocalCustomColors.current.gray
|
color: Color = MaterialTheme.colorScheme.outlineVariant
|
||||||
): Modifier {
|
): Modifier {
|
||||||
val targetAlpha = if (state.isScrollInProgress || alwaysShow) 1f else 0f
|
val targetAlpha = if (state.isScrollInProgress || alwaysShow) 1f else 0f
|
||||||
val duration = if (state.isScrollInProgress) 150 else 500
|
val duration = if (state.isScrollInProgress) 150 else 500
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ import androidx.compose.material3.IconButton
|
|||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedButton
|
import androidx.compose.material3.OutlinedButton
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.OutlinedTextFieldDefaults
|
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Switch
|
import androidx.compose.material3.Switch
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
@@ -129,7 +128,6 @@ import com.tutpro.baresip.BaresipService.Companion.uas
|
|||||||
import com.tutpro.baresip.BaresipService.Companion.uasStatus
|
import com.tutpro.baresip.BaresipService.Companion.uasStatus
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.DropdownMenu
|
import com.tutpro.baresip.CustomElements.DropdownMenu
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
|
||||||
import com.tutpro.baresip.CustomElements.PasswordDialog
|
import com.tutpro.baresip.CustomElements.PasswordDialog
|
||||||
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
@@ -988,10 +986,10 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na
|
|||||||
.height(50.dp)
|
.height(50.dp)
|
||||||
.fillMaxWidth(),
|
.fillMaxWidth(),
|
||||||
colors = ButtonColors(
|
colors = ButtonColors(
|
||||||
containerColor = LocalCustomColors.current.grayLight,
|
containerColor = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
contentColor = LocalCustomColors.current.dark,
|
contentColor = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
disabledContainerColor = LocalCustomColors.current.grayLight,
|
disabledContainerColor = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
disabledContentColor = LocalCustomColors.current.dark
|
disabledContentColor = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
),
|
),
|
||||||
shape = RoundedCornerShape(12.dp),
|
shape = RoundedCornerShape(12.dp),
|
||||||
contentPadding = PaddingValues(horizontal = 10.dp)
|
contentPadding = PaddingValues(horizontal = 10.dp)
|
||||||
@@ -1037,8 +1035,8 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na
|
|||||||
colors = ButtonColors(
|
colors = ButtonColors(
|
||||||
containerColor = MaterialTheme.colorScheme.surfaceVariant,
|
containerColor = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
contentColor = MaterialTheme.colorScheme.onSurfaceVariant,
|
contentColor = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
disabledContainerColor = LocalCustomColors.current.grayLight,
|
disabledContainerColor = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
disabledContentColor = LocalCustomColors.current.dark
|
disabledContentColor = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
),
|
),
|
||||||
shape = RoundedCornerShape(12.dp),
|
shape = RoundedCornerShape(12.dp),
|
||||||
contentPadding = PaddingValues(horizontal = 10.dp)
|
contentPadding = PaddingValues(horizontal = 10.dp)
|
||||||
@@ -1149,8 +1147,10 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
value = callUri.value,
|
value = callUri.value,
|
||||||
enabled = callUriEnabled.value,
|
enabled = callUriEnabled.value,
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
colors = OutlinedTextFieldDefaults.colors(
|
//colors = OutlinedTextFieldDefaults.colors(
|
||||||
disabledBorderColor = OutlinedTextFieldDefaults.colors().unfocusedIndicatorColor),
|
// focusedBorderColor = MaterialTheme.colorScheme.primary,
|
||||||
|
// unfocusedBorderColor = MaterialTheme.colorScheme.outline,
|
||||||
|
//),
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
if (it != callUri.value) {
|
if (it != callUri.value) {
|
||||||
callUri.value = it
|
callUri.value = it
|
||||||
@@ -1164,13 +1164,13 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
if (callUriEnabled.value && callUri.value.isNotEmpty())
|
if (callUriEnabled.value && callUri.value.isNotEmpty())
|
||||||
Icon(Icons.Outlined.Clear,
|
Icon(Icons.Outlined.Clear,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier
|
modifier = Modifier.clickable {
|
||||||
.clickable {
|
if (showSuggestions.value)
|
||||||
if (showSuggestions.value)
|
showSuggestions.value = false
|
||||||
showSuggestions.value = false
|
else
|
||||||
else
|
callUri.value = ""
|
||||||
callUri.value = ""
|
},
|
||||||
}
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -1183,16 +1183,8 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
if (account.numericKeypad)
|
if (account.numericKeypad)
|
||||||
viewModel.updateDialpadIcon(R.drawable.dialpad_on)
|
viewModel.updateDialpadIcon(R.drawable.dialpad_on)
|
||||||
},
|
},
|
||||||
label = {
|
label = { Text(text = callUriLabel.value, fontSize = 18.sp) },
|
||||||
LabelText(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
text = callUriLabel.value,
|
|
||||||
fontSize = 18.sp,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
textStyle = TextStyle(
|
|
||||||
fontSize = 18.sp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
),
|
|
||||||
keyboardOptions = if (dialpadIcon == R.drawable.dialpad_on)
|
keyboardOptions = if (dialpadIcon == R.drawable.dialpad_on)
|
||||||
KeyboardOptions(keyboardType = KeyboardType.Phone)
|
KeyboardOptions(keyboardType = KeyboardType.Phone)
|
||||||
else
|
else
|
||||||
@@ -1204,7 +1196,7 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.shadow(8.dp, RoundedCornerShape(8.dp))
|
.shadow(8.dp, RoundedCornerShape(8.dp))
|
||||||
.background(
|
.background(
|
||||||
LocalCustomColors.current.grayLight,
|
color = MaterialTheme.colorScheme.surfaceContainer,
|
||||||
shape = RoundedCornerShape(8.dp)
|
shape = RoundedCornerShape(8.dp)
|
||||||
)
|
)
|
||||||
.animateContentSize()
|
.animateContentSize()
|
||||||
@@ -1217,7 +1209,8 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.verticalScrollbar(
|
.verticalScrollbar(
|
||||||
state = lazyListState
|
state = lazyListState,
|
||||||
|
color = MaterialTheme.colorScheme.outlineVariant
|
||||||
),
|
),
|
||||||
horizontalAlignment = Alignment.Start,
|
horizontalAlignment = Alignment.Start,
|
||||||
state = lazyListState
|
state = lazyListState
|
||||||
@@ -1238,7 +1231,7 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
Text(
|
Text(
|
||||||
text = suggestion,
|
text = suggestion,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
color = LocalCustomColors.current.grayDark,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
fontSize = 18.sp
|
fontSize = 18.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1249,7 +1242,7 @@ private fun CallUriRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (showCallTimer.value) {
|
if (showCallTimer.value) {
|
||||||
val textColor = LocalCustomColors.current.itemText.toArgb()
|
val textColor = MaterialTheme.colorScheme.onBackground.toArgb()
|
||||||
var chronometerInstance: Chronometer? = null
|
var chronometerInstance: Chronometer? = null
|
||||||
AndroidView(
|
AndroidView(
|
||||||
factory = { context ->
|
factory = { context ->
|
||||||
@@ -1499,7 +1492,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
||||||
shape = RoundedCornerShape(16.dp),
|
shape = RoundedCornerShape(16.dp),
|
||||||
colors = CardDefaults.cardColors(
|
colors = CardDefaults.cardColors(
|
||||||
containerColor = LocalCustomColors.current.cardBackground
|
containerColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.padding(16.dp)) {
|
Column(modifier = Modifier.padding(16.dp)) {
|
||||||
@@ -1540,23 +1533,16 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
showSuggestions.value = false
|
showSuggestions.value = false
|
||||||
else
|
else
|
||||||
transferUri = ""
|
transferUri = ""
|
||||||
}
|
},
|
||||||
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(
|
.padding(start = 4.dp, end = 4.dp, top = 12.dp, bottom = 2.dp)
|
||||||
start = 4.dp,
|
|
||||||
end = 4.dp,
|
|
||||||
top = 12.dp,
|
|
||||||
bottom = 2.dp
|
|
||||||
)
|
|
||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
label = { LabelText(stringResource(R.string.transfer_destination)) },
|
label = { Text(stringResource(R.string.transfer_destination)) },
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
),
|
|
||||||
keyboardOptions = if (dialpadIcon == R.drawable.dialpad_on)
|
keyboardOptions = if (dialpadIcon == R.drawable.dialpad_on)
|
||||||
KeyboardOptions(keyboardType = KeyboardType.Phone)
|
KeyboardOptions(keyboardType = KeyboardType.Phone)
|
||||||
else
|
else
|
||||||
@@ -1568,7 +1554,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.shadow(8.dp, RoundedCornerShape(8.dp))
|
.shadow(8.dp, RoundedCornerShape(8.dp))
|
||||||
.background(
|
.background(
|
||||||
LocalCustomColors.current.grayLight,
|
color = MaterialTheme.colorScheme.surfaceContainer,
|
||||||
shape = RoundedCornerShape(8.dp)
|
shape = RoundedCornerShape(8.dp)
|
||||||
)
|
)
|
||||||
.animateContentSize()
|
.animateContentSize()
|
||||||
@@ -1581,7 +1567,8 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.verticalScrollbar(
|
.verticalScrollbar(
|
||||||
state = lazyListState
|
state = lazyListState,
|
||||||
|
color = MaterialTheme.colorScheme.outlineVariant
|
||||||
),
|
),
|
||||||
horizontalAlignment = Alignment.Start,
|
horizontalAlignment = Alignment.Start,
|
||||||
state = lazyListState,
|
state = lazyListState,
|
||||||
@@ -1602,7 +1589,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
Text(
|
Text(
|
||||||
text = suggestion,
|
text = suggestion,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
color = LocalCustomColors.current.grayDark,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
fontSize = 18.sp
|
fontSize = 18.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1619,7 +1606,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.blind),
|
text = stringResource(R.string.blind),
|
||||||
color = LocalCustomColors.current.alert,
|
color = MaterialTheme.colorScheme.error,
|
||||||
modifier = Modifier.padding(8.dp),
|
modifier = Modifier.padding(8.dp),
|
||||||
)
|
)
|
||||||
Switch(
|
Switch(
|
||||||
@@ -1633,7 +1620,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.attended),
|
text = stringResource(R.string.attended),
|
||||||
color = LocalCustomColors.current.alert,
|
color = MaterialTheme.colorScheme.error,
|
||||||
modifier = Modifier.padding(8.dp),
|
modifier = Modifier.padding(8.dp),
|
||||||
)
|
)
|
||||||
Switch(
|
Switch(
|
||||||
@@ -1659,7 +1646,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.cancel),
|
text = stringResource(R.string.cancel),
|
||||||
color = LocalCustomColors.current.gray
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
TextButton(
|
TextButton(
|
||||||
@@ -1737,7 +1724,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
|
|||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
enabled = dtmfEnabled.value,
|
enabled = dtmfEnabled.value,
|
||||||
textStyle = TextStyle(fontSize = 16.sp),
|
textStyle = TextStyle(fontSize = 16.sp),
|
||||||
label = { LabelText(stringResource(R.string.dtmf)) },
|
label = { Text(stringResource(R.string.dtmf)) },
|
||||||
singleLine = true
|
singleLine = true
|
||||||
)
|
)
|
||||||
LaunchedEffect(shouldRequestFocus) {
|
LaunchedEffect(shouldRequestFocus) {
|
||||||
@@ -1836,8 +1823,7 @@ private fun OnHoldNotice() {
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.call_is_on_hold),
|
text = stringResource(R.string.call_is_on_hold),
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.layout.statusBars
|
import androidx.compose.foundation.layout.statusBars
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
import androidx.compose.foundation.rememberScrollState
|
|
||||||
import androidx.compose.foundation.text.KeyboardOptions
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
import androidx.compose.foundation.verticalScroll
|
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Check
|
import androidx.compose.material.icons.filled.Check
|
||||||
@@ -81,7 +79,6 @@ import androidx.navigation.NavController
|
|||||||
import androidx.navigation.NavGraphBuilder
|
import androidx.navigation.NavGraphBuilder
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
import com.tutpro.baresip.Utils.copyInputStreamToFile
|
import com.tutpro.baresip.Utils.copyInputStreamToFile
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -151,14 +148,11 @@ private fun SettingsScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxSize().imePadding(),
|
||||||
.fillMaxSize()
|
|
||||||
.imePadding(),
|
|
||||||
containerColor = MaterialTheme.colorScheme.background,
|
containerColor = MaterialTheme.colorScheme.background,
|
||||||
topBar = {
|
topBar = {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxWidth()
|
||||||
.fillMaxWidth()
|
|
||||||
.background(MaterialTheme.colorScheme.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(
|
.padding(
|
||||||
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
||||||
@@ -264,9 +258,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun StartAutomatically() {
|
fun StartAutomatically() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -279,8 +271,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.start_automatically_help)
|
alertMessage.value = ctx.getString(R.string.start_automatically_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val startAutomatically by viewModel.autoStart.collectAsState()
|
val startAutomatically by viewModel.autoStart.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = startAutomatically,
|
checked = startAutomatically,
|
||||||
@@ -314,9 +306,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun ListenAddress() {
|
fun ListenAddress() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start,
|
horizontalArrangement = Arrangement.Start,
|
||||||
) {
|
) {
|
||||||
@@ -336,9 +326,8 @@ private fun SettingsContent(
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.listen_address)) },
|
||||||
label = { LabelText(stringResource(R.string.listen_address)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -347,10 +336,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun AddressFamily() {
|
fun AddressFamily() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(top = 12.dp).padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(top = 12.dp)
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -364,8 +350,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.address_family_help)
|
alertMessage.value = ctx.getString(R.string.address_family_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val isDropDownExpanded = remember {
|
val isDropDownExpanded = remember {
|
||||||
mutableStateOf(false)
|
mutableStateOf(false)
|
||||||
}
|
}
|
||||||
@@ -380,10 +366,8 @@ private fun SettingsContent(
|
|||||||
isDropDownExpanded.value = true
|
isDropDownExpanded.value = true
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = familyNames[itemPosition.intValue],
|
Text(text = familyNames[itemPosition.intValue])
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
@@ -399,10 +383,7 @@ private fun SettingsContent(
|
|||||||
viewModel.addressFamily.value = familyValues[index]
|
viewModel.addressFamily.value = familyValues[index]
|
||||||
})
|
})
|
||||||
if (index < 2)
|
if (index < 2)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -412,9 +393,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun DnsServers() {
|
fun DnsServers() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -432,10 +411,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.dns_servers_help)
|
alertMessage.value = ctx.getString(R.string.dns_servers_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText
|
label = { Text(stringResource(R.string.dns_servers)) },
|
||||||
),
|
|
||||||
label = { LabelText(stringResource(R.string.dns_servers)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -482,9 +459,7 @@ private fun SettingsContent(
|
|||||||
val showAlertDialog = remember { mutableStateOf(false) }
|
val showAlertDialog = remember { mutableStateOf(false) }
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -497,8 +472,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.tls_certificate_file_help)
|
alertMessage.value = ctx.getString(R.string.tls_certificate_file_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val tlsCertificateFile by viewModel.tlsCertificateFile.collectAsState()
|
val tlsCertificateFile by viewModel.tlsCertificateFile.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = tlsCertificateFile,
|
checked = tlsCertificateFile,
|
||||||
@@ -560,29 +535,24 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun VerifyServer() {
|
fun VerifyServer() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.verify_server),
|
Text(text = stringResource(R.string.verify_server),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.verify_server)
|
alertTitle.value = ctx.getString(R.string.verify_server)
|
||||||
alertMessage.value = ctx.getString(R.string.verify_server_help)
|
alertMessage.value = ctx.getString(R.string.verify_server_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val verifyServer by viewModel.verifyServer.collectAsState()
|
val verifyServer by viewModel.verifyServer.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = verifyServer,
|
checked = verifyServer,
|
||||||
onCheckedChange = {
|
onCheckedChange = { viewModel.verifyServer.value = it }
|
||||||
viewModel.verifyServer.value = it
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -620,23 +590,20 @@ private fun SettingsContent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.tls_ca_file),
|
Text(text = stringResource(R.string.tls_ca_file),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.tls_ca_file)
|
alertTitle.value = ctx.getString(R.string.tls_ca_file)
|
||||||
alertMessage.value = ctx.getString(R.string.tls_ca_file_help)
|
alertMessage.value = ctx.getString(R.string.tls_ca_file_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val caFile by viewModel.caFile.collectAsState()
|
val caFile by viewModel.caFile.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = caFile,
|
checked = caFile,
|
||||||
@@ -690,9 +657,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun UserAgent() {
|
fun UserAgent() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -701,9 +666,7 @@ private fun SettingsContent(
|
|||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = userAgent,
|
value = userAgent,
|
||||||
placeholder = { Text(stringResource(R.string.user_agent)) },
|
placeholder = { Text(stringResource(R.string.user_agent)) },
|
||||||
onValueChange = {
|
onValueChange = { viewModel.userAgent.value = it },
|
||||||
viewModel.userAgent.value = it
|
|
||||||
},
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clickable {
|
.clickable {
|
||||||
@@ -711,9 +674,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.user_agent_help)
|
alertMessage.value = ctx.getString(R.string.user_agent_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(fontSize = 18.sp),
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
label = { Text(stringResource(R.string.user_agent)) },
|
||||||
label = { LabelText(stringResource(R.string.user_agent)) },
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -722,20 +684,14 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun AudioSettings(navController: NavController) {
|
fun AudioSettings(navController: NavController) {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(top = 12.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(top = 12.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.audio_settings),
|
text = stringResource(R.string.audio_settings),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
.clickable { navController.navigate("audio") },
|
||||||
.clickable {
|
|
||||||
navController.navigate("audio")
|
|
||||||
},
|
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight. Bold
|
fontWeight = FontWeight. Bold
|
||||||
)
|
)
|
||||||
@@ -746,10 +702,7 @@ private fun SettingsContent(
|
|||||||
fun Contacts(activity: Activity) {
|
fun Contacts(activity: Activity) {
|
||||||
val showAlertDialog = remember { mutableStateOf(false) }
|
val showAlertDialog = remember { mutableStateOf(false) }
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(top = 12.dp).padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(top = 12.dp)
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -762,8 +715,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.contacts_help)
|
alertMessage.value = ctx.getString(R.string.contacts_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val isDropDownExpanded = remember {
|
val isDropDownExpanded = remember {
|
||||||
mutableStateOf(false)
|
mutableStateOf(false)
|
||||||
}
|
}
|
||||||
@@ -790,10 +743,8 @@ private fun SettingsContent(
|
|||||||
isDropDownExpanded.value = true
|
isDropDownExpanded.value = true
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = contactNames[itemPosition.intValue],
|
Text(text = contactNames[itemPosition.intValue])
|
||||||
color = LocalCustomColors.current.itemText)
|
CustomElements.DrawDrawable(R.drawable.arrow_drop_down)
|
||||||
CustomElements.DrawDrawable(R.drawable.arrow_drop_down,
|
|
||||||
tint = LocalCustomColors.current.itemText)
|
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isDropDownExpanded.value,
|
expanded = isDropDownExpanded.value,
|
||||||
@@ -854,10 +805,7 @@ private fun SettingsContent(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (index < 2)
|
if (index < 2)
|
||||||
HorizontalDivider(
|
HorizontalDivider(thickness = 1.dp)
|
||||||
thickness = 1.dp,
|
|
||||||
color = LocalCustomColors.current.itemText
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -895,9 +843,7 @@ private fun SettingsContent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(top = 12.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(top = 12.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -923,7 +869,6 @@ private fun SettingsContent(
|
|||||||
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true)
|
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true)
|
||||||
launcher.launch(intent)
|
launcher.launch(intent)
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
@@ -933,9 +878,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun BatteryOptimizations() {
|
fun BatteryOptimizations() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -955,8 +898,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.battery_optimizations_help)
|
alertMessage.value = ctx.getString(R.string.battery_optimizations_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val battery by viewModel.batteryOptimizations.collectAsState()
|
val battery by viewModel.batteryOptimizations.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = battery,
|
checked = battery,
|
||||||
@@ -972,9 +915,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun DarkTheme() {
|
fun DarkTheme() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -987,14 +928,12 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.dark_theme_help)
|
alertMessage.value = ctx.getString(R.string.dark_theme_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val darkTheme by viewModel.darkTheme.collectAsState()
|
val darkTheme by viewModel.darkTheme.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = darkTheme,
|
checked = darkTheme,
|
||||||
onCheckedChange = {
|
onCheckedChange = { viewModel.darkTheme.value = it }
|
||||||
viewModel.darkTheme.value = it
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1002,29 +941,24 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun DynamicColors() {
|
fun DynamicColors() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.dynamic_colors),
|
Text(text = stringResource(R.string.dynamic_colors),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.dynamic_colors)
|
alertTitle.value = ctx.getString(R.string.dynamic_colors)
|
||||||
alertMessage.value = ctx.getString(R.string.dynamic_colors_help)
|
alertMessage.value = ctx.getString(R.string.dynamic_colors_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val dynamicColors by viewModel.dynamicColors.collectAsState()
|
val dynamicColors by viewModel.dynamicColors.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = dynamicColors,
|
checked = dynamicColors,
|
||||||
onCheckedChange = {
|
onCheckedChange = { viewModel.dynamicColors.value = it }
|
||||||
viewModel.dynamicColors.value = it
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1032,9 +966,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun ColorBlind() {
|
fun ColorBlind() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -1047,23 +979,19 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.colorblind_help)
|
alertMessage.value = ctx.getString(R.string.colorblind_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val colorblind by viewModel.colorblind.collectAsState()
|
val colorblind by viewModel.colorblind.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = colorblind,
|
checked = colorblind,
|
||||||
onCheckedChange = {
|
onCheckedChange = { viewModel.colorblind.value = it }
|
||||||
viewModel.colorblind.value = it
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Composable
|
@Composable
|
||||||
fun ProximitySensing() {
|
fun ProximitySensing() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -1076,14 +1004,12 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.proximity_sensing_help)
|
alertMessage.value = ctx.getString(R.string.proximity_sensing_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val proximitySensing by viewModel.proximitySensing.collectAsState()
|
val proximitySensing by viewModel.proximitySensing.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = proximitySensing,
|
checked = proximitySensing,
|
||||||
onCheckedChange = {
|
onCheckedChange = { viewModel.proximitySensing.value = it }
|
||||||
viewModel.proximitySensing.value = it
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1092,9 +1018,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun DefaultDialer() {
|
fun DefaultDialer() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -1107,8 +1031,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.default_phone_app_help)
|
alertMessage.value = ctx.getString(R.string.default_phone_app_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val defaultDialer by viewModel.defaultDialer.collectAsState()
|
val defaultDialer by viewModel.defaultDialer.collectAsState()
|
||||||
val roleManager = ctx.getSystemService(ROLE_SERVICE) as RoleManager
|
val roleManager = ctx.getSystemService(ROLE_SERVICE) as RoleManager
|
||||||
val dialerRoleRequest = rememberLauncherForActivityResult(
|
val dialerRoleRequest = rememberLauncherForActivityResult(
|
||||||
@@ -1145,29 +1069,24 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun Debug() {
|
fun Debug() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
Text(text = stringResource(R.string.debug),
|
Text(text = stringResource(R.string.debug),
|
||||||
modifier = Modifier
|
modifier = Modifier.weight(1f)
|
||||||
.weight(1f)
|
|
||||||
.clickable {
|
.clickable {
|
||||||
alertTitle.value = ctx.getString(R.string.debug)
|
alertTitle.value = ctx.getString(R.string.debug)
|
||||||
alertMessage.value = ctx.getString(R.string.debug_help)
|
alertMessage.value = ctx.getString(R.string.debug_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val debug by viewModel.debug.collectAsState()
|
val debug by viewModel.debug.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = debug,
|
checked = debug,
|
||||||
onCheckedChange = {
|
onCheckedChange = { viewModel.debug.value = it }
|
||||||
viewModel.debug.value = it
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1175,9 +1094,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun SipTrace() {
|
fun SipTrace() {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -1190,14 +1107,12 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.sip_trace_help)
|
alertMessage.value = ctx.getString(R.string.sip_trace_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
val sipTrace by viewModel.sipTrace.collectAsState()
|
val sipTrace by viewModel.sipTrace.collectAsState()
|
||||||
Switch(
|
Switch(
|
||||||
checked = sipTrace,
|
checked = sipTrace,
|
||||||
onCheckedChange = {
|
onCheckedChange = { viewModel.sipTrace.value = it }
|
||||||
viewModel.sipTrace.value = it
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1205,9 +1120,7 @@ private fun SettingsContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun Reset(onRestartApp: () -> Unit) {
|
fun Reset(onRestartApp: () -> Unit) {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(end = 10.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.Start
|
horizontalArrangement = Arrangement.Start
|
||||||
) {
|
) {
|
||||||
@@ -1220,8 +1133,8 @@ private fun SettingsContent(
|
|||||||
alertMessage.value = ctx.getString(R.string.reset_config_help)
|
alertMessage.value = ctx.getString(R.string.reset_config_help)
|
||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
color = LocalCustomColors.current.itemText,
|
fontSize = 18.sp
|
||||||
fontSize = 18.sp)
|
)
|
||||||
var reset by remember { mutableStateOf(false) }
|
var reset by remember { mutableStateOf(false) }
|
||||||
Switch(
|
Switch(
|
||||||
checked = reset,
|
checked = reset,
|
||||||
@@ -1256,8 +1169,7 @@ private fun SettingsContent(
|
|||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
state = lazyListState,
|
state = lazyListState,
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxWidth()
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(contentPadding)
|
.padding(contentPadding)
|
||||||
.padding(start = 16.dp, end = 4.dp, top = 16.dp, bottom = 8.dp)
|
.padding(start = 16.dp, end = 4.dp, top = 16.dp, bottom = 8.dp)
|
||||||
.verticalScrollbar(
|
.verticalScrollbar(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorBackground">#121212</color>
|
|
||||||
<color name="colorPrimary">#0073c9</color>
|
<color name="colorPrimary">#0073c9</color>
|
||||||
<color name="colorPrimaryDark">#00008b</color>
|
<color name="colorPrimaryDark">#00008b</color>
|
||||||
<color name="colorPrimaryLight">#0ca1fd</color>
|
<color name="colorPrimaryLight">#0ca1fd</color>
|
||||||
@@ -25,10 +24,4 @@
|
|||||||
<color name="colorSpinnerText">@color/colorDark</color>
|
<color name="colorSpinnerText">@color/colorDark</color>
|
||||||
<color name="colorSpinnerDropdown">@color/colorGray</color>
|
<color name="colorSpinnerDropdown">@color/colorGray</color>
|
||||||
<color name="colorSpinnerDivider">@color/colorGrayDark</color>
|
<color name="colorSpinnerDivider">@color/colorGrayDark</color>
|
||||||
<color name="colorItemText">@color/colorGrayLight</color>
|
|
||||||
<color name="colorAlertText">@color/colorGrayLight</color>
|
|
||||||
<color name="colorCodec">@color/colorSecondaryDark</color>
|
|
||||||
<color name="colorCardBackground">@color/colorGrayDark</color>
|
|
||||||
<color name="colorPopupBackground">@color/colorSecondaryDark</color>
|
|
||||||
<color name="colorAlert">@color/colorPrimaryLight</color>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<color name="colorBackground">#fcfcfc</color>
|
|
||||||
<color name="colorPrimary">#0ca1fd</color>
|
<color name="colorPrimary">#0ca1fd</color>
|
||||||
<color name="colorPrimaryDark">#0073c9</color>
|
<color name="colorPrimaryDark">#0073c9</color>
|
||||||
<color name="colorPrimaryLight">#6ad2ff</color>
|
<color name="colorPrimaryLight">#6ad2ff</color>
|
||||||
@@ -25,10 +24,4 @@
|
|||||||
<color name="colorSpinnerText">@color/colorDark</color>
|
<color name="colorSpinnerText">@color/colorDark</color>
|
||||||
<color name="colorSpinnerDropdown">@color/colorGrayLight</color>
|
<color name="colorSpinnerDropdown">@color/colorGrayLight</color>
|
||||||
<color name="colorSpinnerDivider">@color/colorGray</color>
|
<color name="colorSpinnerDivider">@color/colorGray</color>
|
||||||
<color name="colorItemText">@color/colorBlack</color>
|
|
||||||
<color name="colorAlertText">@color/colorBlack</color>
|
|
||||||
<color name="colorCodec">@color/colorBlack</color>
|
|
||||||
<color name="colorCardBackground">@color/colorGrayLight</color>
|
|
||||||
<color name="colorPopupBackground">@color/colorSecondaryDark</color>
|
|
||||||
<color name="colorAlert">@color/colorPrimary</color>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user