Correct the algorithm to check if to show weather as a glance provider.
This commit is contained in:
parent
e89b377b68
commit
6d7d90e762
@ -114,11 +114,11 @@ object GlanceProviderHelper {
|
||||
(MediaPlayerHelper.isSomeonePlaying(context)) ||
|
||||
(Preferences.showBatteryCharging && Preferences.isCharging || Preferences.isBatteryLevelLow) ||
|
||||
(Preferences.customNotes.isNotEmpty()) ||
|
||||
(Preferences.showWeatherAsGlanceProvider && Preferences.weatherIcon != "") ||
|
||||
(Preferences.showWeatherAsGlanceProvider && Preferences.showWeather && Preferences.weatherIcon != "") ||
|
||||
(Preferences.showDailySteps && Preferences.googleFitSteps > 0) ||
|
||||
(Preferences.showGreetings && GreetingsHelper.showGreetings()) ||
|
||||
(Preferences.showEventsAsGlanceProvider && Preferences.showEvents && context.checkGrantedPermission(
|
||||
Manifest.permission.READ_CALENDAR) && eventRepository.getNextEvent() != null)
|
||||
(Preferences.showEventsAsGlanceProvider && Preferences.showEvents && context.checkGrantedPermission(
|
||||
Manifest.permission.READ_CALENDAR) && eventRepository.getNextEvent() != null)
|
||||
)
|
||||
eventRepository.close()
|
||||
return showGlance
|
||||
|
@ -366,7 +366,7 @@ class AlignedWidget(val context: Context, val rightAligned: Boolean = false) {
|
||||
}
|
||||
}
|
||||
Constants.GlanceProviderId.WEATHER -> {
|
||||
if (Preferences.showWeather && Preferences.weatherIcon != "") {
|
||||
if (Preferences.showWeatherAsGlanceProvider && Preferences.showWeather && Preferences.weatherIcon != "") {
|
||||
val i = Intent(context, WidgetClickListenerReceiver::class.java)
|
||||
i.action = Actions.ACTION_OPEN_WEATHER_INTENT
|
||||
val weatherPIntent = PendingIntent.getBroadcast(context, widgetID, i, 0)
|
||||
@ -742,7 +742,7 @@ class AlignedWidget(val context: Context, val rightAligned: Boolean = false) {
|
||||
}
|
||||
}
|
||||
Constants.GlanceProviderId.WEATHER -> {
|
||||
if (Preferences.showWeatherAsGlanceProvider && Preferences.weatherIcon != "") {
|
||||
if (Preferences.showWeatherAsGlanceProvider && Preferences.showWeather && Preferences.weatherIcon != "") {
|
||||
bindingView.subLineText.text = String.format(
|
||||
Locale.getDefault(),
|
||||
"%d°%s %s",
|
||||
|
@ -394,7 +394,7 @@ class StandardWidget(val context: Context) {
|
||||
}
|
||||
}
|
||||
Constants.GlanceProviderId.WEATHER -> {
|
||||
if (Preferences.showWeather && Preferences.weatherIcon != "") {
|
||||
if (Preferences.showWeatherAsGlanceProvider && Preferences.showWeather && Preferences.weatherIcon != "") {
|
||||
val i = Intent(context, WidgetClickListenerReceiver::class.java)
|
||||
i.action = Actions.ACTION_OPEN_WEATHER_INTENT
|
||||
val weatherPIntent = PendingIntent.getBroadcast(context, widgetID, i, 0)
|
||||
@ -774,7 +774,7 @@ class StandardWidget(val context: Context) {
|
||||
}
|
||||
}
|
||||
Constants.GlanceProviderId.WEATHER -> {
|
||||
if (Preferences.showWeatherAsGlanceProvider && Preferences.weatherIcon != "") {
|
||||
if (Preferences.showWeatherAsGlanceProvider && Preferences.showWeather && Preferences.weatherIcon != "") {
|
||||
bindingView.subLineText.text = String.format(
|
||||
Locale.getDefault(),
|
||||
"%d°%s %s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user