require Simple Thank You for widgets
This commit is contained in:
parent
807bf5d4c1
commit
e809269e58
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue