Created
March 29, 2021 07:45
-
-
Save salmanyaqoob/c78275d71c72224e3c7ec33d1d238c8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onReady() { | |
| this.setBrightnessKeepScreenOn(); | |
| }, | |
| onInit() { | |
| this.initLocationCompass(); | |
| }, | |
| exit(){ | |
| app.terminate(); | |
| }, | |
| retry(){ | |
| this.isLocationLoading = true; | |
| this.isLocationError = false; | |
| this.initLocationCompass(); | |
| }, | |
| onDestroy() { | |
| sensor.unsubscribeCompass(); | |
| }, | |
| // Setting the screen to be steady on | |
| setBrightnessKeepScreenOn: function () { | |
| brightness.setKeepScreenOn({ | |
| keepScreenOn: true, | |
| success: function () { | |
| console.log("handling set keep screen on success") | |
| }, | |
| fail: function (data, code) { | |
| console.log("handling set keep screen on fail, code:" + code); | |
| } | |
| }); | |
| }, | |
| onBackPress() { | |
| sensor.unsubscribeCompass(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment