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,13 +298,17 @@ 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
if (mod > 0) {
val fakeItemCount = divisor - mod
return toMutableList().apply { return toMutableList().apply {
repeat(fakeItemCount) { repeat(fakeItemCount) {
add(ForumRecommend.LikeForum("", "", "1", "0", "", isFake = true)) add(ForumRecommend.LikeForum("", "", "1", "0", "", isFake = true))
} }
} }
} }
return this
}
override fun onRefresh() { override fun onRefresh() {
if (isFragmentVisible) { if (isFragmentVisible) {

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)
} }