Settings fixes
This commit is contained in:
@@ -48,7 +48,6 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
@@ -109,8 +108,6 @@ class AudioActivity : ComponentActivity() {
|
|||||||
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
|
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
val title = String.format(getString(R.string.configuration))
|
|
||||||
|
|
||||||
Utils.addActivity("audio")
|
Utils.addActivity("audio")
|
||||||
|
|
||||||
if (!BaresipService.agcAvailable)
|
if (!BaresipService.agcAvailable)
|
||||||
@@ -122,21 +119,21 @@ class AudioActivity : ComponentActivity() {
|
|||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
color = LocalCustomColors.current.background
|
color = LocalCustomColors.current.background
|
||||||
) {
|
) {
|
||||||
AudioScreen(title) { goBack() }
|
AudioScreen { goBack() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AudioScreen(title: String, navigateBack: () -> Unit) {
|
fun AudioScreen(navigateBack: () -> Unit) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
.imePadding()
|
.imePadding()
|
||||||
.safeDrawingPadding(),
|
.safeDrawingPadding(),
|
||||||
containerColor = LocalCustomColors.current.background,
|
containerColor = LocalCustomColors.current.background,
|
||||||
topBar = { TopAppBar(title, navigateBack) },
|
topBar = { TopAppBar(navigateBack) },
|
||||||
content = { contentPadding ->
|
content = { contentPadding ->
|
||||||
AudioContent(contentPadding)
|
AudioContent(contentPadding)
|
||||||
}
|
}
|
||||||
@@ -145,11 +142,11 @@ class AudioActivity : ComponentActivity() {
|
|||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun TopAppBar(title: String, navigateBack: () -> Unit) {
|
fun TopAppBar(navigateBack: () -> Unit) {
|
||||||
androidx.compose.material3.TopAppBar(
|
androidx.compose.material3.TopAppBar(
|
||||||
title = {
|
title = {
|
||||||
Text(
|
Text(
|
||||||
text = title,
|
text = stringResource(R.string.audio_settings),
|
||||||
color = LocalCustomColors.current.light,
|
color = LocalCustomColors.current.light,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -263,6 +263,9 @@ class ConfigActivity : ComponentActivity() {
|
|||||||
val caCertsFile = File(BaresipService.filesPath + "/ca_certs.crt")
|
val caCertsFile = File(BaresipService.filesPath + "/ca_certs.crt")
|
||||||
oldCaFile = caCertsFile.exists()
|
oldCaFile = caCertsFile.exists()
|
||||||
|
|
||||||
|
oldUserAgent = Config.variable("user_agent")
|
||||||
|
newUserAgent = oldUserAgent
|
||||||
|
|
||||||
powerManager = getSystemService(POWER_SERVICE) as PowerManager
|
powerManager = getSystemService(POWER_SERVICE) as PowerManager
|
||||||
oldBatteryOptimizations = powerManager
|
oldBatteryOptimizations = powerManager
|
||||||
.isIgnoringBatteryOptimizations(packageName) == false
|
.isIgnoringBatteryOptimizations(packageName) == false
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
startActivity(Intent(ctx, AboutActivity::class.java))
|
startActivity(Intent(ctx, AboutActivity::class.java))
|
||||||
}
|
}
|
||||||
settings -> {
|
settings -> {
|
||||||
startActivity(Intent(ctx, ConfigActivity::class.java))
|
configRequest.launch(Intent(ctx, ConfigActivity::class.java))
|
||||||
}
|
}
|
||||||
accounts -> {
|
accounts -> {
|
||||||
val i = Intent(ctx, AccountsActivity::class.java)
|
val i = Intent(ctx, AccountsActivity::class.java)
|
||||||
|
|||||||
Reference in New Issue
Block a user