diff --git a/app/src/main/java/com/hippo/ehviewer/ui/UConfigActivity.java b/app/src/main/java/com/hippo/ehviewer/ui/UConfigActivity.java
index 3a68f2f8d..736f815da 100644
--- a/app/src/main/java/com/hippo/ehviewer/ui/UConfigActivity.java
+++ b/app/src/main/java/com/hippo/ehviewer/ui/UConfigActivity.java
@@ -27,6 +27,7 @@ import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.view.Menu;
import android.view.MenuItem;
@@ -82,12 +83,23 @@ public class UConfigActivity extends ToolbarActivity {
}
setContentView(R.layout.activity_u_config);
+ setNavigationIcon(R.drawable.v_arrow_left_dark_x24);
webView = (WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new UConfigWebViewClient());
webView.setWebChromeClient(new UConfigWebChromeClient());
webView.loadUrl(url);
progress = (ProgressView) findViewById(R.id.progress);
+
+ Snackbar.make(webView, R.string.apply_tip, Snackbar.LENGTH_LONG).show();
+ }
+
+ private void apply() {
+ webView.loadUrl("javascript:"
+ + "(function() {\n"
+ + " var apply = document.getElementById(\"apply\").children[0];\n"
+ + " apply.click();\n"
+ + "})();");
}
@Override
@@ -105,11 +117,7 @@ public class UConfigActivity extends ToolbarActivity {
return true;
case R.id.action_apply:
if (loaded) {
- webView.loadUrl("javascript:"
- + "(function() {\n"
- + " var apply = document.getElementById(\"apply\").children[0];\n"
- + " apply.click();\n"
- + "})();");
+ apply();
}
return true;
default:
@@ -210,8 +218,7 @@ public class UConfigActivity extends ToolbarActivity {
return true;
}
- @Override
- public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
+ private void showMessageDialog(String message, final JsResult result) {
new AlertDialog.Builder(context)
.setMessage(message)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@@ -227,28 +234,17 @@ public class UConfigActivity extends ToolbarActivity {
}
})
.show();
+ }
+ @Override
+ public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
+ showMessageDialog(message, result);
return true;
}
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
- new AlertDialog.Builder(context)
- .setMessage(message)
- .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- result.confirm();
- }
- })
- .setOnCancelListener(new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- result.cancel();
- }
- })
- .show();
-
+ showMessageDialog(message, result);
return true;
}
}
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 4dededdb7..eb7109be1 100755
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -351,6 +351,7 @@
EHentai 设置
应用
+ 点击右上角的对勾来保存设置
第 %d 页
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index fadf73abd..696f5841a 100755
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -351,6 +351,7 @@
EHentai 設置
應用
+ 點擊右上角的對勾來保存設置
第 %d 頁
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 4e2c00bae..05f57bf58 100755
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -351,6 +351,7 @@
EHentai 設定
應用
+ 點選右上角的對勾來儲存設定
第 %d 頁
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 9a9e1bd5c..b6d54b559 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -395,6 +395,7 @@
EHentai settings
Apply
+ Click the check mark to save the settings
Page %d