diff --git a/src/Logic/Web/AndroidPolyfill.ts b/src/Logic/Web/AndroidPolyfill.ts index 57436c6a2..b92e07b2b 100644 --- a/src/Logic/Web/AndroidPolyfill.ts +++ b/src/Logic/Web/AndroidPolyfill.ts @@ -120,7 +120,7 @@ export class AndroidPolyfill { if (typeof v === "string") { v = JSON.parse(v) } - console.log("Got inset sizes:", result) + console.log("Got inset sizes:", JSON.stringify(result)) insets.bottom.set(v.bottom / window.devicePixelRatio) insets.top.set(v.top / window.devicePixelRatio) }) @@ -186,4 +186,8 @@ export class AndroidPolyfill { } ) } + + static exit() { + this.databridgePlugin.request({key: "exit"}) + } } diff --git a/src/UI/AllThemesGui.svelte b/src/UI/AllThemesGui.svelte index 483898bfa..61a0cdbdb 100644 --- a/src/UI/AllThemesGui.svelte +++ b/src/UI/AllThemesGui.svelte @@ -122,10 +122,16 @@ AndroidPolyfill.onBackButton( () => { + console.log("AllThemesGui received a backbutton from Android") + if(guistate.closeAll()){ + return true + } if (searchIsFocussed.data) { searchIsFocussed.set(false) return true } + // We'll probably want to exit the app + AndroidPolyfill.exit() return false }, { returnToIndex: new ImmutableStore(false) }