Merge branch 'master' into appmanager-fragments

master
Andreas Shimokawa 2016-06-19 12:33:05 +02:00
commit 4b5969ef96
8 changed files with 39 additions and 8 deletions

View File

@ -1,4 +1,12 @@
###Changelog
####Version 0.10.2
* Pebble: allow to manually paste configuration data for legacy configuration pages
* Pebble: various improvements to the configuration page
* Pebble: Suppport FW 4.0-dp1 and Pebble2 emulator (needs recompilation of Gadgetbridge)
* Pebble: Fix a problem with key events when using the Pebble music player
####Version 0.10.1
* Pebble: set extended music info by dissecting notifications on Android 5.0+
* Pebble: various other improvemnts to music playback

View File

@ -18,8 +18,8 @@ android {
targetSdkVersion 23
// note: always bump BOTH versionCode and versionName!
versionName "0.10.1"
versionCode 54
versionName "0.10.2"
versionCode 55
}
buildTypes {
release {

View File

@ -261,7 +261,9 @@
</receiver>
<activity
android:launchMode="singleInstance"
android:launchMode="singleTask"
android:allowTaskReparenting="true"
android:clearTaskOnLaunch="true"
android:name=".activities.ExternalPebbleJSActivity"
android:label="@string/app_configure"
android:parentActivityName=".activities.appmanager.AppManagerActivity">

View File

@ -62,7 +62,7 @@
</button>
</div>
<div id="step1compat" class="step">
<p>In case of "network error" after saving settings in the wathchapp, copy the "network error"
<p>In case of "network error" after saving settings in the watchhapp, copy the "network error"
URL and paste it here:</p>
<textarea id="pastereturn"></textarea><br/>
<button class="btn" name="parse" onclick="Pebble.parseReturnedPebbleJS()">Parse legacy app

View File

@ -139,6 +139,11 @@ function gbPebble() {
this.ready = function() {
}
this.showConfiguration = function() {
console.error("This watchapp doesn't support configuration");
GBjs.closeActivity();
}
this.parseReturnedPebbleJS = function() {
var str = document.getElementById('pastereturn').value;
var needle = "pebblejs://close#";

View File

@ -1,5 +1,6 @@
package nodomain.freeyourgadget.gadgetbridge.activities;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@ -66,7 +67,7 @@ public class ExternalPebbleJSActivity extends GBActivity {
//needed to access the DOM
webSettings.setDomStorageEnabled(true);
JSInterface gbJSInterface = new JSInterface();
JSInterface gbJSInterface = new JSInterface(this);
myWebView.addJavascriptInterface(gbJSInterface, "GBjs");
myWebView.loadUrl("file:///android_asset/app_config/configure.html");
@ -75,6 +76,7 @@ public class ExternalPebbleJSActivity extends GBActivity {
@Override
protected void onNewIntent(Intent incoming) {
incoming.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
super.onNewIntent(incoming);
confUri = incoming.getData();
}
@ -129,6 +131,7 @@ public class ExternalPebbleJSActivity extends GBActivity {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("http://") || url.startsWith("https://")) {
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
} else {
url = url.replaceFirst("^pebblejs://close#", "file:///android_asset/app_config/configure.html?config=true&json=");
@ -142,7 +145,10 @@ public class ExternalPebbleJSActivity extends GBActivity {
private class JSInterface {
public JSInterface() {
Context mContext;
public JSInterface(Context c) {
mContext = c;
}
@JavascriptInterface
@ -240,7 +246,7 @@ public class ExternalPebbleJSActivity extends GBActivity {
@JavascriptInterface
public void closeActivity() {
finish();
NavUtils.navigateUpFromSameTask((ExternalPebbleJSActivity) mContext);
}
}

View File

@ -1108,6 +1108,10 @@ public class PebbleProtocol extends GBDeviceProtocol {
}
public byte[] encodeSetMusicState(byte state, int position, int playRate, byte shuffle, byte repeat) {
if (mFwMajor < 3) {
return null;
}
byte playState;
switch (state) {
@ -1143,7 +1147,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
@Override
public byte[] encodeSetMusicInfo(String artist, String album, String track, int duration, int trackCount, int trackNr) {
String[] parts = {artist, album, track};
if (duration == 0) {
if (duration == 0 || mFwMajor < 3) {
return encodeMessage(ENDPOINT_MUSICCONTROL, MUSICCONTROL_SETMUSICINFO, 0, parts);
} else {
// Calculate length first

View File

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<changelog>
<release version="0.10.2" versioncode="55">
<change>Pebble: allow to manually paste configuration data for legacy configuration pages</change>
<change>Pebble: various improvements to the configuration page</change>
<change>Pebble: Suppport FW 4.0-dp1 and Pebble2 emulator (needs recompilation of Gadgetbridge)</change>
<change>Pebble: Fix a problem with key events when using the Pebble music player</change>
</release>
<release version="0.10.1" versioncode="54">
<change>Pebble: set extended music info by dissecting notifications on Android 5.0+</change>
<change>Pebble: various other improvemnts to music playback</change>