From 9a52bac7f1a2394ac29aef05aec3b7c8f8939654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A6=E5=90=9B?= <73606411+setube@users.noreply.github.com> Date: Sat, 20 Dec 2025 02:21:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81Android=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=94=AE=E9=80=80=E5=87=BA=E7=A1=AE=E8=AE=A4=E4=B8=8E?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增Android端返回键退出确认弹窗,防止误触直接退出应用。各语言包补充退出确认标题与提示语,提升多语言体验。依赖新增@capacitor/app,样式与主题适配同步优化。 --- android/app/src/main/res/values/styles.xml | 14 ++------ package.json | 1 + pnpm-lock.yaml | 20 +++++++++--- src/App.vue | 38 ++++++++++++++++++++++ src/locales/de.ts | 4 ++- src/locales/en.ts | 4 ++- src/locales/ja.ts | 4 ++- src/locales/ko.ts | 4 ++- src/locales/ru.ts | 4 ++- src/locales/zh-CN.ts | 4 ++- src/locales/zh-TW.ts | 4 ++- src/style.css | 5 --- 12 files changed, 78 insertions(+), 28 deletions(-) diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index bee05e5..6a6c20a 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -7,24 +7,14 @@ #1a1a2e #0f0f1a #6366f1 - - @android:color/transparent - @android:color/transparent - false - false - true diff --git a/package.json b/package.json index e5bd24b..75dc586 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ }, "dependencies": { "@capacitor/android": "^8.0.0", + "@capacitor/app": "^8.0.0", "@capacitor/cli": "^8.0.0", "@capacitor/core": "^8.0.0", "@tailwindcss/vite": "^4.1.17", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 37c3fe5..8237289 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@capacitor/android': specifier: ^8.0.0 version: 8.0.0(@capacitor/core@8.0.0) + '@capacitor/app': + specifier: ^8.0.0 + version: 8.0.0(@capacitor/core@8.0.0) '@capacitor/cli': specifier: ^8.0.0 version: 8.0.0 @@ -650,6 +653,11 @@ packages: peerDependencies: '@capacitor/core': ^8.0.0 + '@capacitor/app@8.0.0': + resolution: {integrity: sha512-OwzIkUs4w433Bu9WWAEbEYngXEfJXZ9Wmdb8eoaqzYBgB0W9/3Ed/mh6sAYPNBAZlpyarmewgP7Nb+d3Vrh+xA==} + peerDependencies: + '@capacitor/core': '>=8.0.0' + '@capacitor/cli@8.0.0': resolution: {integrity: sha512-v9hEBi69xGxuuZhg55N031bMEenKaPSv71Il8C22VOOH6surDyv/MPeImN0oVfFc7eiklaW3rDFYVz6cmXfJWQ==} engines: {node: '>=22.0.0'} @@ -968,8 +976,8 @@ packages: resolution: {integrity: sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==} engines: {node: '>=12'} - '@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': - resolution: {commit: 06b29aafb7708acef8b3669835c8a7857ebc92d2, repo: https://github.com/electron/node-gyp.git, type: git} + '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': + resolution: {tarball: https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2} version: 10.2.0-electron.1 engines: {node: '>=12.13.0'} hasBin: true @@ -5077,6 +5085,10 @@ snapshots: dependencies: '@capacitor/core': 8.0.0 + '@capacitor/app@8.0.0(@capacitor/core@8.0.0)': + dependencies: + '@capacitor/core': 8.0.0 + '@capacitor/cli@8.0.0': dependencies: '@ionic/cli-framework-output': 2.2.8 @@ -5438,7 +5450,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': + '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.3 @@ -5475,7 +5487,7 @@ snapshots: '@electron/rebuild@3.7.0': dependencies: - '@electron/node-gyp': git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2 + '@electron/node-gyp': https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2 '@malept/cross-spawn-promise': 2.0.0 chalk: 4.1.2 debug: 4.4.3 diff --git a/src/App.vue b/src/App.vue index 5da5a8b..99724c6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -428,6 +428,20 @@ + + + + + + {{ t('common.exitConfirmTitle') }} + {{ t('common.exitConfirmMessage') }} + + + {{ t('common.cancel') }} + {{ t('common.confirm') }} + + +