forked from MapComplete/MapComplete
UI: attempt to fix #2508
This commit is contained in:
parent
90fdb22842
commit
3f897bdff5
2 changed files with 11 additions and 1 deletions
|
|
@ -120,7 +120,7 @@ export class AndroidPolyfill {
|
||||||
if (typeof v === "string") {
|
if (typeof v === "string") {
|
||||||
v = JSON.parse(v)
|
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.bottom.set(v.bottom / window.devicePixelRatio)
|
||||||
insets.top.set(v.top / window.devicePixelRatio)
|
insets.top.set(v.top / window.devicePixelRatio)
|
||||||
})
|
})
|
||||||
|
|
@ -186,4 +186,8 @@ export class AndroidPolyfill {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static exit() {
|
||||||
|
this.databridgePlugin.request({key: "exit"})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,10 +122,16 @@
|
||||||
|
|
||||||
AndroidPolyfill.onBackButton(
|
AndroidPolyfill.onBackButton(
|
||||||
() => {
|
() => {
|
||||||
|
console.log("AllThemesGui received a backbutton from Android")
|
||||||
|
if(guistate.closeAll()){
|
||||||
|
return true
|
||||||
|
}
|
||||||
if (searchIsFocussed.data) {
|
if (searchIsFocussed.data) {
|
||||||
searchIsFocussed.set(false)
|
searchIsFocussed.set(false)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
// We'll probably want to exit the app
|
||||||
|
AndroidPolyfill.exit()
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
{ returnToIndex: new ImmutableStore(false) }
|
{ returnToIndex: new ImmutableStore(false) }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue