Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14e6b548 authored by tibbi's avatar tibbi
Browse files

use the stored color at bright display

parent 789b66b9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
package com.simplemobiletools.flashlight.activities

import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.WindowManager

import com.simplemobiletools.flashlight.R
import com.simplemobiletools.flashlight.extensions.config
import kotlinx.android.synthetic.main.activity_bright_display.*

class BrightDisplayActivity : SimpleActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_bright_display)
        supportActionBar?.hide()
        display_holder.background = ColorDrawable(config.brightDisplayColor)
    }

    override fun onResume() {
+5 −0
Original line number Diff line number Diff line
package com.simplemobiletools.flashlight.helpers

import android.content.Context
import android.graphics.Color
import com.simplemobiletools.commons.helpers.BaseConfig

class Config(context: Context) : BaseConfig(context) {
@@ -27,4 +28,8 @@ class Config(context: Context) : BaseConfig(context) {
    var stroboscopeFrequency: Long
        get() = prefs.getLong(STROBOSCOPE_FREQUENCY, 1000L)
        set(stroboscopeFrequency) = prefs.edit().putLong(STROBOSCOPE_FREQUENCY, stroboscopeFrequency).apply()

    var brightDisplayColor: Int
        get() = prefs.getInt(BRIGHT_DISPLAY_COLOR, Color.WHITE)
        set(brightDisplayColor) = prefs.edit().putInt(BRIGHT_DISPLAY_COLOR, brightDisplayColor).apply()
}
+1 −0
Original line number Diff line number Diff line
package com.simplemobiletools.flashlight.helpers

const val BRIGHT_DISPLAY = "bright_display"
const val BRIGHT_DISPLAY_COLOR = "bright_display_color"
const val STROBOSCOPE = "stroboscope"
const val TURN_FLASHLIGHT_ON = "turn_flashlight_on"
const val IS_ENABLED = "is_enabled"