update LanguageChip icon, enable default shuffling in ExerciseConfig, and refine onClose navigation in VocabularyExerciseHostScreen

This commit is contained in:
jonasgaudian
2026-02-17 13:30:03 +01:00
parent d249da5f52
commit a0b6509367
3 changed files with 10 additions and 4 deletions

View File

@@ -406,7 +406,7 @@ fun LanguagePairSection(
availablePairs.forEach { pair ->
val isSelected = selectedPairs.contains(pair)
LanguageChip(
text = "${pair.first.name} ${pair.second.name}",
text = "${pair.first.name} ${pair.second.name}",
isSelected = isSelected,
modifier = Modifier.widthIn(min = 160.dp),
onClick = {

View File

@@ -30,6 +30,7 @@ import eu.gaudian.translator.R
import eu.gaudian.translator.utils.Log
import eu.gaudian.translator.utils.findActivity
import eu.gaudian.translator.view.composable.AppAlertDialog
import eu.gaudian.translator.view.composable.Screen
import eu.gaudian.translator.viewmodel.ScreenState
import eu.gaudian.translator.viewmodel.VocabularyExerciseViewModel
import eu.gaudian.translator.viewmodel.VocabularyViewModel
@@ -148,7 +149,12 @@ fun VocabularyExerciseHostScreen(
onRetryWrong = { _ ->
exerciseViewModel.retryWrongAnswers(originalItems)
},
onClose = onClose
onClose = {
navController.navigate(Screen.Home.route) {
popUpTo(Screen.Home.route) { inclusive = true }
launchSingleTop = true
}
}
)
}
}

View File

@@ -31,8 +31,8 @@ enum class ScreenState {
}
data class ExerciseConfig(
val shuffleCards: Boolean = false,
val shuffleLanguages: Boolean = false,
val shuffleCards: Boolean = true,
val shuffleLanguages: Boolean = true,
val trainingMode: Boolean = false,
val dueTodayOnly: Boolean = false,
val selectedExerciseTypes: Set<VocabularyExerciseType> = setOf(VocabularyExerciseType.GUESSING),