File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
app/src/main/kotlin/com/simplemobiletools/flashlight Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11package com.simplemobiletools.flashlight.activities
22
3+ import android.graphics.drawable.ColorDrawable
34import android.os.Bundle
45import android.view.WindowManager
56
67import com.simplemobiletools.flashlight.R
8+ import com.simplemobiletools.flashlight.extensions.config
9+ import kotlinx.android.synthetic.main.activity_bright_display.*
710
811class BrightDisplayActivity : SimpleActivity () {
912 override fun onCreate (savedInstanceState : Bundle ? ) {
1013 super .onCreate(savedInstanceState)
1114 setContentView(R .layout.activity_bright_display)
1215 supportActionBar?.hide()
16+ display_holder.background = ColorDrawable (config.brightDisplayColor)
1317 }
1418
1519 override fun onResume () {
Original file line number Diff line number Diff line change 11package com.simplemobiletools.flashlight.helpers
22
33import android.content.Context
4+ import android.graphics.Color
45import com.simplemobiletools.commons.helpers.BaseConfig
56
67class Config (context : Context ) : BaseConfig(context) {
@@ -27,4 +28,8 @@ class Config(context: Context) : BaseConfig(context) {
2728 var stroboscopeFrequency: Long
2829 get() = prefs.getLong(STROBOSCOPE_FREQUENCY , 1000L )
2930 set(stroboscopeFrequency) = prefs.edit().putLong(STROBOSCOPE_FREQUENCY , stroboscopeFrequency).apply ()
31+
32+ var brightDisplayColor: Int
33+ get() = prefs.getInt(BRIGHT_DISPLAY_COLOR , Color .WHITE )
34+ set(brightDisplayColor) = prefs.edit().putInt(BRIGHT_DISPLAY_COLOR , brightDisplayColor).apply ()
3035}
Original file line number Diff line number Diff line change 11package com.simplemobiletools.flashlight.helpers
22
33const val BRIGHT_DISPLAY = " bright_display"
4+ const val BRIGHT_DISPLAY_COLOR = " bright_display_color"
45const val STROBOSCOPE = " stroboscope"
56const val TURN_FLASHLIGHT_ON = " turn_flashlight_on"
67const val IS_ENABLED = " is_enabled"
You can’t perform that action at this time.
0 commit comments