Skip to content

Commit 15c6a64

Browse files
authored
Add TOPIC_LIST to filterPopular (yujincheng08#1650)
增加了热门选项卡-热门话题的过滤
1 parent 7bedeec commit 15c6a64

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

app/src/main/java/me/iacn/biliroaming/HomeFilterDialog.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class HomeFilterDialog(activity: Activity, prefs: SharedPreferences) :
3030
.let { root.addView(it.first); it.second }
3131
hideFollowSwitch.isChecked = prefs.getBoolean("hide_suggest_follow_popular", false)
3232

33+
val hideTopicListSwitch = switchPrefsItem(string(R.string.hide_topic_list_popular_summary))
34+
.let { root.addView(it.first); it.second }
35+
hideTopicListSwitch.isChecked = prefs.getBoolean("hide_topic_list_popular", false)
36+
3337
val applyToRelateSwitch = switchPrefsItem(string(R.string.apply_to_relate_title))
3438
.let { root.addView(it.first); it.second }
3539
applyToRelateSwitch.isChecked = prefs.getBoolean("home_filter_apply_to_relate", false)
@@ -93,6 +97,7 @@ class HomeFilterDialog(activity: Activity, prefs: SharedPreferences) :
9397
setPositiveButton(android.R.string.ok) { _, _ ->
9498
val hideTop = hideTopSwitch.isChecked
9599
val hideSuggestFollow = hideFollowSwitch.isChecked
100+
val hideTopicList = hideTopicListSwitch.isChecked
96101

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

120125
prefs.edit().apply {
121126
putBoolean("hide_top_entrance_popular", hideTop)
127+
putBoolean("hide_topic_list_popular", hideTopicList)
122128
putBoolean("hide_suggest_follow_popular", hideSuggestFollow)
123129
putLong("hide_low_play_count_recommend_limit", lowPlayCount)
124130
putInt("hide_short_duration_recommend_limit", shortDuration)

app/src/main/java/me/iacn/biliroaming/hook/PegasusHook.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class PegasusHook(classLoader: ClassLoader) : BaseHook(classLoader) {
5050

5151
private val hideTopEntrance = sPrefs.getBoolean("hide_top_entrance_popular", false)
5252
private val hideSuggestFollow = sPrefs.getBoolean("hide_suggest_follow_popular", false)
53+
private val hideTopicList = sPrefs.getBoolean("hide_topic_list_popular", true)
5354

5455
private val filterMap = mapOf(
5556
"advertisement" to listOf("ad", "cm", "cm_v2"),
@@ -708,6 +709,10 @@ class PegasusHook(classLoader: ClassLoader) : BaseHook(classLoader) {
708709
popularDataCount++
709710
return@removeIf hideSuggestFollow
710711
}
712+
"TOPIC_LIST" -> {
713+
popularDataCount++
714+
return@removeIf hideTopicList
715+
}
711716
else -> {
712717
popularDataCount++
713718
return@removeIf false

app/src/main/res/values-zh-rTW/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
<string name="hide_low_play_count_recommend_title">隱藏低播放量影片</string>
102102
<string name="hide_low_play_count_recommend_summary">隱藏低於指定播放量的影片</string>
103103
<string name="hide_top_entrance_popular_summary">隱藏熱門的頂欄(排行榜等)</string>
104+
<string name="hide_topic_list_popular_summary">隱藏熱門的話題</string>
104105
<string name="hide_suggest_follow_popular_summary">隱藏熱門的推薦關注(及其影片)</string>
105106
<string name="add_bangumi_title">新增其他地區番劇</string>
106107
<string name="add_bangumi_summary">在首頁標籤新增大陸/港澳台番劇分頁</string>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<string name="hide_low_play_count_recommend_title">隐藏低播放量视频</string>
104104
<string name="hide_low_play_count_recommend_summary">隐藏低于指定播放量的视频</string>
105105
<string name="hide_top_entrance_popular_summary">隐藏热门的顶栏(排行榜等)</string>
106+
<string name="hide_topic_list_popular_summary">隐藏热门的话题</string>
106107
<string name="hide_suggest_follow_popular_summary">隐藏热门的推荐关注(及其视频)</string>
107108
<string name="add_bangumi_title">添加其他地区番剧</string>
108109
<string name="add_bangumi_summary">在首页标签添加大陆/港澳台番剧分页</string>

0 commit comments

Comments
 (0)