Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/src/main/java/me/iacn/biliroaming/HomeFilterDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class HomeFilterDialog(activity: Activity, prefs: SharedPreferences) :
.let { root.addView(it.first); it.second }
hideFollowSwitch.isChecked = prefs.getBoolean("hide_suggest_follow_popular", false)

val hideTopicListSwitch = switchPrefsItem(string(R.string.hide_topic_list_popular_summary))
.let { root.addView(it.first); it.second }
hideTopicListSwitch.isChecked = prefs.getBoolean("hide_topic_list_popular", false)

val applyToRelateSwitch = switchPrefsItem(string(R.string.apply_to_relate_title))
.let { root.addView(it.first); it.second }
applyToRelateSwitch.isChecked = prefs.getBoolean("home_filter_apply_to_relate", false)
Expand Down Expand Up @@ -93,6 +97,7 @@ class HomeFilterDialog(activity: Activity, prefs: SharedPreferences) :
setPositiveButton(android.R.string.ok) { _, _ ->
val hideTop = hideTopSwitch.isChecked
val hideSuggestFollow = hideFollowSwitch.isChecked
val hideTopicList = hideTopicListSwitch.isChecked

val lowPlayCount = lowPlayCountInput.text.toString().toLongOrNull() ?: 0
val shortDuration = shortDurationInput.text.toString().toIntOrNull() ?: 0
Expand All @@ -119,6 +124,7 @@ class HomeFilterDialog(activity: Activity, prefs: SharedPreferences) :

prefs.edit().apply {
putBoolean("hide_top_entrance_popular", hideTop)
putBoolean("hide_topic_list_popular", hideTopicList)
putBoolean("hide_suggest_follow_popular", hideSuggestFollow)
putLong("hide_low_play_count_recommend_limit", lowPlayCount)
putInt("hide_short_duration_recommend_limit", shortDuration)
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/me/iacn/biliroaming/hook/PegasusHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class PegasusHook(classLoader: ClassLoader) : BaseHook(classLoader) {

private val hideTopEntrance = sPrefs.getBoolean("hide_top_entrance_popular", false)
private val hideSuggestFollow = sPrefs.getBoolean("hide_suggest_follow_popular", false)
private val hideTopicList = sPrefs.getBoolean("hide_topic_list_popular", true)

private val filterMap = mapOf(
"advertisement" to listOf("ad", "cm", "cm_v2"),
Expand Down Expand Up @@ -708,6 +709,10 @@ class PegasusHook(classLoader: ClassLoader) : BaseHook(classLoader) {
popularDataCount++
return@removeIf hideSuggestFollow
}
"TOPIC_LIST" -> {
popularDataCount++
return@removeIf hideTopicList
}
else -> {
popularDataCount++
return@removeIf false
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<string name="hide_low_play_count_recommend_title">隱藏低播放量影片</string>
<string name="hide_low_play_count_recommend_summary">隱藏低於指定播放量的影片</string>
<string name="hide_top_entrance_popular_summary">隱藏熱門的頂欄(排行榜等)</string>
<string name="hide_topic_list_popular_summary">隱藏熱門的話題</string>
<string name="hide_suggest_follow_popular_summary">隱藏熱門的推薦關注(及其影片)</string>
<string name="add_bangumi_title">新增其他地區番劇</string>
<string name="add_bangumi_summary">在首頁標籤新增大陸/港澳台番劇分頁</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<string name="hide_low_play_count_recommend_title">隐藏低播放量视频</string>
<string name="hide_low_play_count_recommend_summary">隐藏低于指定播放量的视频</string>
<string name="hide_top_entrance_popular_summary">隐藏热门的顶栏(排行榜等)</string>
<string name="hide_topic_list_popular_summary">隐藏热门的话题</string>
<string name="hide_suggest_follow_popular_summary">隐藏热门的推荐关注(及其视频)</string>
<string name="add_bangumi_title">添加其他地区番剧</string>
<string name="add_bangumi_summary">在首页标签添加大陆/港澳台番剧分页</string>
Expand Down