@@ -8,13 +8,14 @@ package com.nextcloud.talk.profile
88
99import android.content.res.Configuration
1010import androidx.compose.foundation.isSystemInDarkTheme
11+ import androidx.compose.foundation.clickable
12+ import androidx.compose.foundation.layout.Box
1113import androidx.compose.foundation.layout.Row
1214import androidx.compose.foundation.layout.Spacer
1315import androidx.compose.foundation.layout.fillMaxWidth
1416import androidx.compose.foundation.layout.padding
1517import androidx.compose.foundation.layout.size
1618import androidx.compose.foundation.layout.width
17- import androidx.compose.material3.Card
1819import androidx.compose.material3.Icon
1920import androidx.compose.material3.MaterialTheme
2021import androidx.compose.material3.Surface
@@ -34,45 +35,41 @@ import com.nextcloud.talk.R
3435
3536@Composable
3637fun ProfileEnabledCard (isEnabled : Boolean , onCheckedChange : (Boolean ) -> Unit , modifier : Modifier = Modifier ) {
37- Row (
38- modifier = modifier.fillMaxWidth(),
39- verticalAlignment = Alignment .CenterVertically
38+ Box (
39+ modifier = Modifier
40+ .padding(top = 8 .dp, bottom = 8 .dp, start = 16 .dp, end = 14 .dp)
41+ .clickable { onCheckedChange(! isEnabled) }
4042 ) {
41- Icon (
42- painter = painterResource(R .drawable.ic_id_card_24px),
43- contentDescription = null ,
44- modifier = Modifier .size(24 .dp),
45- tint = MaterialTheme .colorScheme.primary
46- )
47- Spacer (modifier = Modifier .width(16 .dp))
48- Card (modifier = Modifier .weight(1f ), onClick = { onCheckedChange(! isEnabled) }) {
49- Row (
50- modifier = Modifier
51- .fillMaxWidth()
52- .padding(horizontal = 16 .dp, vertical = 12 .dp),
53- verticalAlignment = Alignment .CenterVertically
54- ) {
55- Text (
56- text = stringResource(
57- if (isEnabled) {
58- R .string.user_info_profile_disable
59- } else {
60- R .string.user_info_profile_enable
61- }
62- ),
63- style = MaterialTheme .typography.titleMedium,
64- maxLines = 2 ,
65- overflow = TextOverflow .Ellipsis ,
66- modifier = Modifier .weight(1f )
67- )
68- Spacer (modifier = Modifier .width(16 .dp))
69- Switch (
70- checked = isEnabled,
71- onCheckedChange = onCheckedChange
72- )
73- }
43+ Row (
44+ modifier = Modifier .fillMaxWidth(),
45+ verticalAlignment = Alignment .CenterVertically
46+ ) {
47+ Icon (
48+ painter = painterResource(R .drawable.ic_id_card_24px),
49+ contentDescription = null ,
50+ modifier = Modifier .size(24 .dp),
51+ tint = MaterialTheme .colorScheme.primary
52+ )
53+ Spacer (modifier = Modifier .width(32 .dp))
54+ Text (
55+ text = stringResource(
56+ if (isEnabled) {
57+ R .string.user_info_profile_disable
58+ } else {
59+ R .string.user_info_profile_enable
60+ }
61+ ),
62+ style = MaterialTheme .typography.bodyLarge,
63+ maxLines = 2 ,
64+ overflow = TextOverflow .Ellipsis ,
65+ modifier = Modifier .weight(1f )
66+ )
67+ Spacer (modifier = Modifier .width(16 .dp))
68+ Switch (
69+ checked = isEnabled,
70+ onCheckedChange = onCheckedChange
71+ )
7472 }
75- Spacer (modifier = Modifier .width(32 .dp))
7673 }
7774}
7875
0 commit comments