1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-03 17:02:13 +01:00

Localize the title of the configuration activity.

Auto open local settings (e.g. clay)
This commit is contained in:
danielegobbetti 2016-03-21 21:19:32 +01:00
parent 1aadcb958b
commit 1933e2bf10
4 changed files with 10 additions and 3 deletions

View File

@ -261,7 +261,7 @@
<activity
android:name=".activities.ExternalPebbleJSActivity"
android:label="external_js"
android:label="@string/app_configure"
android:parentActivityName=".activities.AppManagerActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"

View File

@ -45,7 +45,7 @@
<div id="step1">
<h2>Url of the configuration:</h2>
<div id="config_url"></div>
<button class="btn" name="show config" value="show config" onclick="Pebble.showConfiguration()" >Show config / URL</button>
<!--<button class="btn" name="show config" value="show config" onclick="Pebble.showConfiguration()" >Show config / URL</button>-->
<button class="btn" name="open config" value="open config" onclick="Pebble.actuallyOpenURL()" >Open configuration website</button>
</div>
<div id="step2">

View File

@ -111,6 +111,8 @@ function gbPebble() {
GBjs.gbLog("app wanted to show: " + title + " body: "+ body);
}
this.ready = function() {
}
}
@ -129,6 +131,7 @@ if (jsConfigFile != null) {
} else {
document.getElementById('step2').style.display="none";
Pebble.ready();
Pebble.showConfiguration();
}
});
}

View File

@ -96,9 +96,13 @@ public class ExternalPebbleJSActivity extends Activity {
private class GBChromeClient extends WebChromeClient {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
GB.toast(consoleMessage.message(), Toast.LENGTH_LONG, GB.ERROR);
if (ConsoleMessage.MessageLevel.ERROR.equals(consoleMessage.messageLevel())) {
GB.toast(consoleMessage.message(), Toast.LENGTH_LONG, GB.ERROR);
//TODO: show error page
}
return super.onConsoleMessage(consoleMessage);
}
}
private class GBWebClient extends WebViewClient {