Skip to content

Commit

Permalink
Add screen wakelock
Browse files Browse the repository at this point in the history
  • Loading branch information
Bostwickenator committed Jul 17, 2022
1 parent afce301 commit c5c89a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/org/sappari/air_visualizer/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.os.Bundle
import android.util.Log
import android.util.Size
import android.view.WindowInsets
import android.view.WindowManager
import android.widget.Toast
import androidx.camera.core.*
import androidx.camera.lifecycle.ProcessCameraProvider
Expand Down Expand Up @@ -71,6 +72,7 @@ class MainActivity : AppCompatActivity() {
viewBinding.radioLaminarFlow.isEnabled = false
viewBinding.radioTurbulentFlow.isEnabled = false
viewBinding.buttonReset.isEnabled = true
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
else -> {
setFocusAuto()
Expand All @@ -79,6 +81,7 @@ class MainActivity : AppCompatActivity() {
viewBinding.radioLaminarFlow.isEnabled = true
viewBinding.radioTurbulentFlow.isEnabled = true
viewBinding.buttonReset.isEnabled = false
window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
}
}
Expand Down

0 comments on commit c5c89a2

Please sign in to comment.