@@ -7,6 +7,7 @@ import android.graphics.Color
77import android.os.Bundle
88import android.widget.SeekBar
99import com.simplemobiletools.commons.dialogs.ColorPickerDialog
10+ import com.simplemobiletools.commons.dialogs.WidgetLockedDialog
1011import com.simplemobiletools.commons.extensions.*
1112import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
1213import com.simplemobiletools.flashlight.R
@@ -19,6 +20,7 @@ class WidgetBrightDisplayConfigureActivity : SimpleActivity() {
1920 private var mWidgetId = 0
2021 private var mWidgetColor = 0
2122 private var mWidgetColorWithoutTransparency = 0
23+ private var mWidgetLockedDialog: WidgetLockedDialog ? = null
2224
2325 public override fun onCreate (savedInstanceState : Bundle ? ) {
2426 useDynamicTheme = false
@@ -39,6 +41,23 @@ class WidgetBrightDisplayConfigureActivity : SimpleActivity() {
3941
4042 val primaryColor = getProperPrimaryColor()
4143 config_widget_seekbar.setColors(getProperTextColor(), primaryColor, primaryColor)
44+
45+ if (! isCustomizingColors && ! isOrWasThankYouInstalled()) {
46+ mWidgetLockedDialog = WidgetLockedDialog (this ) {
47+ if (! isOrWasThankYouInstalled()) {
48+ finish()
49+ }
50+ }
51+ }
52+ }
53+
54+ override fun onResume () {
55+ super .onResume()
56+ window.decorView.setBackgroundColor(0 )
57+
58+ if (mWidgetLockedDialog != null && isOrWasThankYouInstalled()) {
59+ mWidgetLockedDialog?.dismissDialog()
60+ }
4261 }
4362
4463 private fun initVariables () {
0 commit comments