Skip to content

Commit 1092f5e

Browse files
authored
Merge pull request #26 from SEPIA-Framework/dev
SEPIA Home v2.5.0 release candidate
2 parents c77353b + 2849e46 commit 1092f5e

File tree

137 files changed

+5106
-1912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+5106
-1912
lines changed

TEACH-UI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android.media.action.MEDIA_PLAY_FROM_SEARCH
4242
```
4343
URL: http://localhost:20780
4444
Plugin: HelloPlugin
45-
JSON: {"name":"Boss"}
45+
JSON: {"value": {"name":"Boss"} }
4646
Success: Ok I understood <result_hello>
4747
Fail: Sorry I could not get a result
4848
```

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget id="org.example.sepia.app.web" version="0.21.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget id="org.example.sepia.app.web" version="0.22.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>S.E.P.I.A.</name>
44
<description>
55
Prototype of S.E.P.I.A. framework client

plugin_mods/inappbrowser/android/InAppBrowser.java

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Licensed to the Apache Software Foundation (ASF) under one
2121
import android.annotation.SuppressLint;
2222
import android.content.Context;
2323
import android.content.Intent;
24+
import android.content.pm.PackageManager;
25+
import android.content.pm.ResolveInfo;
2426
import android.graphics.Color;
2527
import android.provider.Browser;
2628
import android.content.res.Resources;
@@ -412,7 +414,7 @@ public String openExternal(String url) {
412414
intent.putExtra(Browser.EXTRA_APPLICATION_ID, cordova.getActivity().getPackageName());
413415
this.cordova.getActivity().startActivity(intent);
414416
return "";
415-
// not catching FileUriExposedException explicitly because buildtools<24 doesn't know about it
417+
// not catching FileUriExposedException explicitly because buildtools<24 doesn't know about it
416418
} catch (java.lang.RuntimeException e) {
417419
LOG.d(LOG_TAG, "InAppBrowser: Error loading url "+url+":"+ e.toString());
418420
return e.toString();
@@ -593,7 +595,7 @@ public String showWebPage(final String url, HashMap<String, Boolean> features) {
593595
}
594596
Boolean wideViewPort = features.get(USER_WIDE_VIEW_PORT);
595597
if (wideViewPort != null ) {
596-
useWideViewPort = wideViewPort.booleanValue();
598+
useWideViewPort = wideViewPort.booleanValue();
597599
}
598600
}
599601

@@ -608,8 +610,8 @@ public String showWebPage(final String url, HashMap<String, Boolean> features) {
608610
*/
609611
private int dpToPixels(int dipValue) {
610612
int value = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP,
611-
(float) dipValue,
612-
cordova.getActivity().getResources().getDisplayMetrics()
613+
(float) dipValue,
614+
cordova.getActivity().getResources().getDisplayMetrics()
613615
);
614616

615617
return value;
@@ -645,7 +647,7 @@ public void run() {
645647
int toolbarColor;
646648
int blackColor = android.graphics.Color.rgb(0, 0, 0);
647649
int accentColor = android.graphics.Color.rgb(190, 255, 26); //android.graphics.Color.rgb(0, 122, 255);
648-
if(Build.VERSION.SDK_INT >= 21){
650+
if(Build.VERSION.SDK_INT >= 21){
649651
/*
650652
toolbarColor = cordova.getActivity().getWindow().getStatusBarColor();
651653
dialog.getWindow().setStatusBarColor(toolbarColor); //TODO: not working
@@ -705,8 +707,8 @@ public void onClick(View v) {
705707
edittext.setBackgroundColor(android.graphics.Color.WHITE);
706708
edittext.setTextColor(blackColor);
707709
}
708-
edittext.setTextSize(12);
709-
edittext.setPadding(this.dpToPixels(8), this.dpToPixels(4), this.dpToPixels(8), this.dpToPixels(4));
710+
edittext.setTextSize(12);
711+
edittext.setPadding(this.dpToPixels(8), this.dpToPixels(4), this.dpToPixels(8), this.dpToPixels(4));
710712
edittext.setGravity(Gravity.CENTER);
711713
edittext.setSingleLine(true);
712714
edittext.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
@@ -892,8 +894,8 @@ public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType)
892894
WebSettings settings = inAppWebView.getSettings();
893895
settings.setJavaScriptEnabled(true);
894896
settings.setJavaScriptCanOpenWindowsAutomatically(true);
895-
settings.setBuiltInZoomControls(true);
896-
settings.setDisplayZoomControls(showZoomControls);
897+
settings.setBuiltInZoomControls(true);
898+
settings.setDisplayZoomControls(showZoomControls);
897899
settings.setPluginState(android.webkit.WebSettings.PluginState.ON);
898900

899901
settings.setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture);
@@ -1141,7 +1143,24 @@ public InAppBrowserClient(CordovaWebView webView, TextView mEditText) {
11411143
/**
11421144
* Override the URL that should be loaded
11431145
*
1144-
* This handles a small subset of all the URIs that would be encountered.
1146+
* New (added in API 24)
1147+
* For Android 7 and above.
1148+
*
1149+
* @param webView
1150+
* @param request
1151+
*/
1152+
/*@TargetApi(Build.VERSION_CODES.N)
1153+
@Override
1154+
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest request) {
1155+
//TODO: handle request.getMethod()
1156+
return shouldOverrideUrlLoading(webView, request.getUrl().toString());
1157+
}*/
1158+
1159+
/**
1160+
* Override the URL that should be loaded
1161+
*
1162+
* Legacy (deprecated in API 24)
1163+
* For Android 6 and below.
11451164
*
11461165
* @param webView
11471166
* @param url
@@ -1157,7 +1176,7 @@ public boolean shouldOverrideUrlLoading(WebView webView, String url) {
11571176
} catch (android.content.ActivityNotFoundException e) {
11581177
LOG.e(LOG_TAG, "Error dialing " + url + ": " + e.toString());
11591178
}
1160-
} else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:") || url.startsWith("intent:")) {
1179+
} else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:")) {
11611180
try {
11621181
Intent intent = new Intent(Intent.ACTION_VIEW);
11631182
intent.setData(Uri.parse(url));
@@ -1166,9 +1185,33 @@ public boolean shouldOverrideUrlLoading(WebView webView, String url) {
11661185
} catch (android.content.ActivityNotFoundException e) {
11671186
LOG.e(LOG_TAG, "Error with " + url + ": " + e.toString());
11681187
}
1169-
}
1188+
} else if (url.startsWith("intent:")) {
1189+
try {
1190+
Context context = cordova.getActivity();
1191+
Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
1192+
if (intent != null) {
1193+
PackageManager packageManager = context.getPackageManager();
1194+
ResolveInfo info = packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
1195+
if (info != null) {
1196+
context.startActivity(intent);
1197+
return true;
1198+
} else {
1199+
String fallbackUrl = intent.getStringExtra("browser_fallback_url");
1200+
if (fallbackUrl != null && !fallbackUrl.isEmpty()){
1201+
inAppWebView.loadUrl(fallbackUrl);
1202+
//Alternative: call external browser:
1203+
//Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(fallbackUrl));
1204+
//context.startActivity(browserIntent);
1205+
return true;
1206+
}
1207+
}
1208+
}
1209+
} catch (Exception e) {
1210+
LOG.e(LOG_TAG, "Error with " + url + ": " + e.toString());
1211+
}
1212+
11701213
// If sms:5551212?body=This is the message
1171-
else if (url.startsWith("sms:")) {
1214+
} else if (url.startsWith("sms:")) {
11721215
try {
11731216
Intent intent = new Intent(Intent.ACTION_VIEW);
11741217

plugin_mods/speechrecognition/org.apache.cordova.speech.speechrecognition/src/android/SpeechRecognition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public void onPartialResults(Bundle partialResults) {
308308
Log.d(LOG_TAG, "onPartialResults " + partialResults);
309309
ArrayList<String> transcript = partialResults.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
310310
//float[] confidence = partialResults.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);
311-
if (transcript.size() > 0) {
311+
if (transcript != null && transcript.size() > 0) {
312312
Log.d(LOG_TAG, "fire partial result event");
313313
firePartialResultEvent(transcript, null);
314314
} else {
@@ -332,7 +332,7 @@ public void onResults(Bundle results) {
332332
Log.d(LOG_TAG, "onResults " + results);
333333
ArrayList<String> transcript = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
334334
float[] confidence = results.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);
335-
if (transcript.size() > 0) {
335+
if (transcript != null && transcript.size() > 0) {
336336
Log.d(LOG_TAG, "fire recognition event");
337337
fireRecognitionEvent(transcript, confidence);
338338
} else {

www/credits.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ <h3>Credits</h3>
1111
<a href="https://hammerjs.github.io/">Hammer.js</a><br>
1212
<a href="https://bitwiseshiftleft.github.io/sjcl/" title="Stanford Javascript Crypto Library">SJCL</a><br>
1313
<a href="https://github.com/mattdiamond/Recorderjs">Recorder.js</a><br>
14+
<a href="https://github.com/kdavis-mozilla/vad.js">vad.js</a><br>
15+
<a href="https://github.com/iconfu/svg-inject">SVGInject</a><br>
1416
<p><u>Icons</u></p>
1517
<a href="https://material.io/tools/icons">Google Material Design</a><br>
1618
<p><u>Sounds</u></p>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Fonts are not well maintained by Google!
22
- Get recent woff2 version from here: https://fonts.googleapis.com/icon?family=Material+Icons
3-
- Convert to woff e.g. with an online converter, e.g. (default settings): https://transfonter.org/
3+
- Convert to woff e.g. with an online converter, e.g. (default settings): https://transfonter.org/ or https://font-converter.net/
44
- View new woff with e.g.: http://torinak.com/font/lsfont.html or https://opentype.js.org
55
- Watch issue: https://github.com/google/material-design-icons/issues/786
66

77
After update:
8-
- Get new glyph table via: https://opentype.js.org/font-inspector.html
8+
- Get new glyph table (PostScript table) via: https://opentype.js.org/font-inspector.html
99
- Remove broken ones, remove "uni..." and "u..." from entries and add new array to: googleMaterialIcons.js

www/css/googleMaterialIcons.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
src: local('Material Icons'),
77
local('MaterialIcons-Regular'),
88
url(googleMaterialIcons-2018-09-19.woff2) format('woff2'),
9-
url(googleMaterialIcons-2018-09-19.woff) format('woff');
9+
url(googleMaterialIcons-2018-09-19.woff) format('woff');
10+
font-display: block;
1011
}
1112

1213
.material-icons {

www/css/sepiaFW-alwaysOn.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
width: 250px;
4141
height: 175px;
4242
z-index: 99;
43+
cursor: pointer;
4344
}
4445
#sepiaFW-alwaysOn-info-box {
4546
position: absolute;

www/css/sepiaFW-cards.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,15 +563,22 @@
563563
margin: 0 5px 0 5px;
564564
text-align: center;
565565
}
566-
.sepiaFW-cards-list-body .weatherNowDetails li div img.precipSymbol {
566+
.sepiaFW-cards-list-body .weatherNowDetails li div img.precipSymbol,
567+
.sepiaFW-cards-list-body .weatherNowDetails li div object.precipSymbol {
567568
width: 20px;
568569
vertical-align: bottom;
569570
-webkit-filter: invert(1);
570571
filter: invert(1);
571572
margin-right: 5px;
572573
}
574+
.sepiaFW-cards-list-body .weatherNowDetails li div svg.precipSymbol {
575+
width: 20px;
576+
height: 20px;
577+
vertical-align: bottom;
578+
margin-right: 5px;
579+
}
573580
.sepiaFW-cards-list-body .weatherNowDetails li div span {
574-
min-width: 30px;
581+
min-width: 40px;
575582
display: inline-block;
576583
}
577584

www/css/sepiaFW-frames.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
}
144144
.sepiaFW-frames-page .group.fill {
145145
flex-wrap: wrap;
146+
margin: 8px 0;
146147
}
147148
.sepiaFW-frames-page .group.fill label {
148149
flex: 0 0 auto;

0 commit comments

Comments
 (0)