UserAlarm

Alarm information:

NOTE: do NOT use constructor. Use Alarms.create for creating new alarm.

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Set of days when alarm will go off.

Link copied to clipboard
@get:JvmName(name = "isEnabled")
var enabled: Boolean = false

If this is false alarm won't go off.

Link copied to clipboard
var id: Int = 0

Get alarm id.

Link copied to clipboard

Alarm time in minutes since midnight (e.g. for alarm with alarm time 7:15 this value must be 7 * 60 + 15 = 435).

Link copied to clipboard
@get:JvmName(name = "isRepeatEveryWeek")
var repeatEveryWeek: Boolean = false

If this value is false alarm will go off only once and for true alarm will go off on every day in days.

Link copied to clipboard
var sleepQuality: Int = 0

Alarm will go off when sleep quality reach this level.

Link copied to clipboard

This value specifies in how minutes earlier than alarm time (minutes since midnight) alarm by rem phase may go off if it will better or easier for user to wake up.

Link copied to clipboard

Alarms may be by quality or by rem phase (see Time window duration).

Functions

Link copied to clipboard
fun addDay(day: AlarmDay)

Add alarm day.

Link copied to clipboard
fun clearDays()

Clear set of days when alarm must go off.

Link copied to clipboard
open operator override fun compareTo(other: UserAlarm): Int

Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.

Link copied to clipboard
fun isSame(another: UserAlarm?): Int

Check is this alarm and another the same.

Link copied to clipboard

Remove alarm day. NOTE: set Repeat every week in true before call to Alarms.add or Alarms.update or this value will be ignored.

Extensions

Link copied to clipboard

Check is alarm will go off today.