Skip to content

Commit

Permalink
Enable edge-to-edge for the QRScannerActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
t895 authored and thestinger committed Apr 19, 2024
1 parent c2a3b1d commit 86e930d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.os.Handler
import android.os.Looper
import android.util.Size
import android.view.ViewTreeObserver
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.camera.core.Camera
import androidx.camera.core.CameraProvider
Expand All @@ -15,14 +16,15 @@ import androidx.camera.core.FocusMeteringAction
import androidx.camera.core.ImageAnalysis
import androidx.camera.core.MeteringPointFactory
import androidx.camera.core.Preview
import androidx.camera.core.SurfaceOrientedMeteringPointFactory
import androidx.camera.core.resolutionselector.ResolutionSelector
import androidx.camera.core.resolutionselector.ResolutionStrategy
import androidx.camera.core.SurfaceOrientedMeteringPointFactory
import androidx.camera.lifecycle.ProcessCameraProvider
import androidx.camera.view.CameraController
import androidx.camera.view.LifecycleCameraController
import androidx.camera.view.PreviewView
import androidx.core.content.ContextCompat
import androidx.core.view.WindowCompat
import app.attestation.auditor.databinding.ActivityQrscannerBinding
import com.google.android.material.snackbar.Snackbar
import java.util.concurrent.ExecutionException
Expand Down Expand Up @@ -74,11 +76,16 @@ class QRScannerActivity : AppCompatActivity() {
}

public override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
binding = ActivityQrscannerBinding.inflate(layoutInflater)
val view = binding.root
setContentView(view)

val insetsController = WindowCompat.getInsetsController(window, window.decorView)
insetsController.isAppearanceLightStatusBars = false
insetsController.isAppearanceLightNavigationBars = false

binding.contentFrame.scaleType = PreviewView.ScaleType.FIT_CENTER

cameraController = LifecycleCameraController(this)
Expand Down

0 comments on commit 86e930d

Please sign in to comment.