Skip to content

Commit 3163ef6

Browse files
author
Rob Rogers
committed
undim to system default brightness
1 parent 9e26caa commit 3163ef6

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

app/src/main/java/com/immichframe/immichframe/MainActivity.kt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -675,19 +675,14 @@ class MainActivity : AppCompatActivity() {
675675
}
676676

677677
private fun screenDim(dim: Boolean) {
678-
val lp = WindowManager.LayoutParams()
679-
lp.copyFrom(window.attributes)
678+
val lp = window.attributes
680679
if (dim) {
681680
lp.screenBrightness = 0.01f
682681
window.attributes = lp
683682
if (dimOverlay.visibility != View.VISIBLE) {
684683
dimOverlay.apply {
685684
visibility = View.VISIBLE
686685
alpha = 0f
687-
/* isClickable = true
688-
setOnClickListener {
689-
screenDim(false)
690-
}*/
691686
stopImageTimer()
692687
stopWeatherTimer()
693688
animate()
@@ -697,15 +692,12 @@ class MainActivity : AppCompatActivity() {
697692
}
698693
}
699694
} else {
700-
lp.screenBrightness = 1f
695+
lp.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE
701696
window.attributes = lp
702697
if (dimOverlay.visibility == View.VISIBLE) {
703698
dimOverlay.animate()
704699
.alpha(0f)
705700
.setDuration(500L)
706-
/*.withStartAction {
707-
dimOverlay.isClickable = false
708-
}*/
709701
.withEndAction {
710702
dimOverlay.visibility = View.GONE
711703
loadSettings()

0 commit comments

Comments
 (0)