|
|
@ -33,7 +33,8 @@ import org.isoron.uhabits.HabitsApplication
|
|
|
|
import org.isoron.uhabits.R
|
|
|
|
import org.isoron.uhabits.R
|
|
|
|
import org.isoron.uhabits.activities.AndroidThemeSwitcher
|
|
|
|
import org.isoron.uhabits.activities.AndroidThemeSwitcher
|
|
|
|
import org.isoron.uhabits.core.models.Habit
|
|
|
|
import org.isoron.uhabits.core.models.Habit
|
|
|
|
import org.isoron.uhabits.core.ui.ThemeSwitcher.Companion.THEME_LIGHT
|
|
|
|
import org.isoron.uhabits.core.ui.views.DarkTheme
|
|
|
|
|
|
|
|
import org.isoron.uhabits.core.ui.views.LightTheme
|
|
|
|
import org.isoron.uhabits.receivers.ReminderController
|
|
|
|
import org.isoron.uhabits.receivers.ReminderController
|
|
|
|
import org.isoron.uhabits.utils.SystemUtils
|
|
|
|
import org.isoron.uhabits.utils.SystemUtils
|
|
|
|
import java.util.Calendar
|
|
|
|
import java.util.Calendar
|
|
|
@ -51,11 +52,8 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
|
|
|
|
val app = applicationContext as HabitsApplication
|
|
|
|
val app = applicationContext as HabitsApplication
|
|
|
|
val appComponent = app.component
|
|
|
|
val appComponent = app.component
|
|
|
|
val themeSwitcher = AndroidThemeSwitcher(this, appComponent.preferences)
|
|
|
|
val themeSwitcher = AndroidThemeSwitcher(this, appComponent.preferences)
|
|
|
|
if (themeSwitcher.getSystemTheme() == THEME_LIGHT) {
|
|
|
|
themeSwitcher.setTheme()
|
|
|
|
setTheme(R.style.BaseDialog)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
setTheme(R.style.BaseDialogDark)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
val data = intent.data
|
|
|
|
val data = intent.data
|
|
|
|
if (data == null) {
|
|
|
|
if (data == null) {
|
|
|
|
finish()
|
|
|
|
finish()
|
|
|
@ -75,6 +73,16 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
|
|
|
|
SystemUtils.unlockScreen(this)
|
|
|
|
SystemUtils.unlockScreen(this)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun AndroidThemeSwitcher.setTheme() {
|
|
|
|
|
|
|
|
if (this.isNightMode) {
|
|
|
|
|
|
|
|
setTheme(R.style.BaseDialogDark)
|
|
|
|
|
|
|
|
this.currentTheme = DarkTheme()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
setTheme(R.style.BaseDialog)
|
|
|
|
|
|
|
|
this.currentTheme = LightTheme()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun showTimePicker() {
|
|
|
|
private fun showTimePicker() {
|
|
|
|
val calendar = Calendar.getInstance()
|
|
|
|
val calendar = Calendar.getInstance()
|
|
|
|
val dialog = TimePickerDialog.newInstance(
|
|
|
|
val dialog = TimePickerDialog.newInstance(
|
|
|
|