Commit Graph

24 Commits (962720145e3678f5ffd17ea6c4a9e277a665b144)

Author SHA1 Message Date
Daniele Gobbetti 91b1464824 Pebble: use iframe for clay configuration webpages
Replacing the top frame with a data-uri is forbidden since chromium-based-webview version 60.
With this commit we swap the body with an iframe when needed. Old webviews work as usual also with this approach.
No special treatment is needed for local storage as its usage is forbidden in data-uri iframes.

Fixes #758
2017-08-16 21:31:39 +02:00
Daniele Gobbetti 8353026c08 Pebble: call the callbacks, do not return them 2017-07-28 18:38:03 +02:00
Daniele Gobbetti cad777e4ce Pebble: always return the position after 10 tries. Fixes #643
This is a workaround for bugs in the javascript code of the configured watchfaces, that could fail to handle a returned failure properly and crash the webview / fill its stack.
2017-04-08 08:57:23 +02:00
Daniele Gobbetti df71d695c3 Pebble: pass an object to the ready event handlers
apparently also the ready event needs an object for some watchfaces. Reported in #643 (not the main report)
2017-04-08 08:50:18 +02:00
Daniele Gobbetti 4dbc255ad5 Pebble: return the current position to the caller of the getCurrentPosition function.
This fixes a bug introduced in d8894d315a that affects also #643.
2017-04-08 08:34:33 +02:00
Daniele Gobbetti d8894d315a Pebble: In the geolocation override, fail if the position is too old.
The previous logic was wrong as it was calling success every time. Further checks must be added for some watchfaces.
2017-04-02 22:34:22 +02:00
Daniele Gobbetti e7846f4754 Pebble: override the native navigator.geolocation GetCurrentPosition
The native method requires FINE location permission, and we don't have it. Further we should handle the runtime permission request.
2017-02-25 13:31:48 +01:00
Daniele Gobbetti 3e9898d86c Pebble: call the "ready" method also when returning from the external web browser
Additionally don't call decodeURIcomponent as the getURLVariable function already does this. Needed by apps like "slides of time". Closes 454
2016-12-09 11:55:11 +01:00
Uwe Hermann 0746aaa579 app: Random typo and consistency fixes. 2016-12-01 20:22:12 +01:00
Daniele Gobbetti 84327a5b86 Pebble: use also the device address as seed to store app configuration
This is not needed as long as one GB instance is used to manage a single pebble device, if multiple devices are managed the stored watchapp configuration could be messed up.
2016-11-27 11:31:03 +01:00
Daniele Gobbetti 5b804effa4 Pebble: use a proper event handling in the configuration JS
This allows more advanced configuration pages to work properly. The problematic config pages emerged while fixing #431
2016-11-24 18:03:47 +01:00
Daniele Gobbetti 42901a295d Pebble: pretend the clay-settings key is always present (but empty per default) in the localStorage 2016-11-18 12:33:12 +01:00
Daniele Gobbetti 1a22752b98 Pebble: enable localStorage
LocalStorage native functions are overridden to keep each watchface's settings separated. It's possible the bind method do not work on older versions of android.
2016-11-14 17:51:33 +01:00
Daniele Gobbetti 69be5dbbc7 Set the json directly instead of using parseconfig
Some watchfaces do some processing on the incoming json, and we are storing the json after the fact, and double parsing isn't good.
2016-06-26 14:13:47 +02:00
Daniele Gobbetti 1430619c30 Implement watchapp configuration presets.
This is a quick & dirty solution that may be improved by storing multiple presets in the DB in the future.
2016-06-26 11:55:08 +02:00
Daniele Gobbetti 988f5ef1b2 Go back and show Toast if the watchapp doesn't really support configuration. 2016-06-18 21:17:38 +02:00
Daniele Gobbetti 245b8655e7 Fixed typo #251 2016-06-18 21:01:32 +02:00
Daniele Gobbetti 966c3d4811 Various improvements to the configuration page:
- localstorage is now cleared at every launch: this prevents some clay configuration pages to send back to the watch a number of keys that were set by other configuration pages
- only execute JS on document ready: this prevents some race conditions
- added dummy getTimelineToken function to Pebble JS object
- corrected (hopefully!) a few logic errors in the JS code (this referenced where it wasn't)
- refactored the steps visualization in JS
- lifecycle changes to the java activity: now the configuration page gets closed as soon as the settings have been sent, and there is only one instance of it
2016-06-18 18:40:57 +02:00
Daniele Gobbetti d5586478f3 Support legacy configuration pages #251
There are pages that do not honor return_to get parameter. This commit allows the user to enter the returned url manually.
2016-06-17 17:47:13 +02:00
danielegobbetti 1933e2bf10 Localize the title of the configuration activity.
Auto open local settings (e.g. clay)
2016-03-21 21:19:32 +01:00
Daniele Gobbetti 538961fd2c Add some style, intercept and display toast in case of JS errors 2016-03-18 17:50:24 +01:00
Daniele Gobbetti 2da50e27c2 call the ready event as soon as the app js file has been loaded. Add a button to debug the different steps. 2016-03-08 17:45:11 +01:00
Daniele Gobbetti 6d4b98719a Implement some further JS methods to make additional watchapps happy 2016-03-04 17:44:42 +01:00
Daniele Gobbetti 089a59168e Initial support for using an external browser for configuring pebble apps. This allows existing configuration pages to work without having internet access ourselves.
This is a better approach as initially thought in #191.

What is missing is outlined in the (several) TODOs.
2016-03-02 21:07:27 +01:00