mirror of
				https://github.com/SimpleMobileTools/Simple-Flashlight.git
				synced 2025-06-05 21:59:19 +02:00 
			
		
		
		
	require Simple Thank You for widgets
This commit is contained in:
		| @@ -7,6 +7,7 @@ import android.graphics.Color | |||||||
| import android.os.Bundle | import android.os.Bundle | ||||||
| import android.widget.SeekBar | import android.widget.SeekBar | ||||||
| import com.simplemobiletools.commons.dialogs.ColorPickerDialog | import com.simplemobiletools.commons.dialogs.ColorPickerDialog | ||||||
|  | import com.simplemobiletools.commons.dialogs.WidgetLockedDialog | ||||||
| import com.simplemobiletools.commons.extensions.* | import com.simplemobiletools.commons.extensions.* | ||||||
| import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS | import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS | ||||||
| import com.simplemobiletools.flashlight.R | import com.simplemobiletools.flashlight.R | ||||||
| @@ -19,6 +20,7 @@ class WidgetBrightDisplayConfigureActivity : SimpleActivity() { | |||||||
|     private var mWidgetId = 0 |     private var mWidgetId = 0 | ||||||
|     private var mWidgetColor = 0 |     private var mWidgetColor = 0 | ||||||
|     private var mWidgetColorWithoutTransparency = 0 |     private var mWidgetColorWithoutTransparency = 0 | ||||||
|  |     private var mWidgetLockedDialog: WidgetLockedDialog? = null | ||||||
|  |  | ||||||
|     public override fun onCreate(savedInstanceState: Bundle?) { |     public override fun onCreate(savedInstanceState: Bundle?) { | ||||||
|         useDynamicTheme = false |         useDynamicTheme = false | ||||||
| @@ -39,6 +41,23 @@ class WidgetBrightDisplayConfigureActivity : SimpleActivity() { | |||||||
|  |  | ||||||
|         val primaryColor = getProperPrimaryColor() |         val primaryColor = getProperPrimaryColor() | ||||||
|         config_widget_seekbar.setColors(getProperTextColor(), primaryColor, primaryColor) |         config_widget_seekbar.setColors(getProperTextColor(), primaryColor, primaryColor) | ||||||
|  |  | ||||||
|  |         if (!isCustomizingColors && !isOrWasThankYouInstalled()) { | ||||||
|  |             mWidgetLockedDialog = WidgetLockedDialog(this) { | ||||||
|  |                 if (!isOrWasThankYouInstalled()) { | ||||||
|  |                     finish() | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     override fun onResume() { | ||||||
|  |         super.onResume() | ||||||
|  |         window.decorView.setBackgroundColor(0) | ||||||
|  |  | ||||||
|  |         if (mWidgetLockedDialog != null && isOrWasThankYouInstalled()) { | ||||||
|  |             mWidgetLockedDialog?.dismissDialog() | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun initVariables() { |     private fun initVariables() { | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ import android.graphics.Color | |||||||
| import android.os.Bundle | import android.os.Bundle | ||||||
| import android.widget.SeekBar | import android.widget.SeekBar | ||||||
| import com.simplemobiletools.commons.dialogs.ColorPickerDialog | import com.simplemobiletools.commons.dialogs.ColorPickerDialog | ||||||
|  | import com.simplemobiletools.commons.dialogs.WidgetLockedDialog | ||||||
| import com.simplemobiletools.commons.extensions.* | import com.simplemobiletools.commons.extensions.* | ||||||
| import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS | import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS | ||||||
| import com.simplemobiletools.flashlight.R | import com.simplemobiletools.flashlight.R | ||||||
| @@ -20,6 +21,7 @@ class WidgetTorchConfigureActivity : SimpleActivity() { | |||||||
|     private var mWidgetId = 0 |     private var mWidgetId = 0 | ||||||
|     private var mWidgetColor = 0 |     private var mWidgetColor = 0 | ||||||
|     private var mWidgetColorWithoutTransparency = 0 |     private var mWidgetColorWithoutTransparency = 0 | ||||||
|  |     private var mWidgetLockedDialog: WidgetLockedDialog? = null | ||||||
|  |  | ||||||
|     public override fun onCreate(savedInstanceState: Bundle?) { |     public override fun onCreate(savedInstanceState: Bundle?) { | ||||||
|         useDynamicTheme = false |         useDynamicTheme = false | ||||||
| @@ -40,6 +42,23 @@ class WidgetTorchConfigureActivity : SimpleActivity() { | |||||||
|  |  | ||||||
|         val primaryColor = getProperPrimaryColor() |         val primaryColor = getProperPrimaryColor() | ||||||
|         config_widget_seekbar.setColors(getProperTextColor(), primaryColor, primaryColor) |         config_widget_seekbar.setColors(getProperTextColor(), primaryColor, primaryColor) | ||||||
|  |  | ||||||
|  |         if (!isCustomizingColors && !isOrWasThankYouInstalled()) { | ||||||
|  |             mWidgetLockedDialog = WidgetLockedDialog(this) { | ||||||
|  |                 if (!isOrWasThankYouInstalled()) { | ||||||
|  |                     finish() | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     override fun onResume() { | ||||||
|  |         super.onResume() | ||||||
|  |         window.decorView.setBackgroundColor(0) | ||||||
|  |  | ||||||
|  |         if (mWidgetLockedDialog != null && isOrWasThankYouInstalled()) { | ||||||
|  |             mWidgetLockedDialog?.dismissDialog() | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun initVariables() { |     private fun initVariables() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user