merge develop into main
This commit is contained in:
+5
-3
@@ -2025,12 +2025,14 @@ async function loadSettingsUI() {
|
|||||||
// Only shown when _kioskBridge JS interface is available (Android WebView).
|
// Only shown when _kioskBridge JS interface is available (Android WebView).
|
||||||
function _injectKioskOverlay() {
|
function _injectKioskOverlay() {
|
||||||
if (typeof _kioskBridge === 'undefined') return;
|
if (typeof _kioskBridge === 'undefined') return;
|
||||||
if (document.getElementById('_kiosk_overlay')) return;
|
|
||||||
|
|
||||||
// Mark header so CSS can center the title
|
// Always mark header as kiosk-mode (idempotent) — must happen even if buttons
|
||||||
|
// were already injected by the native onPageFinished Kotlin callback.
|
||||||
const appHeader = document.querySelector('.app-header');
|
const appHeader = document.querySelector('.app-header');
|
||||||
if (appHeader) appHeader.classList.add('kiosk-mode');
|
if (appHeader) appHeader.classList.add('kiosk-mode');
|
||||||
|
|
||||||
|
if (document.getElementById('_kiosk_overlay')) return;
|
||||||
|
|
||||||
const headerLeft = document.getElementById('header-left');
|
const headerLeft = document.getElementById('header-left');
|
||||||
if (!headerLeft) return;
|
if (!headerLeft) return;
|
||||||
|
|
||||||
@@ -6869,7 +6871,7 @@ function selectUseLocation(btn, loc) {
|
|||||||
// After 3+ consistent choices from the same location for a product,
|
// After 3+ consistent choices from the same location for a product,
|
||||||
// auto-selects it and hides the location picker (user can still tap "cambia").
|
// auto-selects it and hides the location picker (user can still tap "cambia").
|
||||||
const _PREF_LOC_KEY = '_prefUseLoc';
|
const _PREF_LOC_KEY = '_prefUseLoc';
|
||||||
const _PREF_LOC_NEEDED = 3; // choices needed to confirm a preference
|
const _PREF_LOC_NEEDED = 2; // choices needed to confirm a preference
|
||||||
|
|
||||||
function _getPrefLocHistory(productId) {
|
function _getPrefLocHistory(productId) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -538,10 +538,11 @@ class KioskActivity : AppCompatActivity() {
|
|||||||
private fun showNativeUpdateBanner(message: String, apkDownloadUrl: String) {
|
private fun showNativeUpdateBanner(message: String, apkDownloadUrl: String) {
|
||||||
pendingApkDownloadUrl = apkDownloadUrl
|
pendingApkDownloadUrl = apkDownloadUrl
|
||||||
tvUpdateMessage.text = "⬆️ Aggiornamento disponibile: $message"
|
tvUpdateMessage.text = "⬆️ Aggiornamento disponibile: $message"
|
||||||
|
// Reset button to initial state so user can confirm before download starts
|
||||||
|
btnInstallUpdate.isEnabled = true
|
||||||
|
btnInstallUpdate.text = "⬇ Scarica"
|
||||||
updateBanner.visibility = View.VISIBLE
|
updateBanner.visibility = View.VISIBLE
|
||||||
// Auto-start download immediately — no timer hide, stays until done or dismissed
|
// Download starts only when the user taps btnInstallUpdate
|
||||||
activeInstallBtn = btnInstallUpdate
|
|
||||||
triggerApkDownload(apkDownloadUrl)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── APK Download + Install ─────────────────────────────────────────────
|
// ── APK Download + Install ─────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user