mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Issue 1574: Fixed the almost invisible watch hands in snooze activity (#1592)
* Setting the current theme correctly * Ktlint correction
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user