1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-24 05:50:47 +02:00
Commit Graph

37 Commits

Author SHA1 Message Date
Translation Bot
a14e14eeb9 Merge branch 'master' into background-javascript 2017-03-10 23:14:40 +01:00
License Bot
e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
Daniele Gobbetti
75d4abc9dc Pebble background webview: bring back the mutableContextWrapper, otherwise inputs aren't working.
Reliably go back to first step of the configuration page when closing (this causes a Toast when closing the activity while in the clay settings page)
2017-03-04 20:43:32 +01:00
Daniele Gobbetti
f84c651c38 Pebble background webview: config page should be shown reliably now. 2017-03-04 19:46:18 +01:00
Daniele Gobbetti
76be0ae676 Pebble background webview improvements:
remove the pre-KITKAT checks as the minsupportedversion is KITKAT
fix the currentPosition override
move the returned configuration parsing to onResume method (where it was previously) as it seems more reliable
pass the whole GBDeviceEventAppMessage object, this way the jsInterface in the webview doesn't need to be static anymore
change the way the webview is initialized, this way the context doesn't need to be static anymore
use runOnUiThread instead of the Handler .. MainLooper to post the commands to the webview instance
comment a couple of custom message handler for weather as the watchapp seem to work well with JS alone
add a couple of log messages for debugging

known issue: legacy app configuration pasting does not work.
2017-02-28 21:11:26 +01:00
cpfeiffer
234beace29 Some fixes for the background webview 2017-02-25 21:50:05 +01:00
cpfeiffer
711800f3d0 Collaborative attempt to initialize the background webview on startup 2017-02-25 18:01:08 +01:00
Daniele Gobbetti
a4ac108287 Pebble: merge master moving the location override to WebViewSingleton 2017-02-25 15:44:37 +01:00
Daniele Gobbetti
6c993d40aa Merge branch 'master' into background-javascript
# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ExternalPebbleJSActivity.java
2017-02-25 15:26:55 +01: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
eaaa940637 Pebble: refactor the background webview
Now native controls seem to work (including datepicker), still the webview is not started upon watchapp start, but when long-pressing each app in the app manager. After the webview is started it will live in the background until device disconnect.
2017-01-01 18:33:39 +01:00
Daniele Gobbetti
53d8f88670 Pebble: first steps towards background JS execution.
Progress so far:
- webview is created upon watchapp launch
- webview is destroyed after disconnect
- ready event is fired in the background
- showConfiguration is fired upon webview display
2016-12-28 20:53:17 +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
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
Andreas Shimokawa
bdf403210e Pebble: Fix configuration of certain pebble apps
for appkeys with index 0 it was assumed they were not found becaus JSONObject.getOpt() returns 0 if not found.
Use the getOpt() method variant with a fallback parameter instead and set that to -1 fixes the problem.

(Also fixes a missing debug output)

Fixes #419
2016-10-28 00:03:50 +02:00
cpfeiffer
c59553c9c9 Rename GBDevice#hardwareVersion to model
(e.g. while DeviceType is "PEBBLE" in general, the model
might specify a Pebble Time or Time Steel.
2016-08-26 20:57:59 +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
ad3f7e53b3 Try hard to hide the browser activity from the stack. 2016-06-18 21:08:51 +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
Daniele Gobbetti
42acb8915a Pass the integer keys to pebble, even if they are not within the known app keys. Requested in #251 2016-05-31 12:24:28 +02:00
Andreas Shimokawa
4bcebca744 Work towards dark theme, remove -v21 specific theme definition 2016-04-14 15:21:25 +02:00
Lem Dulfo
70ed14243f Remove all getActionBar occurences, temporary fix for overlap 2016-04-10 21:11:52 +02:00
Lem Dulfo
5a3004cbce AppCompat and FAB, more Material Design 2016-04-10 21:11:41 +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
Andreas Shimokawa
4be1926459 reformat code though Android Studio 2016-03-20 15:00:05 +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
danielegobbetti
ea855a4cc2 Also open public URLs with an external browser. 2016-03-13 08:31:50 +01:00
danielegobbetti
d378b4eb7b Intercept clay pebblejs://close url 2016-03-08 21:44:12 +01:00
Daniele Gobbetti
6d4b98719a Implement some further JS methods to make additional watchapps happy 2016-03-04 17:44:42 +01:00
Andreas Shimokawa
1e44bb03fb Pebble: convert Boolean to String for app configuration 2016-03-03 16:02:30 +01:00
Andreas Shimokawa
2a7f9226a0 Pebble: send configuration to watch
TODO: handle booleans
2016-03-03 14:23:17 +01:00
Andreas Shimokawa
fa924ff9d8 Pebble: fix crash when navigating back from configuration activity 2016-03-03 13:05:51 +01:00
Andreas Shimokawa
860ded1022 refromat code 2016-03-03 11:54:07 +01:00
Andreas Shimokawa
63d938559e pass GBDevice down to ExternalPebbleJSActivity to determine the platform version (aplite,basalt,chalk) 2016-03-03 11:52:30 +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