fix(android): adjust for Kotlin and project warnings

This commit is contained in:
Lucas Nogueira
2024-05-30 14:52:47 -03:00
parent f1a60fcb6a
commit acd383af75
25 changed files with 238 additions and 172 deletions
@@ -91,22 +91,10 @@ class GraphicOverlay: View {
return
}
val zLowerBoundInScreenPixel: Float
val zUpperBoundInScreenPixel: Float
if (rescaleZForVisualization) {
zLowerBoundInScreenPixel = (-0.001f).coerceAtMost(scale(zMin))
zUpperBoundInScreenPixel = 0.001f.coerceAtLeast(scale(zMax))
} else {
val defaultRangeFactor = 1f
zLowerBoundInScreenPixel = -defaultRangeFactor * canvas.width
zUpperBoundInScreenPixel = defaultRangeFactor * canvas.width
}
val zInScreenPixel = scale(zInImagePixel)
if (zInScreenPixel < 0) {
val v = (zInScreenPixel / zLowerBoundInScreenPixel * 255).toInt()
paint.setARGB(0, 0, 255, 0)
} else {
val v = (zInScreenPixel / zUpperBoundInScreenPixel * 255).toInt()
paint.setARGB(0, 0, 255, 0)
}
}
@@ -180,7 +168,7 @@ class GraphicOverlay: View {
needUpdateTransformation = false
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
synchronized(lock) {
updateTransformationIfNeeded()