update LanguageChip icon, enable default shuffling in ExerciseConfig, and refine onClose navigation in VocabularyExerciseHostScreen
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user