@@ -126,12 +126,12 @@ class MainActivity : AppCompatActivity() {
126126 })
127127
128128 // Setup light sensor
129- lightSeekBar? .progress = lightSensitivity
129+ lightSeekBar.progress = lightSensitivity
130130 val lightThreshold = calculateLightThreshold(lightSensitivity)
131131 val lightThresholdPercent = ((lightThreshold / LIGHT_MAX_LEVEL ) * 100f ).coerceIn(0f , 100f ).toInt()
132- lightValue? .text = if (lightSensitivity == 0 ) getString(R .string.disabled_caps) else " $lightThresholdPercent %"
132+ lightValue.text = if (lightSensitivity == 0 ) getString(R .string.disabled_caps) else " $lightThresholdPercent %"
133133
134- lightSeekBar? .setOnSeekBarChangeListener(object : SeekBar .OnSeekBarChangeListener {
134+ lightSeekBar.setOnSeekBarChangeListener(object : SeekBar .OnSeekBarChangeListener {
135135 override fun onProgressChanged (seekBar : SeekBar ? , progress : Int , fromUser : Boolean ) {
136136 val threshold = calculateLightThreshold(progress)
137137 val thresholdPercent = ((threshold / LIGHT_MAX_LEVEL ) * 100f ).coerceIn(0f , 100f ).toInt()
@@ -296,14 +296,14 @@ class MainActivity : AppCompatActivity() {
296296 val lightSensitivity = prefs.getInt(KEY_LIGHT_SENSITIVITY , 50 )
297297 if (lightSensitivity == 0 ) {
298298 // Don't update display when disabled
299- binding.lightValue? .text = getString(R .string.disabled_caps)
299+ binding.lightValue.text = getString(R .string.disabled_caps)
300300 } else {
301301 // Convert light level to percentage (0-5 lux -> 0-100%)
302302 val levelPercent = ((currentLevel / LIGHT_MAX_LEVEL ) * 100f ).coerceIn(0f , 100f ).toInt()
303303 val thresholdPercent = ((threshold / LIGHT_MAX_LEVEL ) * 100f ).coerceIn(0f , 100f ).toInt()
304- binding.lightLiveReading? .text = " $emoji Current activity level: $levelPercent %"
304+ binding.lightLiveReading.text = " $emoji Current activity level: $levelPercent %"
305305 // Also update the slider value display with threshold
306- binding.lightValue? .text = " $thresholdPercent %"
306+ binding.lightValue.text = " $thresholdPercent %"
307307 }
308308 }
309309 }
0 commit comments