This commit is contained in:
Tommaso Berlose
2020-05-16 12:47:29 +02:00
parent b04b103634
commit b81461f725
18 changed files with 59 additions and 33 deletions

View File

@ -79,12 +79,15 @@ object GlanceProviderHelper {
}
fun showGlanceProviders(context: Context): Boolean {
return Preferences.showGlance && EventRepository(context).getEventsCount() == 0 && (
val eventRepository = EventRepository(context)
val showGlance = Preferences.showGlance && eventRepository.getEventsCount() == 0 && (
(Preferences.showNextAlarm && AlarmHelper.getNextAlarm(context) != "") ||
(MediaPlayerHelper.isSomeonePlaying(context)) ||
(Preferences.isBatteryLevelLow) ||
(Preferences.customNotes.isNotEmpty()) ||
(Preferences.showDailySteps && Preferences.googleFitSteps > 0)
)
eventRepository.close()
return showGlance
}
}