Skip to content

Commit

Permalink
Merge branch 'FernandoNunes'
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoCCNunes committed Sep 28, 2020
2 parents b99aa99 + 09f03fc commit f4e5c4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Context
import android.os.Bundle
import android.os.Parcelable
import android.util.AttributeSet
import android.util.Size
import android.view.View
import android.widget.FrameLayout
import androidx.camera.core.CameraX
Expand Down Expand Up @@ -101,10 +102,19 @@ class ARLocalizerView : FrameLayout, LifecycleObserver {
}

private fun startCameraPreview() {
val preview = AutoFitPreviewBuilder.build(
PreviewConfig.Builder().build(),
texture_view
)
val preview = if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
AutoFitPreviewBuilder.build(
PreviewConfig.Builder()
.setTargetResolution(Size(1080, 1090))
.build(),
texture_view
)
} else {
AutoFitPreviewBuilder.build(
PreviewConfig.Builder().build(),
texture_view
)
}
CameraX.bindToLifecycle(
arLocalizerComponent.arLocalizerDependencyProvider().getARViewLifecycleOwner(),
preview
Expand Down
3 changes: 0 additions & 3 deletions secret.properties

This file was deleted.

0 comments on commit f4e5c4f

Please sign in to comment.