chore: auto-merge develop → main
Triggered by: 61a2372 feat(kiosk): add native settings shortcut in webapp settings page
This commit is contained in:
@@ -2337,6 +2337,9 @@ async function loadSettingsUI() {
|
|||||||
// Show kiosk self-update panel
|
// Show kiosk self-update panel
|
||||||
const updatePanel = document.getElementById('kiosk-update-panel');
|
const updatePanel = document.getElementById('kiosk-update-panel');
|
||||||
if (updatePanel) updatePanel.style.display = '';
|
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
|
// 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 ────────────────────────────────────────
|
// ── Kiosk: manual update check ────────────────────────────────────────
|
||||||
let _kioskPendingApkUrl = '';
|
let _kioskPendingApkUrl = '';
|
||||||
|
|
||||||
|
|||||||
@@ -515,6 +515,17 @@ class KioskActivity : AppCompatActivity() {
|
|||||||
btnSettings.visibility = if (visible) View.VISIBLE else View.GONE
|
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")
|
}, "_kioskBridge")
|
||||||
|
|
||||||
val url = prefs.getString(KEY_URL, "http://evershelf.local") ?: "http://evershelf.local"
|
val url = prefs.getString(KEY_URL, "http://evershelf.local") ?: "http://evershelf.local"
|
||||||
|
|||||||
+12
@@ -1302,6 +1302,18 @@
|
|||||||
<p class="settings-hint" style="margin-top:8px" data-i18n="settings.kiosk.download_sub">Modalità kiosk full-screen + gateway bilancia integrato. Sorgente: <code>evershelf-kiosk/</code></p>
|
<p class="settings-hint" style="margin-top:8px" data-i18n="settings.kiosk.download_sub">Modalità kiosk full-screen + gateway bilancia integrato. Sorgente: <code>evershelf-kiosk/</code></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Kiosk native settings panel (visible only inside kiosk WebView) -->
|
||||||
|
<div id="kiosk-native-settings-panel" style="display:none;background:rgba(99,102,241,0.06);border:1.5px solid rgba(99,102,241,0.2);border-radius:12px;padding:16px;margin-top:16px">
|
||||||
|
<div style="display:flex;align-items:center;gap:10px;margin-bottom:10px">
|
||||||
|
<span style="font-size:1.4rem">🖥️</span>
|
||||||
|
<div>
|
||||||
|
<p style="margin:0;font-weight:700;font-size:0.9rem" data-i18n="settings.kiosk.native_title">Configurazione Kiosk</p>
|
||||||
|
<p class="settings-hint" style="margin:2px 0 0" data-i18n="settings.kiosk.native_hint">URL server, bilancia BLE, salvaschermo e setup wizard.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-secondary full-width" onclick="_openKioskNativeSettings()">⚙️ <span data-i18n="settings.kiosk.native_btn">Apri configurazione kiosk</span></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Kiosk self-update panel (visible only inside kiosk WebView) -->
|
<!-- Kiosk self-update panel (visible only inside kiosk WebView) -->
|
||||||
<div id="kiosk-update-panel" style="display:none;background:rgba(16,185,129,0.06);border:1.5px solid rgba(16,185,129,0.2);border-radius:12px;padding:16px;margin-top:16px">
|
<div id="kiosk-update-panel" style="display:none;background:rgba(16,185,129,0.06);border:1.5px solid rgba(16,185,129,0.2);border-radius:12px;padding:16px;margin-top:16px">
|
||||||
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px">
|
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px">
|
||||||
|
|||||||
@@ -677,7 +677,11 @@
|
|||||||
"kiosk": {
|
"kiosk": {
|
||||||
"hint": "Verwandeln Sie ein Android-Tablet in ein EverShelf-Panel mit integriertem BLE-Waagen-Gateway.",
|
"hint": "Verwandeln Sie ein Android-Tablet in ein EverShelf-Panel mit integriertem BLE-Waagen-Gateway.",
|
||||||
"download_btn": "📥 EverShelf Kiosk herunterladen (APK)",
|
"download_btn": "📥 EverShelf Kiosk herunterladen (APK)",
|
||||||
"download_sub": "Vollbild-Kioskmodus + integriertes Waagen-Gateway. Quellcode: evershelf-kiosk/"
|
"download_sub": "Vollbild-Kioskmodus + integriertes Waagen-Gateway. Quellcode: evershelf-kiosk/",
|
||||||
|
"native_title": "Kiosk-Konfiguration",
|
||||||
|
"native_hint": "Server-URL, BLE-Waage, Bildschirmschoner und Einrichtungsassistent.",
|
||||||
|
"native_btn": "Kiosk-Konfiguration öffnen",
|
||||||
|
"native_tap_hint": "Zahnrad oben rechts antippen"
|
||||||
},
|
},
|
||||||
"saved": "✅ Konfiguration gespeichert!",
|
"saved": "✅ Konfiguration gespeichert!",
|
||||||
"saved_local": "✅ Konfiguration lokal gespeichert",
|
"saved_local": "✅ Konfiguration lokal gespeichert",
|
||||||
|
|||||||
@@ -677,7 +677,11 @@
|
|||||||
"kiosk": {
|
"kiosk": {
|
||||||
"hint": "Turn an Android tablet into an always-on EverShelf panel with built-in BLE scale gateway.",
|
"hint": "Turn an Android tablet into an always-on EverShelf panel with built-in BLE scale gateway.",
|
||||||
"download_btn": "📥 Download EverShelf Kiosk (APK)",
|
"download_btn": "📥 Download EverShelf Kiosk (APK)",
|
||||||
"download_sub": "Full-screen kiosk mode + integrated scale gateway. Source: evershelf-kiosk/"
|
"download_sub": "Full-screen kiosk mode + integrated scale gateway. Source: evershelf-kiosk/",
|
||||||
|
"native_title": "Kiosk Configuration",
|
||||||
|
"native_hint": "Server URL, BLE scale, screensaver and setup wizard.",
|
||||||
|
"native_btn": "Open kiosk configuration",
|
||||||
|
"native_tap_hint": "Tap the gear button at the top right"
|
||||||
},
|
},
|
||||||
"saved": "✅ Configuration saved!",
|
"saved": "✅ Configuration saved!",
|
||||||
"saved_local": "✅ Configuration saved locally",
|
"saved_local": "✅ Configuration saved locally",
|
||||||
|
|||||||
@@ -677,7 +677,11 @@
|
|||||||
"kiosk": {
|
"kiosk": {
|
||||||
"hint": "Trasforma un tablet Android in un pannello EverShelf sempre acceso, con bilancia BLE integrata.",
|
"hint": "Trasforma un tablet Android in un pannello EverShelf sempre acceso, con bilancia BLE integrata.",
|
||||||
"download_btn": "📥 Scarica EverShelf Kiosk (APK)",
|
"download_btn": "📥 Scarica EverShelf Kiosk (APK)",
|
||||||
"download_sub": "Modalità kiosk full-screen + gateway bilancia integrato. Sorgente: evershelf-kiosk/"
|
"download_sub": "Modalità kiosk full-screen + gateway bilancia integrato. Sorgente: evershelf-kiosk/",
|
||||||
|
"native_title": "Configurazione Kiosk",
|
||||||
|
"native_hint": "URL server, bilancia BLE, salvaschermo e setup wizard.",
|
||||||
|
"native_btn": "Apri configurazione kiosk",
|
||||||
|
"native_tap_hint": "Tocca la rotella in alto a destra"
|
||||||
},
|
},
|
||||||
"saved": "✅ Configurazione salvata!",
|
"saved": "✅ Configurazione salvata!",
|
||||||
"saved_local": "✅ Configurazione salvata localmente",
|
"saved_local": "✅ Configurazione salvata localmente",
|
||||||
|
|||||||
Reference in New Issue
Block a user