diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 83d4ab59..33ecec35 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -183,6 +183,13 @@ android:exported="true" android:label="@string/debug_info_title"> + + + " + + "" + + "" + + "
" + + "" + getString(R.string.loading_error_content) + + "" + + ""; + + mWebView.loadDataWithBaseURL("about:blank", htmlData, "text/html", "UTF-8", null); + mWebView.invalidate(); + } + + private boolean shouldOverrideUrl(Uri uri) { + if (Constants.webUri.getHost().equals(uri.getHost())) { + if (uri.getQueryParameter(QUERY_KEY_EMBEDDED) != null) { + return false; + } else { + uri = addQueryParams(uri); + mWebView.loadUrl(uri.toString()); + return true; + } + + } else { + startActivity(new Intent(Intent.ACTION_VIEW, uri)); + return true; + } + } + + @Override + protected void onSaveInstanceState(Bundle outState) { + mWebView.saveState(outState); + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + if (keyCode == KeyEvent.KEYCODE_BACK) { + if (mWebView.canGoBack()) { + mWebView.goBack(); + return true; + } + } + return super.onKeyDown(keyCode, event); + } +} diff --git a/app/src/main/res/layout/activity_webview.xml b/app/src/main/res/layout/activity_webview.xml new file mode 100644 index 00000000..e0b1a53d --- /dev/null +++ b/app/src/main/res/layout/activity_webview.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fe976715..ceb6670d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -225,4 +225,8 @@ EteSync: Connection security EteSync has encountered an unknown certificate. Do you want to trust it? + + Loading... + Loading Error + Refresh