diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7fdced8e..91e7e942 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -74,6 +74,19 @@ android:name="android.support.PARENT_ACTIVITY" android:value=".activities.MainActivity" /> + + + + + + + { + try { + switch (which) { + case DialogInterface.BUTTON_POSITIVE: + handler.proceed(); + sslNoticeUserDecision = true; + break; + case DialogInterface.BUTTON_NEGATIVE: + handler.cancel(); + if (isRunningOnTV) { + // Finish as there is no other way to display the website. + finish(); + } + break; + } + } catch (Exception e) { + Log.e(TAG, "onReceivedSslError:OnClickListener", e); + } + }; + mSecurityNoticeDialog = new AlertDialog.Builder(WebViewActivity.this) + .setTitle(R.string.security_notice) + .setMessage(getString(R.string.ssl_cert_invalid_text, webPageUrl)) + .setPositiveButton(R.string.cont, listener) + .setNegativeButton(R.string.cancel_title, listener) + .show(); + } + + @Override + public void onPageFinished(WebView view, String url) { + mWebView.setVisibility(View.VISIBLE); + mLoadingView.setVisibility(View.GONE); + } + }; + + /** + * Initialize WebView. + */ + @Override + @SuppressLint("SetJavaScriptEnabled") + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + isRunningOnTV = Util.isRunningOnTV(WebViewActivity.this); + setContentView(R.layout.activity_web_gui); + webPageUrl = getString(R.string.issue_tracker_url); + mLoadingView = findViewById(R.id.loading); + ((TextView) findViewById(R.id.loading_text)).setText(getString(R.string.web_page_loading, webPageUrl)); + mWebView = findViewById(R.id.webview); + mWebView.getSettings().setJavaScriptEnabled(true); + mWebView.getSettings().setDomStorageEnabled(true); + mWebView.setWebViewClient(mWebViewClient); + mWebView.clearCache(true); + if (mWebView.getUrl() == null) { + mWebView.stopLoading(); + mWebView.loadUrl(webPageUrl); + } + } + + /** + * Saves current tab index and fragment states. + */ + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + Util.dismissDialogSafe(mSecurityNoticeDialog, this); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.webview_options, menu); + return super.onCreateOptionsMenu(menu); + } + + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + menu.findItem(R.id.openBrowser).setVisible(!isRunningOnTV); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.openBrowser: + // This can only be triggered on a non-TV device. + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(webPageUrl))); + finish(); + return true; + default: + return super.onOptionsItemSelected(item); + } + } + + @Override + public void onBackPressed() { + if (mWebView.canGoBack()) { + mWebView.goBack(); + } else { + finish(); + super.onBackPressed(); + } + } + + @Override + public void onPause() { + mWebView.onPause(); + mWebView.pauseTimers(); + super.onPause(); + } + + @Override + public void onResume() { + super.onResume(); + mWebView.resumeTimers(); + mWebView.onResume(); + } + + @Override + protected void onDestroy() { + mWebView.destroy(); + mWebView = null; + super.onDestroy(); + } +} diff --git a/app/src/main/res/drawable-hdpi/ic_open_in_new_white_24.png b/app/src/main/res/drawable-hdpi/ic_open_in_new_white_24.png new file mode 100644 index 00000000..14187285 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_open_in_new_white_24.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_open_in_new_white_24.png b/app/src/main/res/drawable-mdpi/ic_open_in_new_white_24.png new file mode 100644 index 00000000..056acf47 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_open_in_new_white_24.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_open_in_new_white_24.png b/app/src/main/res/drawable-xhdpi/ic_open_in_new_white_24.png new file mode 100644 index 00000000..39a33503 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_open_in_new_white_24.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_open_in_new_white_24.png b/app/src/main/res/drawable-xxhdpi/ic_open_in_new_white_24.png new file mode 100644 index 00000000..04f285cf Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_open_in_new_white_24.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_open_in_new_white_24.png b/app/src/main/res/drawable-xxxhdpi/ic_open_in_new_white_24.png new file mode 100644 index 00000000..08bfc707 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_open_in_new_white_24.png differ diff --git a/app/src/main/res/menu/webview_options.xml b/app/src/main/res/menu/webview_options.xml new file mode 100644 index 00000000..f2401556 --- /dev/null +++ b/app/src/main/res/menu/webview_options.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/app/src/main/res/values-ca-rES/strings.xml b/app/src/main/res/values-ca-rES/strings.xml index 282f16e5..6ef06242 100644 --- a/app/src/main/res/values-ca-rES/strings.xml +++ b/app/src/main/res/values-ca-rES/strings.xml @@ -310,6 +310,7 @@ Esperant interfície gràfica + @@ -515,9 +516,6 @@ Informeu d\'un problema - - Obre el rastrejador de problemes del Syncthing-Fork - Versió del Syncthing diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index bf06bf79..3a1d355f 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -343,6 +343,21 @@ Bitte melden Sie auftretende Probleme via GitHub. Warte auf Weboberfläche + + + + + Sicherheitshinweis + + + Die Webseite \"%1$s\" scheint ein ungültiges SSL-Zertifikat zur Verschlüsselung aufzuweisen. Fortfahren? + + + Lade Webseite:\n%1$s... + + + In Browser öffnen + @@ -562,7 +577,7 @@ Bitte melden Sie auftretende Probleme via GitHub. Fehler melden - Syncthing-Fork Fehlersammlung öffnen + Öffne die Syncthing-Fork Fehlersammlung bei %1$s diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 148ecec9..9e9a4a1b 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -199,6 +199,7 @@ Esperando a la interfaz gráfica + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 63797e20..dc13a9e1 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -228,6 +228,7 @@ En attente de l\'interface WEB + diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 93ae7b00..c0d8ae96 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -225,6 +225,7 @@ Caricamento Interfaccia Web + diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e3f34f97..3fd335ec 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -209,6 +209,7 @@ GUI を待機中 + diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 38e6937c..3a80b026 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -247,6 +247,7 @@ Wachten op interface + diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index a563a810..241b91e8 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -243,6 +243,7 @@ Se așteaptă interfața + diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 799ee914..3b4d7cf9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -285,6 +285,7 @@ Ожидание GUI + diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 6eb71e97..19b66c76 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -297,6 +297,7 @@ Väntar på gränssnitt + diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 15bb0070..2308b16f 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -285,6 +285,7 @@ 正在等待管理页面 + @@ -301,13 +302,21 @@ 运行条件 下方选项将控制 Syncthing 何时启用 + 让它在Wi-Fi上运行 + 设备连接到Wi-Fi网络时运行。 + + 让它在计量Wi-Fi上运行 设备在付费 Wi-Fi 网络环境下启用 Syncthing 警告:可能会产生大量费用 + 在指定的Wi-Fi网络上运行 选择 Wi-Fi 网络 已选择的 Wi-Fi 网络 : %1$s + 未指定Wi-Fi网络。 单击以指定网络。 + 请打开无线网络连接并选择网络 + 需要许可 遵循 Android 电池省电模式设置 省电模式启动时禁用 Syncthing @@ -391,6 +400,8 @@ 强制所有的流量经由 Tor 代理,需要 Orbot,以及禁用其它代理选项。 + SOCKS5 代理 + HTTP(S) 代理 使用传统哈希 强制 Syncthing 使用传统哈希包以提高兼容性 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 4ed20b5d..c0185fbd 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -207,6 +207,7 @@ 正在等待 GUI + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e4cba9a2..50cef47d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -343,6 +343,21 @@ Please report any problems you encounter via Github. Waiting for GUI + + + + + Security Notice + + + Website at %1$s appears to have an invalid certificate for SSL encryption. Proceed? + + + Loading webpage:\n%1$s ... + + + Open in browser + @@ -570,7 +585,7 @@ Please report any problems you encounter via Github. Report Issue - Open the Syncthing-Fork issue tracker + Open the Syncthing-Fork issue tracker at %1$s https://github.com/Catfriend1/syncthing-android/issues diff --git a/app/src/main/res/xml/app_settings.xml b/app/src/main/res/xml/app_settings.xml index 2ed48769..e4cbe589 100644 --- a/app/src/main/res/xml/app_settings.xml +++ b/app/src/main/res/xml/app_settings.xml @@ -213,6 +213,14 @@ + + + + @@ -285,14 +293,6 @@ - - - -