Fix dark theme toggle issue
This commit is contained in:
@ -32,15 +32,11 @@ class ActivityDetectionReceiver : BroadcastReceiver() {
|
||||
|
||||
if (lastEvent.activityType == DetectedActivity.WALKING || lastEvent.activityType == DetectedActivity.RUNNING && lastEvent.transitionType == ActivityTransition.ACTIVITY_TRANSITION_EXIT) {
|
||||
requestDailySteps(context)
|
||||
setTimeout(context)
|
||||
} else {
|
||||
resetDailySteps()
|
||||
}
|
||||
} else {
|
||||
if (intent.action == Intent.ACTION_BOOT_COMPLETED || intent.action == Intent.ACTION_MY_PACKAGE_REPLACED && Preferences.showDailySteps && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q || context.checkGrantedPermission(Manifest.permission.ACTIVITY_RECOGNITION)) {
|
||||
registerFence(context)
|
||||
} else {
|
||||
resetDailySteps()
|
||||
registerFence(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,6 +150,7 @@ class ActivityDetectionReceiver : BroadcastReceiver() {
|
||||
}
|
||||
}.toLong()
|
||||
MainWidget.updateWidget(context)
|
||||
setTimeout(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +81,8 @@ class CalendarTabFragment : Fragment() {
|
||||
binding: FragmentCalendarSettingsBinding,
|
||||
viewModel: MainViewModel
|
||||
) {
|
||||
binding.isCalendarEnabled = Preferences.showEvents
|
||||
|
||||
viewModel.showEvents.observe(viewLifecycleOwner, Observer {
|
||||
maintainScrollPosition {
|
||||
binding.isCalendarEnabled = it
|
||||
|
@ -85,6 +85,8 @@ class ClockTabFragment : Fragment() {
|
||||
binding: FragmentClockSettingsBinding,
|
||||
viewModel: MainViewModel
|
||||
) {
|
||||
binding.isClockVisible = Preferences.showClock
|
||||
|
||||
viewModel.showBigClockWarning.observe(viewLifecycleOwner, Observer {
|
||||
large_clock_warning?.isVisible = it
|
||||
small_clock_warning?.isVisible = !it
|
||||
|
@ -87,6 +87,7 @@ class GlanceTabFragment : Fragment() {
|
||||
binding: FragmentGlanceSettingsBinding,
|
||||
viewModel: MainViewModel
|
||||
) {
|
||||
binding.isGlanceVisible = Preferences.showGlance
|
||||
|
||||
viewModel.showGlance.observe(viewLifecycleOwner, Observer {
|
||||
maintainScrollPosition {
|
||||
|
@ -79,6 +79,8 @@ class WeatherTabFragment : Fragment() {
|
||||
binding: FragmentWeatherSettingsBinding,
|
||||
viewModel: MainViewModel
|
||||
) {
|
||||
binding.isWeatherVisible = Preferences.showWeather
|
||||
|
||||
viewModel.showWeatherWarning.observe(viewLifecycleOwner, Observer {
|
||||
weather_warning?.isVisible = it
|
||||
checkLocationPermission()
|
||||
|
Reference in New Issue
Block a user