diff --git a/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt b/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt index e3314eb6..cd0a6b98 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt @@ -22,11 +22,6 @@ class WeatherWidgetWM : ViewModel(), KoinComponent { private val dataStore: LauncherDataStore by inject() - val currentForecast = MutableLiveData(getCurrentlySelectedForecast()) - val dailyForecasts = MutableLiveData>(emptyList()) - val currentDayForecasts = MutableLiveData>(emptyList()) - val currentDailyForecast = MutableLiveData(null) - private var selectedDayIndex = 0 set(value) { field = min(value, forecasts.lastIndex) @@ -71,6 +66,11 @@ class WeatherWidgetWM : ViewModel(), KoinComponent { } } + val currentForecast = MutableLiveData(getCurrentlySelectedForecast()) + val dailyForecasts = MutableLiveData>(emptyList()) + val currentDayForecasts = MutableLiveData>(emptyList()) + val currentDailyForecast = MutableLiveData(null) + val hasLocationPermission = permissionsManager.hasPermission(PermissionGroup.Location).asLiveData() fun requestLocationPermission(context: AppCompatActivity) { permissionsManager.requestPermission(context, PermissionGroup.Location)