Skip to content

Commit

Permalink
Merge pull request #10 from ArcticFoxPro/master
Browse files Browse the repository at this point in the history
Update MainActivity.kt
  • Loading branch information
ArcticFoxPro authored Mar 12, 2024
2 parents 951c474 + ab34e5a commit 186efe5
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,6 @@ class MainActivity : AppCompatActivity() {
}
}

fun Context.dpToPx(dp: Int): Int {
return (dp * resources.displayMetrics.density).toInt()
}

class VerticalSpaceItemDecoration(private val space: Int) : RecyclerView.ItemDecoration() {
override fun getItemOffsets(
outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State
) {
with(outRect) {
// 对于每一项都添加底部间距
bottom = space
// 如果不是第一行,则添加顶部间距
if (parent.getChildAdapterPosition(view) != 0) {
top = space
}
}
}
}


private fun initButtons() {
//这里的“getInt: userAgreement”的值代表着用户协议修订版本,后续更新协议版本后也需要在下面一行把“judgeUARead”+1,以此类推
Expand Down

0 comments on commit 186efe5

Please sign in to comment.