Replace old design with redesign (p3)

This commit is contained in:
topjohnwu
2020-01-12 21:52:32 +08:00
parent 9094cf7ce3
commit 1449486958
18 changed files with 25 additions and 453 deletions
@@ -10,6 +10,7 @@ import androidx.core.view.get
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import com.topjohnwu.magisk.extensions.drawableCompat
import kotlin.math.roundToInt
class KItemDecoration(
private val context: Context,
@@ -63,7 +64,7 @@ class KItemDecoration(
.map { parent[it] }
.forEach { child ->
parent.getDecoratedBoundsWithMargins(child, bounds)
val bottom = bounds.bottom + Math.round(child.translationY)
val bottom = bounds.bottom + child.translationY.roundToInt()
val top = bottom - drawable.intrinsicHeight
drawable.setBounds(left, top, right, bottom)
drawable.draw(canvas)
@@ -93,7 +94,7 @@ class KItemDecoration(
.map { parent[it] }
.forEach { child ->
parent.layoutManager!!.getDecoratedBoundsWithMargins(child, bounds)
val right = bounds.right + Math.round(child.translationX)
val right = bounds.right + child.translationX.roundToInt()
val left = right - drawable.intrinsicWidth
drawable.setBounds(left, top, right, bottom)
drawable.draw(canvas)
@@ -114,4 +115,4 @@ class KItemDecoration(
}
}
}
}
@@ -12,10 +12,10 @@ interface SafetyNetHelper {
companion object {
val RESPONSE_ERR = 0x01
val CONNECTION_FAIL = 0x02
const val RESPONSE_ERR = 0x01
const val CONNECTION_FAIL = 0x02
val BASIC_PASS = 0x10
val CTS_PASS = 0x20
const val BASIC_PASS = 0x10
const val CTS_PASS = 0x20
}
}