Skip to content

Commit bf14fa6

Browse files
author
Daniel García
committed
[Added] rows of algorithms
1 parent 1cab7b5 commit bf14fa6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/src/main/java/com/tripletres/platformscience/ui/view/settings/SimpleSettingsView.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import androidx.compose.ui.res.stringResource
1414
import androidx.compose.ui.unit.dp
1515
import androidx.hilt.navigation.compose.hiltViewModel
1616
import com.tripletres.platformscience.R
17+
import com.tripletres.platformscience.util.SimpleSettingsUtil.Companion.ALGORITHM_BRANCH_BOUND
18+
import com.tripletres.platformscience.util.SimpleSettingsUtil.Companion.ALGORITHM_GREEDY
1719

1820
/**
1921
* Simple settings view
@@ -37,15 +39,16 @@ fun SimpleSettingsView(modifier: Modifier? = Modifier) {
3739
style = MaterialTheme.typography.caption,
3840
modifier = Modifier.padding(top = 8.dp)
3941
)
40-
Row(verticalAlignment = Alignment.CenterVertically) {
41-
uiState.value.algorithms.forEach { algorithm ->
42+
uiState.value.algorithms.forEach { algorithm ->
43+
Row(verticalAlignment = Alignment.CenterVertically) {
4244
RadioButton(selected = algorithm == uiState.value.algorithmSelected, onClick = {
4345
viewModel.updateAlgorithmSelected(algorithm)
4446
})
4547
Text(
4648
text = stringResource(
4749
id = when (algorithm) {
48-
50+
ALGORITHM_GREEDY -> R.string.algorithm_greedy
51+
ALGORITHM_BRANCH_BOUND -> R.string.algorithm_branch_and_bound
4952
else -> R.string.algorithm_greedy
5053
}))
5154
}

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
//Algorithms
2121
<string name="algorithm">Algorithm:</string>
2222
<string name="algorithm_greedy">Greedy</string>
23+
<string name="algorithm_branch_and_bound">Branch and bound</string>
2324

2425
//Common
2526
<string name="ok">OK</string>

0 commit comments

Comments
 (0)