diff --git a/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt b/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt index 06d784d6..94a999c0 100644 --- a/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt +++ b/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt @@ -129,6 +129,7 @@ fun ExpandableCard( text = title, fontSize = titleFontSize, fontWeight = titleFontWeight, + fontFamily = titleFontFamily, maxLines = 1, overflow = TextOverflow.Ellipsis ) diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/input/InputViewModel.kt b/app/src/main/java/com/starry/greenstash/ui/screens/input/InputViewModel.kt index 4148ca0d..c184f0db 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/input/InputViewModel.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/input/InputViewModel.kt @@ -184,6 +184,8 @@ class InputViewModel @Inject constructor( PreferenceUtil.DATE_FORMAT_STR, DateStyle.DateMonthYear.pattern ) + // Icon picker ============== + fun updateIconSearch(context: Context, search: String) { _iconState.value = _iconState.value.copy(searchText = search) iconSearchJob?.cancel() @@ -232,9 +234,21 @@ class InputViewModel @Inject constructor( return lines } + // Onboarding ============== + fun onboardingTapTargetsShown() { preferenceUtil.putBoolean(PreferenceUtil.INPUT_SCREEN_ONBOARDING_BOOL, false) _showOnboardingTapTargets.value = false } + fun shouldShowRemoveDeadlineTip(): Boolean { + return state.deadline.isNotBlank() && preferenceUtil.getBoolean( + PreferenceUtil.INPUT_REMOVE_DEADLINE_TIP_BOOL, true + ) + } + + fun removeDeadlineTipShown() { + preferenceUtil.putBoolean(PreferenceUtil.INPUT_REMOVE_DEADLINE_TIP_BOOL, false) + } + } \ No newline at end of file diff --git a/app/src/main/java/com/starry/greenstash/ui/screens/input/composables/InputScreen.kt b/app/src/main/java/com/starry/greenstash/ui/screens/input/composables/InputScreen.kt index e315541e..af82c463 100644 --- a/app/src/main/java/com/starry/greenstash/ui/screens/input/composables/InputScreen.kt +++ b/app/src/main/java/com/starry/greenstash/ui/screens/input/composables/InputScreen.kt @@ -26,6 +26,7 @@ package com.starry.greenstash.ui.screens.input.composables import android.Manifest +import android.annotation.SuppressLint import android.content.Context import android.content.Intent import android.net.Uri @@ -236,7 +237,7 @@ fun InputScreen(editGoalId: String?, navController: NavController) { showRemoveDeadlineDialog.value = false }, title = { Text( - text = stringResource(id = R.string.goal_remove_deadline), + text = stringResource(id = R.string.input_goal_remove_deadline), color = MaterialTheme.colorScheme.onSurface, fontFamily = greenstashFont ) @@ -303,6 +304,20 @@ fun InputScreen(editGoalId: String?, navController: NavController) { scrollState.scrollTo(scrollState.maxValue) } + // Show onboarding tip for removing deadline. + LaunchedEffect(key1 = viewModel.state.deadline) { + if (editGoalId != null && viewModel.shouldShowRemoveDeadlineTip()) { + val snackResult = snackBarHostState.showSnackbar( + message = context.getString(R.string.input_remove_deadline_tip), + actionLabel = context.getString(R.string.ok) + ) + if (snackResult == SnackbarResult.ActionPerformed) { + viewModel.removeDeadlineTipShown() + } + + } + } + Column( modifier = Modifier .fillMaxSize() @@ -457,7 +472,8 @@ fun InputScreen(editGoalId: String?, navController: NavController) { private fun GoalImagePicker( goalImage: Any?, photoPicker: ActivityResultLauncher, - fabModifier: Modifier // To be used for onboarding tap target. + // To be used for onboarding tap target. + @SuppressLint("ModifierParameter") fabModifier: Modifier ) { val context = LocalContext.current Box( @@ -733,7 +749,7 @@ private fun InputTextFields( showRemoveDeadlineDialog: MutableState ) { val haptic = LocalHapticFeedback.current - val textFeildSpacing = 8.dp + val textFieldSpacing = 8.dp OutlinedTextField( value = viewModel.state.goalTitleText, @@ -762,7 +778,7 @@ private fun InputTextFields( keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), ) - Spacer(modifier = Modifier.height(textFeildSpacing)) + Spacer(modifier = Modifier.height(textFieldSpacing)) OutlinedTextField( value = viewModel.state.targetAmount, @@ -796,7 +812,7 @@ private fun InputTextFields( keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), ) - Spacer(modifier = Modifier.height(textFeildSpacing)) + Spacer(modifier = Modifier.height(textFieldSpacing)) val interactionSource = remember { MutableInteractionSource() } @@ -846,7 +862,7 @@ private fun InputTextFields( keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), ) - Spacer(modifier = Modifier.height(textFeildSpacing)) + Spacer(modifier = Modifier.height(textFieldSpacing)) OutlinedTextField( value = viewModel.state.additionalNotes, @@ -899,9 +915,9 @@ private fun GoalAddedOREditedAnimation(editGoalId: String?) { modifier = Modifier.size(320.dp) ) val textStr = if (editGoalId == null) { - stringResource(id = R.string.goal_saved_success) + stringResource(id = R.string.input_goal_saved_success) } else { - stringResource(id = R.string.goad_edit_success) + stringResource(id = R.string.input_goad_edit_success) } Text( text = textStr, diff --git a/app/src/main/java/com/starry/greenstash/utils/PreferenceUtil.kt b/app/src/main/java/com/starry/greenstash/utils/PreferenceUtil.kt index c5dce0b8..42e54c39 100644 --- a/app/src/main/java/com/starry/greenstash/utils/PreferenceUtil.kt +++ b/app/src/main/java/com/starry/greenstash/utils/PreferenceUtil.kt @@ -49,6 +49,7 @@ class PreferenceUtil(context: Context) { // Onboarding preferences const val HOME_SCREEN_ONBOARDING_BOOL = "show_home_screen_onboarding" const val INPUT_SCREEN_ONBOARDING_BOOL = "show_input_onboarding" + const val INPUT_REMOVE_DEADLINE_TIP_BOOL = "show_input_remove_deadline_tip" const val INFO_TRANSACTION_SWIPE_TIP_BOOL = "show_info_transaction_swipe_tip" } diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ec64c6ea..ef240249 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -125,9 +125,10 @@ Notas (Opcional) Agregar Nueva Meta Actualizar Meta - ¡Buen trabajo! Meta agregada. - Meta actualizada. - ¿Quieres quitar la fecha límite de este objetivo? + ¡Buen trabajo! Meta agregada. + Meta actualizada. + ¿Quieres quitar la fecha límite de este objetivo? + Consejo: Puedes eliminar la fecha límite de los objetivos existentes manteniendo pulsado el campo de fecha límite. Respaldar y recuperar datos diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index eafb0885..f518c071 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -103,6 +103,7 @@ İşlemi Güncelle İpucu: İşlemleri düzenlemek veya silmek için sola veya sağa kaydırın. + Birikim yapma zamanı! Birikim Hedefini Düzenle @@ -126,9 +127,10 @@ Notlar (Opsiyonel) Yeni Birikim Hedefi Belirle Birikim Hedefini Güncelle - Harika iş! Birikim hedefi belirlendi. - Birikim hedefi güncellendi. - Bu hedeften son tarihi kaldırmak istiyor musun? + Harika iş! Birikim hedefi belirlendi. + Birikim hedefi güncellendi. + Bu hedeften son tarihi kaldırmak istiyor musun? + İpucu: Var olan hedeflerden birinin son tarihini kaldırmak için son tarih alanında uzun basılı tutabilirsiniz. Yedekle & Geri yükle diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 2da5b2dd..46821fb2 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -126,9 +126,10 @@ 备注(可选) 设置新的省钱目标 更新省钱目标 - 干得漂亮!省钱目标已经设置。 - 省钱目标已经更新 - 想要删除此目标的截止日期吗? + 干得漂亮!省钱目标已经设置。 + 省钱目标已经更新 + 想要删除此目标的截止日期吗? + 提示:您可以长按截止日期字段来删除现有目标的截止日期。 备份与恢复 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 66bb03d0..58129e2e 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -126,9 +126,10 @@ 筆記(選填) 設定新的儲蓄目標 更新儲蓄目標 - 做得好!已設定儲蓄目標。 - 儲蓄目標已更新。 - 您是否要從此目標中移除期限? + 做得好!已設定儲蓄目標。 + 儲蓄目標已更新。 + 您是否要從此目標中移除期限? + 提示:您可以長按截止日期欄位來移除現有目標的截止日期。 備份與還原 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 15f81e95..32ffad8a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -126,9 +126,10 @@ Notes (Optional) Set New Saving Goal Update Saving Goal - Great job! Saving goal set. - Saving goal updated. - Do you want to remove deadline from this goal? + Great job! Saving goal set. + Saving goal updated. + Do you want to remove deadline from this goal? + Tip: You can remove the deadline from existing goals by long-pressing on the deadline field. Backup & Restore