Skip to content

Commit

Permalink
Disable stabilization on sighting compass
Browse files Browse the repository at this point in the history
Closes #2017
  • Loading branch information
kylecorry31 committed Oct 23, 2023
1 parent 1320bd7 commit a2e6aae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ dependencies {
implementation("com.google.android.flexbox:flexbox:3.0.0")

// Andromeda
val andromedaVersion = "4bbe6781d4"
val andromedaVersion = "f3888f875b"
implementation("com.github.kylecorry31.andromeda:core:$andromedaVersion")
implementation("com.github.kylecorry31.andromeda:fragments:$andromedaVersion")
implementation("com.github.kylecorry31.andromeda:forms:$andromedaVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class SightingCompassView(
return
}
try {
camera.start()
camera.start(
shouldStabilizePreview = false
)
} catch (e: Exception) {
e.printStackTrace()
Alerts.toast(camera.context, camera.context.getString(R.string.no_camera_access))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class SightingCompassBottomSheetFragment(
binding.camera.setScaleType(PreviewView.ScaleType.FIT_CENTER)
binding.camera.start(
lifecycleOwner = this,
readFrames = false
readFrames = false,
shouldStabilizePreview = false
)

binding.toolTitle.rightButton.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CameraView(context: Context, attrs: AttributeSet?) : FrameLayout(context,
lifecycleOwner: LifecycleOwner? = null,
captureSettings: ImageCaptureSettings? = null,
readFrames: Boolean = true,
shouldStabilizePreview: Boolean = true,
onImage: ((Bitmap) -> Unit)? = null
) {
val owner = lifecycleOwner ?: this.findViewTreeLifecycleOwner() ?: return
Expand Down Expand Up @@ -91,7 +92,8 @@ class CameraView(context: Context, attrs: AttributeSet?) : FrameLayout(context,
analyze = readFrames,
targetResolution = resolution,
captureSettings = captureSettings,
isBackCamera = useBackCamera
isBackCamera = useBackCamera,
shouldStabilizePreview = shouldStabilizePreview
)
camera?.start(this::onCameraUpdate)
}
Expand Down

0 comments on commit a2e6aae

Please sign in to comment.