@@ -19,6 +19,7 @@ import androidx.compose.material3.ButtonDefaults
1919import androidx.compose.material3.Card
2020import androidx.compose.material3.CardDefaults
2121import androidx.compose.material3.Divider
22+ import androidx.compose.material3.HorizontalDivider
2223import androidx.compose.material3.MaterialTheme
2324import androidx.compose.material3.RadioButton
2425import androidx.compose.material3.Switch
@@ -41,7 +42,6 @@ fun MainScreen(
4142 onFeatureSwitchChange : (Feature , Boolean ) -> Unit ,
4243 onApplyConfiguration : () -> Unit ,
4344 onSelectSim : (SimSelection ) -> Unit ,
44- onToggleLanguage : () -> Unit ,
4545 openSimSelectionDialog : () -> Unit ,
4646 dismissSimSelectionDialog : () -> Unit ,
4747 dismissConfigAppliedDialog : () -> Unit ,
@@ -54,7 +54,7 @@ fun MainScreen(
5454 .background(Color (0xFFF5F5F5 ))
5555 .verticalScroll(rememberScrollState())
5656 ) {
57- Header (onToggleLanguage )
57+ Header ()
5858 SystemInfoCard (uiState, onRequestShizukuPermission)
5959 SimCardSelectionCard (uiState, openSimSelectionDialog)
6060 FeaturesCard (uiState, onFeatureSwitchChange)
@@ -76,14 +76,14 @@ fun MainScreen(
7676}
7777
7878@Composable
79- fun Header (onToggleLanguage : () -> Unit ) {
79+ fun Header () {
8080 Row (
8181 modifier = Modifier
8282 .fillMaxWidth()
8383 .background(Color (0xFF1A73E8 ))
8484 .padding(24 .dp),
8585 verticalAlignment = Alignment .CenterVertically ,
86- horizontalArrangement = Arrangement .Space - Between
86+ horizontalArrangement = Arrangement .SpaceBetween
8787 ) {
8888 Column (horizontalAlignment = Alignment .CenterHorizontally , modifier = Modifier .weight(1f )) {
8989 Text (" ⚡ Turbo IMS" , fontSize = 28 .sp, fontWeight = FontWeight .Bold , color = Color .White )
@@ -94,9 +94,6 @@ fun Header(onToggleLanguage: () -> Unit) {
9494 fontFamily = FontFamily .Monospace
9595 )
9696 }
97- TextButton (onClick = onToggleLanguage) {
98- Text (stringResource(id = R .string.switch_language), color = Color .White , fontSize = 12 .sp)
99- }
10097 }
10198}
10299
@@ -198,7 +195,6 @@ fun SimCardSelectionCard(uiState: MainUiState, openSimSelectionDialog: () -> Uni
198195
199196@Composable
200197fun FeaturesCard (uiState : MainUiState , onFeatureSwitchChange : (Feature , Boolean ) -> Unit ) {
201- val context = LocalContext .current
202198 Card (
203199 modifier = Modifier .padding(16 .dp),
204200 colors = CardDefaults .cardColors(containerColor = Color .White ),
@@ -213,7 +209,7 @@ fun FeaturesCard(uiState: MainUiState, onFeatureSwitchChange: (Feature, Boolean)
213209 )
214210 Spacer (modifier = Modifier .height(16 .dp))
215211
216- Feature .values() .forEachIndexed { index, feature ->
212+ Feature .entries .forEachIndexed { index, feature ->
217213 val featureName = when (feature) {
218214 Feature .VOLTE -> R .string.volte
219215 Feature .VOWIFI -> R .string.vowifi
@@ -238,8 +234,8 @@ fun FeaturesCard(uiState: MainUiState, onFeatureSwitchChange: (Feature, Boolean)
238234 checked = uiState.featureSwitches[feature] ? : true ,
239235 onCheckedChange = { onFeatureSwitchChange(feature, it) }
240236 )
241- if (index < Feature .values() .size - 1 ) {
242- Divider (color = Color . LightGray , thickness = 0.5 .dp )
237+ if (index < Feature .entries .size - 1 ) {
238+ HorizontalDivider (thickness = 0.5 .dp, color = Color . LightGray )
243239 }
244240 }
245241 }
0 commit comments