Skip to content

Commit

Permalink
Merge pull request #1 from Bostwickenator/master
Browse files Browse the repository at this point in the history
Add screen wakelock
  • Loading branch information
kambara authored Jul 17, 2022
2 parents afce301 + c5c89a2 commit 9220f09
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 9220f09

Please sign in to comment.