diff --git a/assets/js/app.js b/assets/js/app.js index 545d970..f42facd 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -2337,6 +2337,9 @@ async function loadSettingsUI() { // Show kiosk self-update panel const updatePanel = document.getElementById('kiosk-update-panel'); if (updatePanel) updatePanel.style.display = ''; + // Show kiosk native settings shortcut panel + const nativePanel = document.getElementById('kiosk-native-settings-panel'); + if (nativePanel) nativePanel.style.display = ''; } // Populate About section version @@ -2356,6 +2359,19 @@ function _kioskReconfigureScale() { } } +// ── Kiosk: open native SettingsActivity (server URL, BLE, screensaver) ── +function _openKioskNativeSettings() { + if (typeof _kioskBridge === 'undefined') return; + if (typeof _kioskBridge.openNativeSettings === 'function') { + try { _kioskBridge.openNativeSettings(); } catch(e) {} + } else { + // Older APK without openNativeSettings — make the native gear button + // temporarily visible with a hint to tap it. + try { _kioskBridge.setNativeSettingsVisible(true); } catch(_) {} + showToast(t('settings.kiosk.native_tap_hint') || 'Tocca la rotella ⚙️ in alto a destra', 'info', 4000); + } +} + // ── Kiosk: manual update check ──────────────────────────────────────── let _kioskPendingApkUrl = ''; diff --git a/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt b/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt index d9fc903..cf7c02c 100644 --- a/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt +++ b/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt @@ -515,6 +515,17 @@ class KioskActivity : AppCompatActivity() { btnSettings.visibility = if (visible) View.VISIBLE else View.GONE } } + /** + * Open the native SettingsActivity from the webapp settings page. + * Allows configuring server URL, BLE scale and screensaver without + * the user having to find the native gear button. + */ + @JavascriptInterface + fun openNativeSettings() { + runOnUiThread { + startActivity(Intent(this@KioskActivity, SettingsActivity::class.java)) + } + } }, "_kioskBridge") val url = prefs.getString(KEY_URL, "http://evershelf.local") ?: "http://evershelf.local" diff --git a/index.html b/index.html index 28c82f5..e655d7a 100644 --- a/index.html +++ b/index.html @@ -1302,6 +1302,18 @@

Modalità kiosk full-screen + gateway bilancia integrato. Sorgente: evershelf-kiosk/

+ + +