plusonelabs / calendar-widget

An calender widget for your Android home screen.
Apache License 2.0
369 stars 127 forks source link

Show alarms in the widget #248

Open adrcotfas opened 7 years ago

adrcotfas commented 7 years ago

It would be very nice if alarms would be included in the widget too.

yvolk commented 7 years ago

Do you mean "Reminders"? Please see https://github.com/plusonelabs/calendar-widget/issues/220

adrcotfas commented 7 years ago

I was referring to the alarms set by the clock app, which also makes a small icon appear in the status bar.

yvolk commented 7 years ago

The Calendar Widget shows all "events", which are exposed/provided via the Android Calendar Provider API ( https://developer.android.com/guide/topics/providers/calendar-provider.html ). This allows us to show events, created by any application, which supports this API. This means that some "Clock application" could also be a source of "Alarm events". If you will find such an application, please let us know here: this will be helpful for others. If not, we will have to use "reminders" , which already exist in Calendar applications and which are shown in the Calendar Widget.

adrcotfas commented 7 years ago

I was talking about the stock Clock application which does not create an event or reminder within the Calendar but does set an alarm. Probably there is a way to access the list of active alarms and then add them to the Calendar Widget. See http://stackoverflow.com/questions/3147179/get-all-alarms-saved-in-the-alarm-application. There is a similar feature on IOS, swiping right will show the list of future events and clock alarms.

yvolk commented 7 years ago

It looks like what you are talking is about the "Alarm Clock events" and they can be accessed via the AlarmManager https://developer.android.com/reference/android/app/AlarmManager.html As I see, there is a method to see only one, next scheduled Alarm Clock: https://developer.android.com/reference/android/app/AlarmManager.html#getNextAlarmClock()

adrcotfas commented 7 years ago

Well, I guess that's fine. An usual use case would be to set your morning alarm once per day or have it repeating on certain days. You would not be interested in seeing the whole list of alarms, just the next one.