Fix dark theme toggle issue
This commit is contained in:
parent
7d2ea5a4d8
commit
385806413e
@ -32,15 +32,11 @@ class ActivityDetectionReceiver : BroadcastReceiver() {
|
|||||||
|
|
||||||
if (lastEvent.activityType == DetectedActivity.WALKING || lastEvent.activityType == DetectedActivity.RUNNING && lastEvent.transitionType == ActivityTransition.ACTIVITY_TRANSITION_EXIT) {
|
if (lastEvent.activityType == DetectedActivity.WALKING || lastEvent.activityType == DetectedActivity.RUNNING && lastEvent.transitionType == ActivityTransition.ACTIVITY_TRANSITION_EXIT) {
|
||||||
requestDailySteps(context)
|
requestDailySteps(context)
|
||||||
setTimeout(context)
|
|
||||||
} else {
|
|
||||||
resetDailySteps()
|
|
||||||
}
|
}
|
||||||
} else {
|
} 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)) {
|
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()
|
resetDailySteps()
|
||||||
|
registerFence(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,6 +150,7 @@ class ActivityDetectionReceiver : BroadcastReceiver() {
|
|||||||
}
|
}
|
||||||
}.toLong()
|
}.toLong()
|
||||||
MainWidget.updateWidget(context)
|
MainWidget.updateWidget(context)
|
||||||
|
setTimeout(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,8 @@ class CalendarTabFragment : Fragment() {
|
|||||||
binding: FragmentCalendarSettingsBinding,
|
binding: FragmentCalendarSettingsBinding,
|
||||||
viewModel: MainViewModel
|
viewModel: MainViewModel
|
||||||
) {
|
) {
|
||||||
|
binding.isCalendarEnabled = Preferences.showEvents
|
||||||
|
|
||||||
viewModel.showEvents.observe(viewLifecycleOwner, Observer {
|
viewModel.showEvents.observe(viewLifecycleOwner, Observer {
|
||||||
maintainScrollPosition {
|
maintainScrollPosition {
|
||||||
binding.isCalendarEnabled = it
|
binding.isCalendarEnabled = it
|
||||||
|
@ -85,6 +85,8 @@ class ClockTabFragment : Fragment() {
|
|||||||
binding: FragmentClockSettingsBinding,
|
binding: FragmentClockSettingsBinding,
|
||||||
viewModel: MainViewModel
|
viewModel: MainViewModel
|
||||||
) {
|
) {
|
||||||
|
binding.isClockVisible = Preferences.showClock
|
||||||
|
|
||||||
viewModel.showBigClockWarning.observe(viewLifecycleOwner, Observer {
|
viewModel.showBigClockWarning.observe(viewLifecycleOwner, Observer {
|
||||||
large_clock_warning?.isVisible = it
|
large_clock_warning?.isVisible = it
|
||||||
small_clock_warning?.isVisible = !it
|
small_clock_warning?.isVisible = !it
|
||||||
|
@ -87,6 +87,7 @@ class GlanceTabFragment : Fragment() {
|
|||||||
binding: FragmentGlanceSettingsBinding,
|
binding: FragmentGlanceSettingsBinding,
|
||||||
viewModel: MainViewModel
|
viewModel: MainViewModel
|
||||||
) {
|
) {
|
||||||
|
binding.isGlanceVisible = Preferences.showGlance
|
||||||
|
|
||||||
viewModel.showGlance.observe(viewLifecycleOwner, Observer {
|
viewModel.showGlance.observe(viewLifecycleOwner, Observer {
|
||||||
maintainScrollPosition {
|
maintainScrollPosition {
|
||||||
|
@ -79,6 +79,8 @@ class WeatherTabFragment : Fragment() {
|
|||||||
binding: FragmentWeatherSettingsBinding,
|
binding: FragmentWeatherSettingsBinding,
|
||||||
viewModel: MainViewModel
|
viewModel: MainViewModel
|
||||||
) {
|
) {
|
||||||
|
binding.isWeatherVisible = Preferences.showWeather
|
||||||
|
|
||||||
viewModel.showWeatherWarning.observe(viewLifecycleOwner, Observer {
|
viewModel.showWeatherWarning.observe(viewLifecycleOwner, Observer {
|
||||||
weather_warning?.isVisible = it
|
weather_warning?.isVisible = it
|
||||||
checkLocationPermission()
|
checkLocationPermission()
|
||||||
|
@ -83,20 +83,6 @@
|
|||||||
android:id="@+id/show_events_switch"
|
android:id="@+id/show_events_switch"
|
||||||
android:buttonTint="@color/colorAccent" />
|
android:buttonTint="@color/colorAccent" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/disabledButtonBackground" />
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/colorPrimary" />
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -106,20 +106,6 @@
|
|||||||
android:id="@+id/show_clock_switch"
|
android:id="@+id/show_clock_switch"
|
||||||
android:buttonTint="@color/colorAccent" />
|
android:buttonTint="@color/colorAccent" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/disabledButtonBackground" />
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/colorPrimary" />
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -68,19 +68,6 @@
|
|||||||
android:id="@+id/show_glance_switch"
|
android:id="@+id/show_glance_switch"
|
||||||
android:buttonTint="@color/colorAccent" />
|
android:buttonTint="@color/colorAccent" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/disabledButtonBackground" />
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/colorPrimary" />
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -329,7 +316,7 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:padding="12dp"
|
android:padding="11dp"
|
||||||
android:src="@drawable/round_flip_to_front"
|
android:src="@drawable/round_flip_to_front"
|
||||||
android:tint="@color/colorPrimaryText"/>
|
android:tint="@color/colorPrimaryText"/>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -106,20 +106,6 @@
|
|||||||
android:id="@+id/show_weather_switch"
|
android:id="@+id/show_weather_switch"
|
||||||
android:buttonTint="@color/colorAccent" />
|
android:buttonTint="@color/colorAccent" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/disabledButtonBackground" />
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@color/colorPrimary" />
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user