settings work
This commit is contained in:
@@ -34,11 +34,9 @@ import androidx.compose.ui.unit.sp
|
||||
import com.odweta.solon.ui.theme.PastelYellow
|
||||
|
||||
@Composable
|
||||
fun SettingsScreen(modifier: Modifier = Modifier) {
|
||||
fun SettingsScreen() {
|
||||
// handle the back gesture (back swipe form side or back button on bottom android navbar)
|
||||
BackHandler {
|
||||
isShowing = IsShowing.Menu
|
||||
}
|
||||
BackHandler { global.currentScreenElement = ScreenElement.Menu }
|
||||
|
||||
val scrollState = rememberScrollState()
|
||||
|
||||
@@ -47,35 +45,7 @@ fun SettingsScreen(modifier: Modifier = Modifier) {
|
||||
.background(color = Color.Black)
|
||||
.verticalScroll(scrollState)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(start = 5.dp)
|
||||
) {
|
||||
Button(
|
||||
onClick = {
|
||||
isShowing = IsShowing.Menu
|
||||
},
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
contentColor = Color.White,
|
||||
containerColor = Color.Black
|
||||
),
|
||||
modifier = Modifier
|
||||
.border(
|
||||
width = 5.dp,
|
||||
shape = RoundedCornerShape(roundedCornerDimen),
|
||||
color = PastelYellow
|
||||
)
|
||||
.width(70.dp)
|
||||
.height(70.dp)
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.ArrowBackIosNew,
|
||||
contentDescription = "Back icon",
|
||||
modifier = Modifier.size(40.dp)
|
||||
)
|
||||
}
|
||||
} // back button
|
||||
backButtonFactory.get(BackButtonType.Menu)()
|
||||
|
||||
Spacer(Modifier.height(10.dp))
|
||||
|
||||
@@ -100,7 +70,7 @@ fun SettingsTableRow(setting: Setting) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(10.dp)
|
||||
.background(color = Color.Black, shape = RoundedCornerShape(roundedCornerDimen))
|
||||
.background(color = Color.Black, shape = RoundedCornerShape(global.dimens.roundedCorner))
|
||||
.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
@@ -124,7 +94,7 @@ fun SettingsTableRow(setting: Setting) {
|
||||
SettingsId.TagNewMarks -> settings.tagNewMarks = setting
|
||||
else -> {}
|
||||
}
|
||||
Util.saveStringToFile(settingsDataFilePath, settings.toString())
|
||||
Util.saveStringToFile(global.filePaths.settings, settings.toString())
|
||||
},
|
||||
colors = SwitchColors(
|
||||
uncheckedThumbColor = Color.Black,
|
||||
|
||||
Reference in New Issue
Block a user