fix: 修复 Bugs

This commit is contained in:
HuanCheng65 2022-08-06 09:39:47 +08:00
parent 4b3e3346bb
commit 511f792b3a
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
2 changed files with 9 additions and 5 deletions

View File

@ -298,12 +298,16 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
} }
private fun List<ForumRecommend.LikeForum>.addFakeItems(divisor: Int): List<ForumRecommend.LikeForum> { private fun List<ForumRecommend.LikeForum>.addFakeItems(divisor: Int): List<ForumRecommend.LikeForum> {
val fakeItemCount = divisor - (size % divisor) val mod = size % divisor
return toMutableList().apply { if (mod > 0) {
repeat(fakeItemCount) { val fakeItemCount = divisor - mod
add(ForumRecommend.LikeForum("", "", "1", "0", "", isFake = true)) return toMutableList().apply {
repeat(fakeItemCount) {
add(ForumRecommend.LikeForum("", "", "1", "0", "", isFake = true))
}
} }
} }
return this
} }
override fun onRefresh() { override fun onRefresh() {

View File

@ -371,7 +371,7 @@ object ThemeUtil {
} }
@JvmStatic @JvmStatic
fun setTranslucentThemeBackground(view: View) { fun setTranslucentThemeBackground(view: View?) {
setTranslucentThemeBackground(view, true, false) setTranslucentThemeBackground(view, true, false)
} }