From ab34e5a19effad724e47e7a25e2db435fca0e93f Mon Sep 17 00:00:00 2001 From: ArcticFoxPro <139336664+ArcticFoxPro@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:11:07 +0800 Subject: [PATCH] Update MainActivity.kt --- .../xiaoniu/qqversionlist/ui/MainActivity.kt | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt index ac160613..1dd15084 100644 --- a/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt +++ b/app/src/main/java/com/xiaoniu/qqversionlist/ui/MainActivity.kt @@ -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,以此类推