Skip to content

Commit

Permalink
Update MainActivity.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticFoxPro committed Mar 12, 2024
1 parent 951c474 commit ab34e5a
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 ab34e5a

Please sign in to comment.