Skip to content

Commit

Permalink
fix: sửa lại âm thanh khi học
Browse files Browse the repository at this point in the history
- sửa lại fontWeight và fontSize của flipcard màn study set detail
- sửa lại giao diện màn finish
- sửa lại link services và policy
  • Loading branch information
nqmgaming committed Dec 21, 2024
1 parent 1c12a9d commit 37ec9cf
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 40 deletions.
6 changes: 0 additions & 6 deletions .buddy/build-apk.fixed.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fun StandardScaffold(
var showStreakBottomSheet by remember {
mutableStateOf(false)
}
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.fire_streak))
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.lottie_fire_streak))
val progress by animateLottieCompositionAsState(
composition = composition,
iterations = LottieConstants.IterateForever,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fun SettingsScreen(
onNavigateToPrivacyPolicy = {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://pass-with-high-score.github.io/QuickMem-Services/")
Uri.parse("https://pass-with-high-score.github.io/quickmem-term-policy/policy")
)
try {
context.startActivity(intent)
Expand All @@ -284,7 +284,7 @@ fun SettingsScreen(
onNavigateToTermsOfService = {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://pass-with-high-score.github.io/QuickMem-Services/")
Uri.parse("https://pass-with-high-score.github.io/quickmem-term-policy/services")
)
try {
context.startActivity(intent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ fun StudySetFlipCard(
Text(
text = frontText,
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
fontSize = backTextSize,
fontWeight = when {
frontText.length <= 50 -> FontWeight.Bold
else -> FontWeight.Normal
},
fontSize = frontTextSize,
color = colorScheme.onBackground,
textAlign = TextAlign.Center,
),
Expand All @@ -140,9 +143,12 @@ fun StudySetFlipCard(
Text(
text = backText,
style = MaterialTheme.typography.bodyMedium.copy(
fontSize = frontTextSize,
fontSize = backTextSize,
color = colorScheme.onBackground,
fontWeight = FontWeight.Normal,
fontWeight = when {
backText.length <= 50 -> FontWeight.Bold
else -> FontWeight.Normal
},
textAlign = when {
backImage != null -> TextAlign.Start
else -> TextAlign.Center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class FlipFlashCardViewModel @Inject constructor(
private fun playCompleteSound() {
val isPlaySound = _uiState.value.isPlaySound
if (isPlaySound) {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.study_complete)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_study_complete)
mediaPlayer.start()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@ fun FlipFlashCardFinish(
onRestartClicked: () -> Unit,
isGetAll: Boolean
) {
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.confetti))
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.lottie_firework))
val progress by animateLottieCompositionAsState(
composition = composition,
isPlaying = isEndOfList,
)
Box(
modifier = modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
LottieAnimation(
composition = composition,
Expand All @@ -85,7 +84,9 @@ fun FlipFlashCardFinish(
fontWeight = FontWeight.Bold
),
textAlign = TextAlign.Center,
modifier = Modifier.padding(16.dp)
modifier = Modifier
.padding(16.dp)
.padding(top = 32.dp)
)
}
item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,18 @@ class LearnByQuizViewModel @Inject constructor(
private fun playCompleteSound() {
val isPlaySound = _uiState.value.isPlaySound
if (isPlaySound) {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.finish)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_study_complete)
mediaPlayer.start()
}
}

private fun playCorrectSound() {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.correct)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_correct)
mediaPlayer.start()
}

private fun playIncorrectSound() {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.wrong)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_wrong)
mediaPlayer.start()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fun QuizFlashCardFinish(
onRestartClicked: () -> Unit,
isGetAll: Boolean
) {
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.confetti))
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.lottie_firework))
val progress by animateLottieCompositionAsState(
composition = composition,
isPlaying = isEndOfList,
Expand All @@ -85,7 +85,6 @@ fun QuizFlashCardFinish(
var definitionImageUri by remember { mutableStateOf("") }
Box(
modifier = modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
LottieAnimation(
composition = composition,
Expand All @@ -107,7 +106,9 @@ fun QuizFlashCardFinish(
style = MaterialTheme.typography.titleLarge.copy(
fontWeight = FontWeight.Bold
),
modifier = Modifier.padding(16.dp)
modifier = Modifier
.padding(16.dp)
.padding(top = 32.dp)
)
StudySetDonutChart(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,18 +455,18 @@ class LearnByTrueFalseViewModel @Inject constructor(
private fun playCompleteSound() {
val isPlaySound = _uiState.value.isPlaySound
if (isPlaySound) {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.finish)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_study_complete)
mediaPlayer.start()
}
}

private fun playCorrectSound() {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.correct)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_correct)
mediaPlayer.start()
}

private fun playIncorrectSound() {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.wrong)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_wrong)
mediaPlayer.start()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fun TrueFalseFlashcardFinish(
onRestartClicked: () -> Unit,
isGetAll: Boolean
) {
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.confetti))
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.lottie_firework))
val progress by animateLottieCompositionAsState(
composition = composition,
isPlaying = isEndOfList,
Expand All @@ -85,7 +85,6 @@ fun TrueFalseFlashcardFinish(
var definitionImageUri by remember { mutableStateOf("") }
Box(
modifier = modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
LottieAnimation(
composition = composition,
Expand All @@ -108,6 +107,7 @@ fun TrueFalseFlashcardFinish(
fontWeight = FontWeight.Bold
),
modifier = Modifier.padding(16.dp)
.padding(top = 32.dp)
)
StudySetDonutChart(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,18 @@ class LearnByWriteViewModel @Inject constructor(
private fun playCompleteSound() {
val isPlaySound = _uiState.value.isPlaySound
if (isPlaySound) {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.finish)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_study_complete)
mediaPlayer.start()
}
}

private fun playCorrectSound() {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.correct)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_correct)
mediaPlayer.start()
}

private fun playIncorrectSound() {
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.wrong)
val mediaPlayer = MediaPlayer.create(getApplication(), R.raw.audio_wrong)
mediaPlayer.start()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fun WriteFlashcardFinish(
onRestartClicked: () -> Unit,
isGetAll: Boolean
) {
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.confetti))
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.lottie_firework))
val progress by animateLottieCompositionAsState(
composition = composition,
isPlaying = isEndOfList,
Expand All @@ -85,7 +85,6 @@ fun WriteFlashcardFinish(
var definitionImageUri by remember { mutableStateOf("") }
Box(
modifier = modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
LottieAnimation(
composition = composition,
Expand All @@ -107,7 +106,9 @@ fun WriteFlashcardFinish(
style = MaterialTheme.typography.titleLarge.copy(
fontWeight = FontWeight.Bold
),
modifier = Modifier.padding(16.dp)
modifier = Modifier
.padding(16.dp)
.padding(top = 32.dp)
)
StudySetDonutChart(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,9 @@ fun SignupScreen(
onPrivacyPolicyClick = {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://pass-with-high-score.github.io/QuickMem-Services/")
Uri.parse("https://pass-with-high-score.github.io/quickmem-term-policy/policy")
)
try {
context.startActivity(intent)
} catch (e: Exception) {
e.stackTrace
}
context.startActivity(intent)
}
)
}
Expand Down
Binary file added app/src/main/res/raw/audio_correct.mp3
Binary file not shown.
File renamed without changes.
Binary file added app/src/main/res/raw/audio_wrong.mp3
Binary file not shown.
Binary file removed app/src/main/res/raw/correct.ogg
Binary file not shown.
Binary file removed app/src/main/res/raw/finish.ogg
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file removed app/src/main/res/raw/wrong.ogg
Binary file not shown.

0 comments on commit 37ec9cf

Please sign in to comment.