diff --git a/src/MobileApp.vue b/src/MobileApp.vue index ac4a3135..1bbea493 100644 --- a/src/MobileApp.vue +++ b/src/MobileApp.vue @@ -23,7 +23,7 @@ import { useExchangeRatesStore } from '@/stores/exchangeRates.ts'; import { APPLICATION_LOGO_PATH } from '@/consts/asset.ts'; import { ThemeType } from '@/core/theme.ts'; import { isProduction } from '@/lib/version.ts'; -import { getTheme, isEnableAnimate } from '@/lib/settings.ts'; +import { getTheme, isEnableSwipeBack, isEnableAnimate } from '@/lib/settings.ts'; import { initMapProvider } from '@/lib/map/index.ts'; import { isUserLogined, isUserUnlocked } from '@/lib/userstate.ts'; import { setExpenseAndIncomeAmountColor } from '@/lib/ui/common.ts'; @@ -98,7 +98,9 @@ const f7params = ref({ browserHistory: !isiOSHomeScreenMode(), browserHistoryInitialMatch: true, browserHistoryAnimate: false, + iosSwipeBack: isEnableSwipeBack(), iosSwipeBackAnimateShadow: false, + mdSwipeBack: isEnableSwipeBack(), mdSwipeBackAnimateShadow: false } }); diff --git a/src/core/setting.ts b/src/core/setting.ts index d3969f1f..8012bd49 100644 --- a/src/core/setting.ts +++ b/src/core/setting.ts @@ -28,6 +28,7 @@ export interface ApplicationSettings extends BaseApplicationSetting { timeZone: string; autoUpdateExchangeRatesData: boolean; showAccountBalance: boolean; + swipeBack: boolean; animate: boolean; // Application Lock applicationLock: boolean; @@ -132,6 +133,7 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = { timeZone: '', autoUpdateExchangeRatesData: true, showAccountBalance: true, + swipeBack: true, animate: true, // Application Lock applicationLock: false, diff --git a/src/lib/settings.ts b/src/lib/settings.ts index c9514701..7d23cdfd 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -93,6 +93,10 @@ export function isEnableApplicationLock(): boolean { return getApplicationSettings().applicationLock; } +export function isEnableSwipeBack(): boolean { + return getApplicationSettings().swipeBack; +} + export function isEnableAnimate(): boolean { return getApplicationSettings().animate; } diff --git a/src/locales/de.json b/src/locales/de.json index e1650de3..4da60c7a 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Wechselkursdatenseite", "Exchange Rate": "Wechselkurs", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Animation aktivieren", "Basic Information": "Grundlegende Informationen", "User Information": "Benutzerinformationen", diff --git a/src/locales/en.json b/src/locales/en.json index f0fc0515..e5598911 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Exchange Rates Data Page", "Exchange Rate": "Exchange Rate", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Enable Animation", "Basic Information": "Basic Information", "User Information": "User Information", diff --git a/src/locales/es.json b/src/locales/es.json index 831c131e..732ae0e4 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Página de datos de tipos de cambio", "Exchange Rate": "Tipo de cambio", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Habilitar animación", "Basic Information": "Información básica", "User Information": "Información del usuario", diff --git a/src/locales/it.json b/src/locales/it.json index 3e01c052..eee224d6 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Pagina dati tassi di cambio", "Exchange Rate": "Tasso di cambio", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Abilita animazione", "Basic Information": "Informazioni di base", "User Information": "Informazioni utente", diff --git a/src/locales/ja.json b/src/locales/ja.json index 6718a4c3..2548ff65 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "為替レートデータページ", "Exchange Rate": "為替レート", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "アニメーションの有効", "Basic Information": "基本情報", "User Information": "ユーザー情報", diff --git a/src/locales/nl.json b/src/locales/nl.json index 83084069..f303a99e 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Rekeningen opgenomen in totaal", "Exchange Rates Data Page": "Wisselkoersgegevenspagina", "Exchange Rate": "Wisselkoers", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Animatie inschakelen", "Basic Information": "Basisinformatie", "User Information": "Gebruikersinformatie", diff --git a/src/locales/pt_BR.json b/src/locales/pt_BR.json index 780fb2b5..587fd5ac 100644 --- a/src/locales/pt_BR.json +++ b/src/locales/pt_BR.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Página de Dados de Taxas de Câmbio", "Exchange Rate": "Taxa de Câmbio", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Habilitar Animação", "Basic Information": "Informações Básicas", "User Information": "Informações do Usuário", diff --git a/src/locales/ru.json b/src/locales/ru.json index 7c3ceb1c..0c6d6e34 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Страница данных о курсах валют", "Exchange Rate": "Курс обмена", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Включить анимацию", "Basic Information": "Основная информация", "User Information": "Информация о пользователе", diff --git a/src/locales/uk.json b/src/locales/uk.json index ae03017b..6501ae44 100644 --- a/src/locales/uk.json +++ b/src/locales/uk.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Сторінка курсів валют", "Exchange Rate": "Курс обміну", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Увімкнути анімацію", "Basic Information": "Основна інформація", "User Information": "Інформація про користувача", diff --git a/src/locales/vi.json b/src/locales/vi.json index 3a92a45d..f22e49a2 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "Accounts Included in Total", "Exchange Rates Data Page": "Trang dữ liệu tỷ giá hối đoái", "Exchange Rate": "Tỷ giá hối đoái", + "Enable Swipe Back": "Enable Swipe Back", "Enable Animation": "Bật hoạt ảnh", "Basic Information": "Thông tin cơ bản", "User Information": "Thông tin người dùng", diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 38d5a35b..a1cfa150 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "计入总金额的账户", "Exchange Rates Data Page": "汇率数据页面", "Exchange Rate": "汇率", + "Enable Swipe Back": "启用侧滑返回", "Enable Animation": "启用动画", "Basic Information": "基本信息", "User Information": "用户信息", diff --git a/src/locales/zh_Hant.json b/src/locales/zh_Hant.json index 9023d0f6..7eb66c95 100644 --- a/src/locales/zh_Hant.json +++ b/src/locales/zh_Hant.json @@ -2019,6 +2019,7 @@ "Accounts Included in Total": "計入總金額的帳戶", "Exchange Rates Data Page": "匯率資料頁面", "Exchange Rate": "匯率", + "Enable Swipe Back": "啟用滑動返回", "Enable Animation": "啟用動畫", "Basic Information": "基本資訊", "User Information": "使用者資訊", diff --git a/src/stores/setting.ts b/src/stores/setting.ts index 2948af30..ef415f18 100644 --- a/src/stores/setting.ts +++ b/src/stores/setting.ts @@ -155,6 +155,11 @@ export const useSettingsStore = defineStore('settings', () => { updateUserApplicationCloudSettingValue('showAccountBalance', value); } + function setEnableSwipeBack(value: boolean): void { + updateApplicationSettingsValue('swipeBack', value); + appSettings.value.swipeBack = value; + } + function setEnableAnimate(value: boolean): void { updateApplicationSettingsValue('animate', value); appSettings.value.animate = value; @@ -430,6 +435,7 @@ export const useSettingsStore = defineStore('settings', () => { setTimeZone, setAutoUpdateExchangeRatesData, setShowAccountBalance, + setEnableSwipeBack, setEnableAnimate, // -- Application Lock setEnableApplicationLock, diff --git a/src/views/mobile/SettingsPage.vue b/src/views/mobile/SettingsPage.vue index 106292d5..2b0178e6 100644 --- a/src/views/mobile/SettingsPage.vue +++ b/src/views/mobile/SettingsPage.vue @@ -75,6 +75,11 @@ + + {{ tt('Enable Swipe Back') }} + + + {{ tt('Enable Animation') }} @@ -146,6 +151,16 @@ const currentTimezoneName = computed(() => { return ''; }); +const isEnableSwipeBack = computed({ + get: () => settingsStore.appSettings.swipeBack, + set: value => { + if (value !== settingsStore.appSettings.swipeBack) { + settingsStore.setEnableSwipeBack(value); + location.reload(); + } + } +}); + const isEnableAnimate = computed({ get: () => settingsStore.appSettings.animate, set: value => {