This commit is contained in:
小白-白 authored and tarsin committed 2022-12-09 18:20:28 +08:00
1 parent f76fece81d
commit 7d927dde6b
6 files changed
+21 -4

No files matched your search

@@ -170,6 +170,9 @@ class EhApplication : SceneApplication() {
}
fun showEventPane(html: String) {
if (Settings.getHideHvEvents() && html.contains("You have encountered a monster!")) {
return;
}
val activity = topActivity
activity?.runOnUiThread {
val dialog = BaseDialogBuilder(activity)
@@ -67,6 +67,8 @@ public class Settings {
public static final int DEFAULT_DEFAULT_CATEGORIES = EhConfig.ALL_CATEGORY;
public static final String KEY_EXCLUDED_TAG_NAMESPACES = "excluded_tag_namespaces";
public static final String KEY_EXCLUDED_LANGUAGES = "excluded_languages";
private static final String KEY_HIDE_HV_EVENTS = "hide_hv_events";
private static final boolean DEFAULT_HIDE_HV_EVENTS = true;
/********************
****** Privacy and Security
********************/
@@ -551,6 +553,10 @@ public class Settings {
return getBoolean(KEY_REQUEST_NEWS, DEFAULT_REQUEST_NEWS);
}
public static boolean getHideHvEvents() {
return getBoolean(KEY_HIDE_HV_EVENTS, DEFAULT_HIDE_HV_EVENTS);
}
public static boolean getShowJpnTitle() {
return getBoolean(KEY_SHOW_JPN_TITLE, DEFAULT_SHOW_JPN_TITLE);
}
+2 -1
View File
@@ -609,7 +609,8 @@
<string name="settings_eh_metered_network_warning">流量计费网络警告</string>
<string name="metered_network_warning">正在使用流量计费网络</string>
<string name="read_from">从第 %d 页阅读</string>
<string name="settings_request_news_title">启动时请求新闻页面</string>
<string name="settings_eh_request_news">启动时请求新闻页面</string>
<string name="settings_eh_hide_hv_events">隐藏 HV 事件通知</string>
<string name="copy_trans">复制翻译</string>
<string name="reset_download_location">恢复默认路径</string>
<string name="pick_new_download_location">选择新路径</string>
+1 -1
View File
@@ -604,7 +604,7 @@
<string name="settings_eh_metered_network_warning">流量計費網路警告</string>
<string name="metered_network_warning">正在使用流量計費網路</string>
<string name="read_from">從第 %d 頁閱讀</string>
<string name="settings_request_news_title">啟動時請求新聞頁面</string>
<string name="settings_eh_request_news">啟動時請求新聞頁面</string>
<string name="copy_trans">複製翻譯</string>
<string name="reset_download_location">恢復預設路徑</string>
<string name="pick_new_download_location">選擇新路徑</string>
+2 -1
View File
@@ -672,7 +672,8 @@
<string name="settings_eh_metered_network_warning">Metered network warning</string>
<string name="metered_network_warning">Connected to metered networks</string>
<string name="read_from">Read page %d</string>
<string name="settings_request_news_title">Request news page on start</string>
<string name="settings_eh_request_news">Request news page on start</string>
<string name="settings_eh_hide_hv_events">Hide HV event Notifications</string>
<string name="copy_trans">Copy translation</string>
<string name="reset_download_location">Reset to default</string>
<string name="pick_new_download_location">Pick a new location</string>
+7 -1
View File
@@ -173,7 +173,13 @@
<rikka.material.preference.MaterialSwitchPreference
android:defaultValue="true"
android:key="request_news"
android:title="@string/settings_request_news_title"
android:title="@string/settings_eh_request_news"
app:iconSpaceReserved="false" />
<rikka.material.preference.MaterialSwitchPreference
android:defaultValue="true"
android:key="hide_hv_events"
android:title="@string/settings_eh_hide_hv_events"
app:iconSpaceReserved="false" />
</PreferenceScreen>