Support hide comments, Resolve $454

This commit is contained in:
小白-白 authored and tarsin committed 2022-11-25 10:13:14 +08:00
1 parent e6c5152123
commit 3ea1e1914a
5 files changed
+23 -2

No files matched your search

@@ -62,6 +62,8 @@ public class Settings {
public static final String KEY_DETAIL_SIZE = "detail_size";
public static final String KEY_THUMB_SIZE = "thumb_size";
public static final String KEY_THUMB_RESOLUTION = "thumb_resolution";
private static final String KEY_SHOW_COMMENTS = "show_gallery_comments";
private static final boolean DEFAULT_SHOW_COMMENTS = true;
public static final String KEY_SHOW_TAG_TRANSLATIONS = "show_tag_translations";
public static final String KEY_DEFAULT_CATEGORIES = "default_categories";
public static final int DEFAULT_DEFAULT_CATEGORIES = EhUtils.ALL_CATEGORY;
@@ -557,6 +559,10 @@ public class Settings {
return getIntFromStr(KEY_THUMB_RESOLUTION, DEFAULT_THUMB_RESOLUTION);
}
public static boolean getShowComments() {
return getBoolean(KEY_SHOW_COMMENTS, DEFAULT_SHOW_COMMENTS);
}
public static boolean getRequestNews() {
return getBoolean(KEY_REQUEST_NEWS, DEFAULT_REQUEST_NEWS);
}
@@ -637,8 +637,12 @@ public class GalleryDetailScene extends CollapsingToolbarScene implements View.O
mNoTags = (TextView) ViewUtils.$$(mTags, R.id.no_tags);
mComments = (LinearLayout) ViewUtils.$$(belowHeader, R.id.comments);
mCommentsText = (TextView) ViewUtils.$$(mComments, R.id.comments_text);
mComments.setOnClickListener(this);
if (Settings.getShowComments()) {
mCommentsText = (TextView) ViewUtils.$$(mComments, R.id.comments_text);
mComments.setOnClickListener(this);
} else {
mComments.setVisibility(View.GONE);
}
mPreviews = ViewUtils.$$(belowHeader, R.id.previews);
mGridLayout = (SimpleGridAutoSpanLayout) ViewUtils.$$(mPreviews, R.id.grid_layout);
@@ -386,6 +386,8 @@
<string name="settings_eh_show_jpn_title_summary">需同时在 EHentai 网站设置中启用 Japanese Title</string>
<string name="settings_eh_show_gallery_pages">显示画廊页数</string>
<string name="settings_eh_show_gallery_pages_summary">在画廊列表中显示页数</string>
<string name="settings_eh_show_gallery_comments">显示画廊评论</string>
<string name="settings_eh_show_gallery_comments_summary">在画廊详情页中显示评论</string>
<string name="settings_eh_show_tag_translations">显示标签翻译</string>
<string name="settings_eh_show_tag_translations_summary">显示翻译后的标签而非原始文字(需花费时间来下载数据文件)</string>
<string name="settings_eh_tag_translations_source">补充翻译(由 EhTagTranslation 提供)</string>
+2
View File
@@ -431,6 +431,8 @@
<string name="settings_eh_show_jpn_title_summary">Require enabling Japanese Title in Settings on EHentai website</string>
<string name="settings_eh_show_gallery_pages">Show gallery pages</string>
<string name="settings_eh_show_gallery_pages_summary">Display the number of pages in the gallery list</string>
<string name="settings_eh_show_gallery_comments">Show gallery comments</string>
<string name="settings_eh_show_gallery_comments_summary">Show comments on the gallery details page</string>
<string name="settings_eh_show_tag_translations">Show tag translations</string>
<string name="settings_eh_show_tag_translations_summary">Show tag translations instead of the original text (It takes time to download the data file)</string>
<string name="settings_eh_tag_translations_source">Placeholder</string>
+7
View File
@@ -126,6 +126,13 @@
android:title="@string/settings_eh_show_gallery_pages"
app:iconSpaceReserved="false" />
<rikka.material.preference.MaterialSwitchPreference
android:defaultValue="false"
android:key="show_gallery_comments"
android:summary="@string/settings_eh_show_gallery_comments_summary"
android:title="@string/settings_eh_show_gallery_comments"
app:iconSpaceReserved="false" />
<rikka.material.preference.MaterialSwitchPreference
android:defaultValue="false"
android:key="show_tag_translations"