Skip to content

Commit 0f78e50

Browse files
committed
Make low light boost setting functional
1 parent 98af40a commit 0f78e50

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

app/src/main/java/app/grapheneos/camera/ui/activities/MoreSettings.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.content.Context
44
import android.content.Intent
55
import android.graphics.Color
66
import android.graphics.Rect
7+
import android.os.Build
78
import android.os.Bundle
89
import android.view.KeyEvent
910
import android.view.MotionEvent
@@ -236,6 +237,22 @@ open class MoreSettings : AppCompatActivity(), TextView.OnEditorActionListener {
236237
}
237238
}
238239

240+
// Setting only for Android 15 and above
241+
val lowLightBoostSetting = binding.lowLightBoostSetting
242+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
243+
lowLightBoostSetting.visibility = View.VISIBLE
244+
245+
val lowLightToggle = binding.lowLightBoostToggle
246+
lowLightToggle.isChecked = camConfig.lowLightBoost
247+
lowLightToggle.setOnClickListener {
248+
camConfig.lowLightBoost = !camConfig.lowLightBoost
249+
}
250+
251+
lowLightBoostSetting.setOnClickListener {
252+
lowLightToggle.performClick()
253+
}
254+
}
255+
239256
if (!showStorageSettings) {
240257
binding.storageLocationSettings.visibility = View.GONE
241258
}

0 commit comments

Comments
 (0)