Home | History | Annotate | Download | only in deskclock

Lines Matching refs:Alarm

70 import com.android.deskclock.provider.Alarm;
104 // This extra is used when receiving an intent to create an alarm, but no alarm details
105 // have been passed in, so the alarm page should start the process of creating a new alarm.
108 // This extra is used when receiving an intent to scroll to specific alarm. If alarm
109 // can not be found, and toast message will pop up that the alarm has be deleted.
110 public static final String SCROLL_TO_ALARM_INTENT_EXTRA = "deskclock.scroll.to.alarm";
125 private Alarm mSelectedAlarm;
131 private Alarm mDeletedAlarm;
132 private Alarm mAddedAlarm;
144 // Cached layout positions of items in listview prior to add/removal of alarm item
316 // and animate out the alarm timeline view, expanding the width of the
451 // Check if another app asked us to create a blank new alarm.
455 // An external app asked us to create a blank alarm.
462 long alarmId = intent.getLongExtra(SCROLL_TO_ALARM_INTENT_EXTRA, Alarm.INVALID_ID);
463 if (alarmId != Alarm.INVALID_ID) {
546 // If mSelectedAlarm is null then we're creating a new alarm.
547 Alarm a = new Alarm();
567 private void showLabelDialog(final Alarm alarm) {
577 LabelDialogFragment.newInstance(alarm, alarm.label, getTag());
581 public void setLabel(Alarm alarm, String label) {
582 alarm.label = label;
583 asyncUpdateAlarm(alarm, false);
588 return Alarm.getAlarmsCursorLoader(getActivity());
601 * Scroll to alarm with given alarm id.
603 * @param alarmId The alarm id to scroll to.
619 // Trying to display a deleted alarm should only happen from a missed notification for
620 // an alarm that has been marked deleted after use.
634 private void launchRingTonePicker(Alarm alarm) {
635 mSelectedAlarm = alarm;
636 Uri oldRingtone = Alarm.NO_RINGTONE_URI.equals(alarm.alert) ? null : alarm.alert;
647 uri = Alarm.NO_RINGTONE_URI;
652 if (!Alarm.NO_RINGTONE_URI.equals(uri)) {
731 Alarm alarm;
796 // May happen if the last alarm
834 * In addition to changing the data set for the alarm list, swapCursor is now also
836 * need to occur if an alarm was removed or added.
851 * the alarms within the list view. The animations will occur if an alarm has been
854 * For alarm removal, the remaining children should all retain their initial starting
857 * For alarm addition, the other children should all retain their initial starting
859 * newly added alarm should appear in the designated space.
881 // If this is the added alarm, set it invisible for now, and animate later.
911 // animation is complete, and animate in the added alarm (if one
1024 final Alarm alarm = new Alarm(cursor);
1031 itemHolder.alarm = alarm;
1034 // state would affect the wrong alarm.
1036 itemHolder.onoff.setChecked(alarm.enabled);
1038 if (mSelectedAlarms.contains(itemHolder.alarm.id)) {
1049 itemHolder.clock.setTime(alarm.hour, alarm.minutes);
1054 mSelectedAlarm = itemHolder.alarm;
1056 alarm, AlarmClockFragment.this
1068 if (checked != alarm.enabled) {
1070 alarm.enabled = checked;
1071 asyncUpdateAlarm(alarm, alarm.enabled);
1078 boolean expanded = isAlarmExpanded(alarm);
1085 alarm.daysOfWeek.toString(AlarmClockFragment.this.getActivity(), false);
1088 itemHolder.daysOfWeek.setContentDescription(alarm.daysOfWeek.toAccessibilityString(
1104 if (alarm.label != null && alarm.label.length() != 0) {
1105 itemHolder.label.setText(alarm.label + labelSpace);
1109 + alarm.label);
1124 mDeletedAlarm = alarm;
1146 if (isAlarmExpanded(alarm)) {
1155 private void bindExpandArea(final ItemHolder itemHolder, final Alarm alarm) {
1158 if (alarm.label != null && alarm.label.length() > 0) {
1159 itemHolder.clickableLabel.setText(alarm.label);
1168 showLabelDialog(alarm);
1172 if (mRepeatChecked.contains(alarm.id) || itemHolder.alarm.daysOfWeek.isRepeating()) {
1186 mRepeatChecked.add(alarm.id);
1191 final int bitSet = mPreviousDaysOfWeekMap.getInt("" + alarm.id);
1192 alarm.daysOfWeek.setBitSet(bitSet);
1193 if (!alarm.daysOfWeek.isRepeating()) {
1194 alarm.daysOfWeek.setDaysOfWeek(true, DAY_ORDER);
1196 updateDaysOfWeekButtons(itemHolder, alarm.daysOfWeek);
1199 mRepeatChecked.remove(alarm.id);
1202 final int bitSet = alarm.daysOfWeek.getBitSet();
1203 mPreviousDaysOfWeekMap.putInt("" + alarm.id, bitSet);
1206 alarm.daysOfWeek.clearAllDays();
1208 asyncUpdateAlarm(alarm, false);
1212 updateDaysOfWeekButtons(itemHolder, alarm.daysOfWeek);
1222 alarm.daysOfWeek.setDaysOfWeek(checked, day);
1229 if (!alarm.daysOfWeek.isRepeating()) {
1232 mRepeatChecked.remove(alarm.id);
1236 mPreviousDaysOfWeekMap.putInt("" + alarm.id,
1240 asyncUpdateAlarm(alarm, false);
1250 if (!alarm.vibrate) {
1268 alarm.vibrate = checked;
1269 asyncUpdateAlarm(alarm, false);
1274 if (Alarm.NO_RINGTONE_URI.equals(alarm.alert)) {
1277 ringtone = getRingToneTitle(alarm.alert);
1286 launchRingTonePicker(alarm);
1292 // for enabled/disabled alarm while leaving the on/off switch more visible
1317 long id = ((ItemHolder)v.getTag()).alarm.id;
1375 * Expands the alarm for editing.
1380 mExpanded.add(itemHolder.alarm.id);
1381 bindExpandArea(itemHolder, itemHolder.alarm);
1383 mScrollAlarmId = itemHolder.alarm.id;
1507 private boolean isAlarmExpanded(Alarm alarm) {
1508 return mExpanded.contains(alarm.id);
1512 mExpanded.remove(itemHolder.alarm.id);
1624 if (h != null && h.alarm.id == id) {
1674 // Set the "selected" alarm as null, and we'll create the new one when the timepicker
1681 private static AlarmInstance setupAlarmInstance(Context context, Alarm alarm) {
1683 AlarmInstance newInstance = alarm.createInstanceAfter(Calendar.getInstance());
1690 private void asyncDeleteAlarm(final Alarm alarm, final View viewToRemove) {
1698 // The alarm list needs to be disabled until the animation finishes to prevent
1719 if (context != null && alarm != null) {
1721 AlarmStateManager.deleteAllInstances(context, alarm.id);
1722 Alarm.deleteAlarm(cr, alarm.id);
1731 private void asyncAddAlarm(final Alarm alarm) {
1738 // The alarm list needs to be disabled until the animation finishes to prevent
1755 if (context != null && alarm != null) {
1758 // Add alarm to db
1759 Alarm newAlarm = Alarm.addAlarm(cr, alarm);
1780 private void asyncUpdateAlarm(final Alarm alarm, final boolean popToast) {
1789 AlarmStateManager.deleteAllInstances(context, alarm.id);
1791 // Update alarm
1792 Alarm.updateAlarm(cr, alarm);
1793 if (alarm.enabled) {
1794 return setupAlarmInstance(context, alarm);