adjust padding value of components

This commit is contained in:
BinTianqi
2024-07-22 18:00:42 +08:00
parent cacd9438e1
commit 2bb045e952
10 changed files with 45 additions and 46 deletions

View File

@@ -55,7 +55,7 @@ fun AppSetting(navCtrl:NavHostController, materialYou: MutableState<Boolean>, bl
@Composable @Composable
private fun Home(navCtrl: NavHostController) { private fun Home(navCtrl: NavHostController) {
Column(modifier = Modifier.fillMaxSize()) { Column(modifier = Modifier.fillMaxSize().padding(start = 30.dp, end = 12.dp)) {
SubPageItem(R.string.options, "", R.drawable.tune_fill0) { navCtrl.navigate("Options") } SubPageItem(R.string.options, "", R.drawable.tune_fill0) { navCtrl.navigate("Options") }
SubPageItem(R.string.theme, "", R.drawable.format_paint_fill0) { navCtrl.navigate("Theme") } SubPageItem(R.string.theme, "", R.drawable.format_paint_fill0) { navCtrl.navigate("Theme") }
SubPageItem(R.string.security, "", R.drawable.lock_fill0) { navCtrl.navigate("Auth") } SubPageItem(R.string.security, "", R.drawable.lock_fill0) { navCtrl.navigate("Auth") }
@@ -67,7 +67,7 @@ private fun Home(navCtrl: NavHostController) {
@Composable @Composable
private fun Options() { private fun Options() {
val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE) val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE)
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(start = 20.dp, end = 12.dp)) {
SwitchItem( SwitchItem(
R.string.show_dangerous_features, "", R.drawable.warning_fill0, R.string.show_dangerous_features, "", R.drawable.warning_fill0,
{ sharedPref.getBoolean("dangerous_features", false) }, { sharedPref.getBoolean("dangerous_features", false) },
@@ -79,7 +79,7 @@ private fun Options() {
@Composable @Composable
private fun ThemeSettings(materialYou:MutableState<Boolean>, blackTheme:MutableState<Boolean>) { private fun ThemeSettings(materialYou:MutableState<Boolean>, blackTheme:MutableState<Boolean>) {
val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE) val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE)
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(start = 20.dp, end = 12.dp)) {
if(VERSION.SDK_INT>=31) { if(VERSION.SDK_INT>=31) {
SwitchItem( SwitchItem(
R.string.material_you_color, stringResource(R.string.dynamic_color_desc), null, R.string.material_you_color, stringResource(R.string.dynamic_color_desc), null,
@@ -107,7 +107,7 @@ private fun ThemeSettings(materialYou:MutableState<Boolean>, blackTheme:MutableS
private fun AuthSettings() { private fun AuthSettings() {
val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE) val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE)
var auth by remember{ mutableStateOf(sharedPref.getBoolean("auth",false)) } var auth by remember{ mutableStateOf(sharedPref.getBoolean("auth",false)) }
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(start = 20.dp, end = 12.dp)) {
SwitchItem( SwitchItem(
R.string.lock_owndroid, "", null, R.string.lock_owndroid, "", null,
{ auth }, { auth },
@@ -133,7 +133,7 @@ private fun AuthSettings() {
{ sharedPref.getBoolean("protect_storage", false) }, { sharedPref.getBoolean("protect_storage", false) },
{ sharedPref.edit().putBoolean("protect_storage", it).apply() } { sharedPref.edit().putBoolean("protect_storage", it).apply() }
) )
Box(modifier = Modifier.padding(horizontal = 8.dp)) { Box(modifier = Modifier.offset(x = (-8).dp)) {
Information { Information {
Text(text = stringResource(R.string.auth_on_start)) Text(text = stringResource(R.string.auth_on_start))
} }
@@ -177,18 +177,18 @@ private fun About() {
val pkgInfo = context.packageManager.getPackageInfo(context.packageName,0) val pkgInfo = context.packageManager.getPackageInfo(context.packageName,0)
val verCode = pkgInfo.versionCode val verCode = pkgInfo.versionCode
val verName = pkgInfo.versionName val verName = pkgInfo.versionName
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(horizontal = 8.dp)) {
Spacer(Modifier.padding(vertical = 10.dp)) Spacer(Modifier.padding(vertical = 10.dp))
Column(modifier = Modifier.padding(horizontal = 8.dp)) {
Text(text = stringResource(R.string.about), style = typography.headlineLarge) Text(text = stringResource(R.string.about), style = typography.headlineLarge)
Spacer(Modifier.padding(vertical = 5.dp)) Spacer(Modifier.padding(vertical = 5.dp))
Text(text = stringResource(R.string.app_name)+" v$verName ($verCode)") Text(text = stringResource(R.string.app_name)+" v$verName ($verCode)")
Text(text = stringResource(R.string.about_desc)) Text(text = stringResource(R.string.about_desc))
Spacer(Modifier.padding(vertical = 5.dp)) Spacer(Modifier.padding(vertical = 5.dp))
} Column(modifier = Modifier.padding(start = 16.dp)) {
SubPageItem(R.string.user_guide, "", R.drawable.open_in_new) { shareLink(context, "https://owndroid.pages.dev") } SubPageItem(R.string.user_guide, "", R.drawable.open_in_new) { shareLink(context, "https://owndroid.pages.dev") }
SubPageItem(R.string.source_code, "", R.drawable.open_in_new) { shareLink(context, "https://github.com/BinTianqi/OwnDroid") } SubPageItem(R.string.source_code, "", R.drawable.open_in_new) { shareLink(context, "https://github.com/BinTianqi/OwnDroid") }
} }
}
} }
fun shareLink(inputContext:Context,link:String) { fun shareLink(inputContext:Context,link:String) {

View File

@@ -194,7 +194,7 @@ private fun Home(
enableSystemAppDialog: MutableState<Boolean> enableSystemAppDialog: MutableState<Boolean>
) { ) {
Column( Column(
modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()) modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(start = 30.dp, end = 12.dp)
) { ) {
val context = LocalContext.current val context = LocalContext.current
val dpm = context.getDPM() val dpm = context.getDPM()
@@ -317,23 +317,22 @@ fun AlwaysOnVPNPackage(pkgName: String) {
Toast.makeText(context, R.string.not_installed, Toast.LENGTH_SHORT).show() Toast.makeText(context, R.string.not_installed, Toast.LENGTH_SHORT).show()
} }
} }
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(horizontal = 8.dp)) {
Spacer(Modifier.padding(vertical = 10.dp)) Spacer(Modifier.padding(vertical = 10.dp))
Text(text = stringResource(R.string.always_on_vpn), style = typography.headlineLarge, modifier = Modifier.padding(8.dp)) Text(text = stringResource(R.string.always_on_vpn), style = typography.headlineLarge, modifier = Modifier.padding(vertical = 8.dp))
Spacer(Modifier.padding(vertical = 5.dp)) Text(text = stringResource(R.string.current_app_is) + pkg, modifier = Modifier.padding(vertical = 8.dp))
Text(text = stringResource(R.string.current_app_is) + pkg, modifier = Modifier.padding(8.dp))
SwitchItem(R.string.enable_lockdown, "", null, { lockdown }, { lockdown = it }) SwitchItem(R.string.enable_lockdown, "", null, { lockdown }, { lockdown = it })
Spacer(Modifier.padding(vertical = 5.dp)) Spacer(Modifier.padding(vertical = 5.dp))
Button( Button(
onClick = { setAlwaysOnVpn(pkgName, lockdown); refresh() }, onClick = { setAlwaysOnVpn(pkgName, lockdown); refresh() },
modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp) modifier = Modifier.fillMaxWidth()
) { ) {
Text(stringResource(R.string.apply)) Text(stringResource(R.string.apply))
} }
Spacer(Modifier.padding(vertical = 5.dp)) Spacer(Modifier.padding(vertical = 5.dp))
Button( Button(
onClick = { setAlwaysOnVpn(null, false); refresh() }, onClick = { setAlwaysOnVpn(null, false); refresh() },
modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp) modifier = Modifier.fillMaxWidth()
) { ) {
Text(stringResource(R.string.clear_current_config)) Text(stringResource(R.string.clear_current_config))
} }

View File

@@ -96,7 +96,7 @@ private fun Home(navCtrl: NavHostController) {
val dpm = context.getDPM() val dpm = context.getDPM()
val receiver = context.getReceiver() val receiver = context.getReceiver()
Column( Column(
modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()) modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(start = 30.dp, end = 12.dp)
) { ) {
Text( Text(
text = stringResource(R.string.work_profile), text = stringResource(R.string.work_profile),

View File

@@ -47,6 +47,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardActions
@@ -149,11 +150,11 @@ private fun Home(navCtrl:NavHostController, scrollState: ScrollState, wifiMacDia
val context = LocalContext.current val context = LocalContext.current
val dpm = context.getDPM() val dpm = context.getDPM()
val receiver = context.getReceiver() val receiver = context.getReceiver()
Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) { Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState).padding(start = 30.dp, end = 12.dp)) {
Text( Text(
text = stringResource(R.string.network), text = stringResource(R.string.network),
style = typography.headlineLarge, style = typography.headlineLarge,
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp) modifier = Modifier.padding(top = 8.dp, bottom = 5.dp).offset(x = (-8).dp)
) )
if(VERSION.SDK_INT >= 24 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) { if(VERSION.SDK_INT >= 24 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
SubPageItem(R.string.wifi_mac_addr, "", R.drawable.wifi_fill0) { wifiMacDialog.value = true } SubPageItem(R.string.wifi_mac_addr, "", R.drawable.wifi_fill0) { wifiMacDialog.value = true }
@@ -188,7 +189,7 @@ private fun Switches() {
val context = LocalContext.current val context = LocalContext.current
val dpm = context.getDPM() val dpm = context.getDPM()
val receiver = context.getReceiver() val receiver = context.getReceiver()
Column(modifier = Modifier.fillMaxSize()) { Column(modifier = Modifier.fillMaxSize().padding(start = 20.dp, end = 12.dp)) {
Spacer(Modifier.padding(vertical = 5.dp)) Spacer(Modifier.padding(vertical = 5.dp))
if(VERSION.SDK_INT >= 33 && context.isDeviceOwner) { if(VERSION.SDK_INT >= 33 && context.isDeviceOwner) {
SwitchItem( SwitchItem(

View File

@@ -125,11 +125,11 @@ fun Password(navCtrl: NavHostController) {
@Composable @Composable
private fun Home(navCtrl:NavHostController,scrollState: ScrollState) { private fun Home(navCtrl:NavHostController,scrollState: ScrollState) {
val context = LocalContext.current val context = LocalContext.current
Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) { Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState).padding(start = 30.dp, end = 12.dp)) {
Text( Text(
text = stringResource(R.string.password_and_keyguard), text = stringResource(R.string.password_and_keyguard),
style = typography.headlineLarge, style = typography.headlineLarge,
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp) modifier = Modifier.padding(top = 8.dp, bottom = 5.dp)
) )
SubPageItem(R.string.password_info, "", R.drawable.info_fill0) { navCtrl.navigate("PasswordInfo") } SubPageItem(R.string.password_info, "", R.drawable.info_fill0) { navCtrl.navigate("PasswordInfo") }
if(VERSION.SDK_INT >= 26 && (context.isDeviceOwner || context.isProfileOwner)) { if(VERSION.SDK_INT >= 26 && (context.isDeviceOwner || context.isProfileOwner)) {

View File

@@ -93,11 +93,11 @@ private fun Home(localNavCtrl:NavHostController,listScrollState:ScrollState) {
val receiver = context.getReceiver() val receiver = context.getReceiver()
val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE) val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE)
var dhizukuStatus by remember { mutableStateOf(sharedPref.getBoolean("dhizuku", false)) } var dhizukuStatus by remember { mutableStateOf(sharedPref.getBoolean("dhizuku", false)) }
Column(modifier = Modifier.fillMaxSize().verticalScroll(listScrollState)) { Column(modifier = Modifier.fillMaxSize().verticalScroll(listScrollState).padding(start = 30.dp, end = 12.dp)) {
Text( Text(
text = stringResource(R.string.permission), text = stringResource(R.string.permission),
style = typography.headlineLarge, style = typography.headlineLarge,
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp) modifier = Modifier.padding(top = 8.dp, bottom = 5.dp).offset(x = (-8).dp)
) )
if(!dpm.isDeviceOwnerApp(context.packageName)) { if(!dpm.isDeviceOwnerApp(context.packageName)) {
SwitchItem( SwitchItem(

View File

@@ -52,6 +52,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
@@ -175,11 +176,11 @@ private fun Home(navCtrl: NavHostController, scrollState: ScrollState, rebootDia
val receiver = context.getReceiver() val receiver = context.getReceiver()
val sharedPref = context.getSharedPreferences("data", Context.MODE_PRIVATE) val sharedPref = context.getSharedPreferences("data", Context.MODE_PRIVATE)
val dangerousFeatures = sharedPref.getBoolean("dangerous_features", false) val dangerousFeatures = sharedPref.getBoolean("dangerous_features", false)
Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) { Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState).padding(start = 30.dp, end = 12.dp)) {
Text( Text(
text = stringResource(R.string.system_manage), text = stringResource(R.string.system_manage),
style = typography.headlineLarge, style = typography.headlineLarge,
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp) modifier = Modifier.padding(top = 8.dp, bottom = 5.dp).offset(x = (-8).dp)
) )
if(context.isDeviceOwner || context.isProfileOwner) { if(context.isDeviceOwner || context.isProfileOwner) {
SubPageItem(R.string.options, "", R.drawable.tune_fill0) { navCtrl.navigate("Switches") } SubPageItem(R.string.options, "", R.drawable.tune_fill0) { navCtrl.navigate("Switches") }
@@ -235,7 +236,7 @@ private fun Switches() {
val context = LocalContext.current val context = LocalContext.current
val dpm = context.getDPM() val dpm = context.getDPM()
val receiver = context.getReceiver() val receiver = context.getReceiver()
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(start = 20.dp, end = 12.dp)) {
Spacer(Modifier.padding(vertical = 10.dp)) Spacer(Modifier.padding(vertical = 10.dp))
if(context.isDeviceOwner || context.isProfileOwner) { if(context.isDeviceOwner || context.isProfileOwner) {
SwitchItem(R.string.disable_cam,"", R.drawable.photo_camera_fill0, SwitchItem(R.string.disable_cam,"", R.drawable.photo_camera_fill0,

View File

@@ -106,11 +106,11 @@ fun UserManage(navCtrl: NavHostController) {
@Composable @Composable
private fun Home(navCtrl: NavHostController,scrollState: ScrollState) { private fun Home(navCtrl: NavHostController,scrollState: ScrollState) {
val context = LocalContext.current val context = LocalContext.current
Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) { Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState).padding(start = 30.dp, end = 12.dp)) {
Text( Text(
text = stringResource(R.string.user_manager), text = stringResource(R.string.user_manager),
style = typography.headlineLarge, style = typography.headlineLarge,
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp) modifier = Modifier.padding(top = 8.dp, bottom = 5.dp)
) )
SubPageItem(R.string.user_info, "", R.drawable.person_fill0) { navCtrl.navigate("UserInfo") } SubPageItem(R.string.user_info, "", R.drawable.person_fill0) { navCtrl.navigate("UserInfo") }
if(context.isDeviceOwner) { if(context.isDeviceOwner) {

View File

@@ -11,6 +11,7 @@ import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
@@ -96,16 +97,16 @@ private fun Home(navCtrl:NavHostController, scrollState: ScrollState) {
val context = LocalContext.current val context = LocalContext.current
val dpm = context.getDPM() val dpm = context.getDPM()
val receiver = context.getReceiver() val receiver = context.getReceiver()
Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) { Column(modifier = Modifier.fillMaxSize().verticalScroll(scrollState).padding(start = 30.dp, end = 12.dp)) {
Text( Text(
text = stringResource(R.string.user_restrict), text = stringResource(R.string.user_restrict),
style = typography.headlineLarge, style = typography.headlineLarge,
modifier = Modifier.padding(top = 8.dp, bottom = 7.dp, start = 15.dp) modifier = Modifier.padding(top = 8.dp, bottom = 7.dp).offset(x = (-8).dp)
) )
Text(text = stringResource(R.string.switch_to_disable_feature), modifier = Modifier.padding(start = 15.dp)) Text(text = stringResource(R.string.switch_to_disable_feature), modifier = Modifier.offset(x = (-6).dp))
if(context.isProfileOwner) { Text(text = stringResource(R.string.profile_owner_is_restricted), modifier = Modifier.padding(start = 15.dp)) } if(context.isProfileOwner) { Text(text = stringResource(R.string.profile_owner_is_restricted), modifier = Modifier.offset(x = (-6).dp)) }
if(context.isProfileOwner && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) { if(context.isProfileOwner && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) {
Text(text = stringResource(R.string.some_features_invalid_in_work_profile), modifier = Modifier.padding(start = 15.dp)) Text(text = stringResource(R.string.some_features_invalid_in_work_profile), modifier = Modifier.offset(x = (-6).dp))
} }
Spacer(Modifier.padding(vertical = 2.dp)) Spacer(Modifier.padding(vertical = 2.dp))
SubPageItem(R.string.network_internet, "", R.drawable.wifi_fill0) { navCtrl.navigate("Internet") } SubPageItem(R.string.network_internet, "", R.drawable.wifi_fill0) { navCtrl.navigate("Internet") }

View File

@@ -38,7 +38,6 @@ fun SubPageItem(
modifier = Modifier.fillMaxWidth().clickable(onClick = operation).padding(vertical = 15.dp), modifier = Modifier.fillMaxWidth().clickable(onClick = operation).padding(vertical = 15.dp),
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
) { ) {
Spacer(Modifier.padding(start = 30.dp))
if(icon!=null) { if(icon!=null) {
Icon(painter = painterResource(icon), contentDescription = stringResource(title), modifier = Modifier.padding(top = 1.dp)) Icon(painter = painterResource(icon), contentDescription = stringResource(title), modifier = Modifier.padding(top = 1.dp))
Spacer(Modifier.padding(start = 15.dp)) Spacer(Modifier.padding(start = 15.dp))
@@ -125,8 +124,7 @@ fun SwitchItem(
enable: Boolean = true, enable: Boolean = true,
onClickBlank: (() -> Unit)? = null onClickBlank: (() -> Unit)? = null
) { ) {
var checked by remember { mutableStateOf(false) } var checked by remember { mutableStateOf(getState()) }
checked = getState()
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
@@ -137,8 +135,7 @@ fun SwitchItem(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.align(Alignment.CenterStart) modifier = Modifier.align(Alignment.CenterStart)
) { ) {
Spacer(Modifier.padding(start = 30.dp)) if(icon != null) {
if(icon!=null) {
Icon(painter = painterResource(icon),contentDescription = null) Icon(painter = painterResource(icon),contentDescription = null)
Spacer(Modifier.padding(start = 15.dp)) Spacer(Modifier.padding(start = 15.dp))
} }
@@ -151,8 +148,8 @@ fun SwitchItem(
} }
} }
Switch( Switch(
checked = checked, onCheckedChange = {onCheckedChange(it);checked=getState() }, checked = checked, onCheckedChange = { onCheckedChange(it); checked = getState() },
modifier = Modifier.align(Alignment.CenterEnd).padding(end = 12.dp), enabled = enable modifier = Modifier.align(Alignment.CenterEnd), enabled = enable
) )
} }
} }