Skip to content

Commit 98af40a

Browse files
committed
Add code to save low light boost preference
1 parent e152d82 commit 98af40a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

app/src/main/java/app/grapheneos/camera/CamConfig.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ class CamConfig(private val mActivity: MainActivity) {
114114

115115
const val ENABLE_ZSL = "enable_zsl"
116116

117+
const val LOW_LIGHT_BOOST = "low_light_boost"
118+
117119
// const val IMAGE_FILE_FORMAT = "image_quality"
118120
// const val VIDEO_FILE_FORMAT = "video_quality"
119121
}
@@ -159,6 +161,8 @@ class CamConfig(private val mActivity: MainActivity) {
159161

160162
const val ENABLE_ZSL = false
161163

164+
const val LOW_LIGHT_BOOST = true
165+
162166
// const val IMAGE_FILE_FORMAT = ""
163167
// const val VIDEO_FILE_FORMAT = ""
164168
}
@@ -558,6 +562,19 @@ class CamConfig(private val mActivity: MainActivity) {
558562
editor.apply()
559563
}
560564

565+
var lowLightBoost: Boolean
566+
get() {
567+
return commonPref.getBoolean(
568+
SettingValues.Key.LOW_LIGHT_BOOST,
569+
SettingValues.Default.LOW_LIGHT_BOOST
570+
)
571+
}
572+
set(value) {
573+
val editor = commonPref.edit()
574+
editor.putBoolean(SettingValues.Key.LOW_LIGHT_BOOST, value)
575+
editor.apply()
576+
}
577+
561578
val isZslSupported : Boolean by lazy {
562579
camera!!.cameraInfo.isZslSupported
563580
}

0 commit comments

Comments
 (0)