From fabd440c547fcf3461cc01c2169b04fe89efd493 Mon Sep 17 00:00:00 2001 From: Kyle Corry Date: Sun, 31 Dec 2023 17:17:50 -0500 Subject: [PATCH] Remove unused methods --- .../trail_sense/shared/views/CameraView.kt | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/app/src/main/java/com/kylecorry/trail_sense/shared/views/CameraView.kt b/app/src/main/java/com/kylecorry/trail_sense/shared/views/CameraView.kt index 487fc9607..c5f307c19 100644 --- a/app/src/main/java/com/kylecorry/trail_sense/shared/views/CameraView.kt +++ b/app/src/main/java/com/kylecorry/trail_sense/shared/views/CameraView.kt @@ -184,32 +184,6 @@ class CameraView(context: Context, attrs: AttributeSet?) : FrameLayout(context, preview.scaleType = type } - private val commonAspectRatios = listOf( - 1f, - 3 / 2f, - 2 / 3f, - 4 / 3f, - 3 / 4f, - 16 / 9f, - 9 / 16f, - ) - - private val aspectRatioPercentTolerance = 0.1f - - fun getPreviewSize(): Size { - val fov = fov - val aspectRatio = fov.first / fov.second - val aspect = commonAspectRatios.minByOrNull { abs(it - aspectRatio) }.let { - if (it == null || abs(it - aspectRatio) / it > aspectRatioPercentTolerance) { - aspectRatio - } else { - it - } - } - val width = preview.width.toFloat() - return Size(width.toInt(), (width / aspect).toInt()) - } - @SuppressLint("UnsafeOptInUsageError") private fun onCameraUpdate(): Boolean { if (zoom == -1f) {