Home | History | Annotate | Download | only in calendar

Lines Matching refs:Event

104     private static final long INVALID_EVENT_ID = -1; //This is used for remembering a null event
107 // duration of the more allday event text fade
126 * ID of the last event which was displayed with the toast popup.
128 * This is used to prevent popping up multiple quick views for the same event, especially
129 * during calendar syncs. This becomes valid when an event is selected, either by default
130 * on starting calendar or by scrolling to an event. It becomes invalid when the user
131 * explicitly scrolls to an empty time slot, changes views, or deletes the event.
271 private ArrayList<Event> mEvents = new ArrayList<Event>();
272 private ArrayList<Event> mAllDayEvents = new ArrayList<Event>();
282 private Event mLastSelectedEvent;
284 /** Width of a day or non-conflicting event */
318 // This is the standard height of an allday event with no restrictions
321 * This is the minimum desired height of a allday event.
339 // The largest a single allDay event will become.
379 // smallest height to draw an event with
442 * Flag to decide whether to handle the up event. Cases where up events
454 * The height of the allday event area used during animation
458 * The height of an individual allday event during animation
511 private ArrayList<Event> mSelectedEvents = new ArrayList<Event>();
514 private Event mSelectedEvent;
515 private Event mPrevSelectedEvent;
539 * Indicates we just received the touch event and we are waiting to see if
582 // whether or not an event is stopping because it was cancelled
836 // Catch long clicks for creating a new event
861 // jump to the "View event" screen.
955 // target hour + 1 (to give it room to see the event) -
1173 // indicating presence of an all-day event.
1192 // If there is at most one all-day event per day, then use less
1193 // space (but more than the space for a single event).
1208 event so the more events text can
1246 Event.computePositions(mEvents, minimumDurationMillis);
1274 //When we get new events we don't want to dismiss the popup unless the event changes
1315 * Switch to another view based on what was selected (an event or a free
1322 Event selectedEvent = mSelectedEvent;
1329 // With track ball, if we selected a free slot, then create an event.
1330 // If we selected a specific event, switch to EventInfo view.
1353 // unambiguous event, then view that event. Otherwise go to
1366 // If we selected a free slot, then create an event.
1367 // If we selected an event, then go to the EventInfo view.
1390 public boolean onKeyUp(int keyCode, KeyEvent event) {
1392 long duration = event.getEventTime() - event.getDownTime();
1421 // if (event.isTracking() && !event.isCanceled()) {
1428 return super.onKeyUp(keyCode, event);
1432 public boolean onKeyDown(int keyCode, KeyEvent event) {
1458 // Delete the selected event, if any
1459 Event selectedEvent = mSelectedEvent;
1475 if (event.getRepeatCount() == 0) {
1476 event.startTracking();
1479 return super.onKeyDown(keyCode, event);
1537 return super.onKeyDown(keyCode, event);
1575 return super.onKeyDown(keyCode, event);
1580 public boolean onHoverEvent(MotionEvent event) {
1582 int action = event.getAction();
1594 Log.e(TAG, "Unknown hover event action. " + event);
1601 return super.onHoverEvent(event);
1603 if (event.getAction() != MotionEvent.ACTION_HOVER_EXIT) {
1604 event.getX(), (int) event.getY());
1643 // Read out the relevant event(s)
1649 for (Event calEvent : mSelectedEvents) {
1651 // Read out x of numEvents if there are more than one event
1660 // Read out x of numEvents if there are more than one event
1674 AccessibilityEvent event = AccessibilityEvent
1677 event.getText().add(msg);
1678 event.setAddedCount(msg.length());
1679 sendAccessibilityEventUnchecked(event);
1688 private void appendEventAccessibilityString(StringBuilder b, Event calEvent) {
1871 // the all-day event area.
1873 // before jumping to the all-day event area.
1875 // 12am before going up to the all-day event area.
1949 final ArrayList<Event> events = new ArrayList<Event>();
1954 mAllDayEvents = new ArrayList<Event>();
1960 for (Event e : events) {
1991 // Compute the layout relation between each event before measuring cell
2002 // the earliest event in each day.
2004 final ArrayList<Event> events = mEvents;
2010 Event event = events.get(ii);
2011 if (event.startDay > mLastJulianDay || event.endDay < mFirstJulianDay) {
2014 if (event.drawAsAllday()) {
2016 final int firstDay = Math.max(event.startDay, mFirstJulianDay);
2017 final int lastDay = Math.min(event.endDay, mLastJulianDay);
2025 int daynum = event.startDay - mFirstJulianDay;
2026 int durationDays = event.endDay - event.startDay + 1;
2038 event.startDay - mFirstJulianDay;
2039 int hour = event.startTime / 60;
2044 // Also check the end hour in case the event spans more than
2046 daynum = event.endDay - mFirstJulianDay;
2047 hour = event.endTime / 60;
2386 // Draw a "new event hint" on top of the highlight
2387 // For the week view, show a "+", for day view, show "+ New event"
2589 Event getSelectedEvent() {
2591 // There is no event at the selected hour, so create a new event.
2602 Event getNewEvent() {
2607 static Event getNewEvent(int julianDay, long utcMillis,
2609 Event event = Event.newInstance();
2610 event.startDay = julianDay;
2611 event.endDay = julianDay;
2612 event.startMillis = utcMillis;
2613 event.endMillis = event.startMillis + MILLIS_PER_HOUR;
2614 event.startTime = minutesSinceMidnight;
2615 event.endTime = event.startTime + MINUTES_PER_HOUR;
2616 return event;
2686 * Return the layout for a numbered event. Create it if not already existing
2688 private StaticLayout getEventLayout(StaticLayout[] layouts, int i, Event event, Paint paint,
2700 if (event.title != null) {
2701 bob.append(drawTextSanitizer(event.title.toString(), MAX_EVENT_TEXT_LEN));
2705 if (event.location != null) {
2706 bob.append(drawTextSanitizer(event.location.toString(),
2710 switch (event.selfAttendeeStatus) {
2712 paint.setColor(event.color);
2723 // Leave a one pixel boundary on the left and right of the rectangle for the event
2767 final ArrayList<Event> events = mAllDayEvents;
2781 // We draw one fewer event than will fit so that more events text
2792 Event event = events.get(i);
2793 int startDay = event.startDay;
2794 int endDay = event.endDay;
2809 // Prevent a single event from getting too big
2815 // event rectangle.
2816 event.left = computeDayLeftPosition(startIndex);
2817 event.right = computeDayLeftPosition(endIndex + 1) - DAY_GAP;
2818 event.top = y + height * event.getColumn();
2819 event.bottom = event.top + height - ALL_DAY_EVENT_RECT_BOTTOM_MARGIN;
2821 // check if we should skip this event. We skip if it starts
2824 if (event.top >= allDayEventClip) {
2827 } else if (event.bottom > allDayEventClip) {
2832 event.bottom = allDayEventClip;
2835 Rect r = drawEventRect(event, canvas, p, eventTextPaint, (int) event.top,
2836 (int) event.bottom);
2838 StaticLayout layout = getEventLayout(mAllDayLayouts, i, event, eventTextPaint, r);
2841 // Check if this all-day event intersects the selected day
2844 mSelectedEvents.add(event);
2864 // to the normal event area, we will highlight the topmost event.
2911 Event ev = mSelectedEvents.get(ii);
2918 // For each event in the selected event list "mSelectedEvents", find
2920 // more efficiently by sorting on the Event.getColumn() field, but
2923 // Find the event in the same row as the previously selected all-day
2924 // event, if any.
2930 Event startEvent = null;
2931 Event maxPositionEvent = null;
2933 Event ev = mSelectedEvents.get(ii);
2945 Event neighbor = mSelectedEvents.get(jj);
2974 final ArrayList<Event> events = mEvents;
2980 Event event = events.get(i);
2981 if (!geometry.computeEventRect(date, left, top, cellWidth, event)) {
2986 if (event.bottom < mViewStartY || event.top > viewEndY) {
2991 && geometry.eventIntersectsSelection(event, selectionArea)) {
2992 mSelectedEvents.add(event);
2995 Rect r = drawEventRect(event, canvas, p, eventTextPaint, mViewStartY, viewEndY);
3002 StaticLayout layout = getEventLayout(mLayouts, i, event, eventTextPaint, r);
3014 // Computes the "nearest" neighbor event in four directions (left, right,
3024 Event ev = mSelectedEvents.get(ii);
3031 Event startEvent = mSelectedEvents.get(0);
3046 // Check if the previously selected event intersects the previous
3047 // selection box. (The previously selected event may be from a
3075 // The previously selected event was to the right of us.
3079 // The previously selected event was to the left of us.
3083 // The previously selected event was above us.
3087 // The previously selected event was below us.
3092 // For each event in the selected event list "mSelectedEvents", search
3096 Event ev = mSelectedEvents.get(ii);
3125 Event upEvent = null;
3126 Event downEvent = null;
3127 Event leftEvent = null;
3128 Event rightEvent = null;
3130 // Pick the starting event closest to the previously selected event,
3176 Event neighbor = mSelectedEvents.get(jj);
3301 private Rect drawEventRect(Event event, Canvas canvas, Paint p, Paint eventTextPaint,
3303 // Draw the Event Rect
3305 r.top = Math.max((int) event.top + EVENT_RECT_TOP_MARGIN, visibleTop);
3306 r.bottom = Math.min((int) event.bottom - EVENT_RECT_BOTTOM_MARGIN, visibleBot);
3307 r.left = (int) event.left + EVENT_RECT_LEFT_MARGIN;
3308 r.right = (int) event.right;
3310 int color = event.color;
3311 switch (event.selfAttendeeStatus) {
3329 r.top = Math.max((int) event.top + EVENT_RECT_TOP_MARGIN + floorHalfStroke, visibleTop);
3330 r.bottom = Math.min((int) event.bottom - EVENT_RECT_BOTTOM_MARGIN - ceilHalfStroke,
3340 // If this event is selected, then use the selection color
3341 if (mSelectedEvent == event) {
3345 // Also, remember the last selected event that we drew
3346 mPrevSelectedEvent = event;
3350 // Also, remember the last selected event that we drew
3351 mPrevSelectedEvent = event;
3365 // r.top = (int) event.top + CALENDAR_COLOR_SQUARE_V_OFFSET;
3366 // r.left = (int) event.left + CALENDAR_COLOR_SQUARE_H_OFFSET;
3377 // p.setColor(event.color);
3381 r.top = (int) event.top + EVENT_RECT_TOP_MARGIN;
3382 r.bottom = (int) event.bottom - EVENT_RECT_BOTTOM_MARGIN;
3383 r.left = (int) event.left + EVENT_RECT_LEFT_MARGIN;
3384 r.right = (int) event.right - EVENT_RECT_RIGHT_MARGIN;
3443 // past the event rect. The current fix is to not draw the staticLayout
3492 Event event = mSelectedEvent;
3494 titleView.setText(event.title);
3497 imageView.setVisibility(event.hasAlarm ? View.VISIBLE : View.GONE);
3500 imageView.setVisibility(event.isRepeating ? View.VISIBLE : View.GONE);
3503 if (event.allDay) {
3514 String timeRange = Utils.formatDateRange(mContext, event.startMillis, event.endMillis,
3520 final boolean empty = TextUtils.isEmpty(event.location);
3522 if (!empty) whereView.setText(event.location);
3716 // event
3726 // If the tap is on an event, launch the "View event" view
3735 // Y location is affected by the position of the event in the scrolling
4131 // If there is a selected event, then allow it to be viewed and
4158 // them to create an event. They can also do this by tapping.
4167 // If there is a selected event, then allow it to be viewed and
4241 Event selectedEvent = mSelectedEvent;
4258 private static int getEventAccessLevel(Context context, Event e) {
4263 // Get the calendar id for this event
4360 // Log.i("Cal", " num events: " + mSelectedEvents.size() + " event: "
4362 // for (Event ev : mSelectedEvents) {
4377 ArrayList<Event> events = mEvents;
4387 Event closestEvent = null;
4398 Event event = events.get(i);
4399 if (!event.drawAsAllday() ||
4400 (!mShowAllAllDayEvents && event.getColumn() >= maxUnexpandedColumn)) {
4405 if (event.startDay <= mSelectionDay && event.endDay >= mSelectionDay) {
4412 float eventTop = yOffset + height * event.getColumn();
4415 // If the touch is inside the event rectangle, then
4416 // add the event.
4417 mSelectedEvents.add(event);
4418 closestEvent = event;
4421 // Find the closest event
4429 closestEvent = event;
4451 Event event = events.get(i);
4452 // Compute the event rectangle.
4453 if (!geometry.computeEventRect(date, left, top, cellWidth, event)) {
4457 // If the event intersects the selection region, then add it to
4459 if (geometry.eventIntersectsSelection(event, region)) {
4460 mSelectedEvents.add(event);
4468 Event closestEvent = null;
4471 Event ev = mSelectedEvents.get(index);
4481 // event. They could be different if we touched on an empty hour
4482 // slot very close to an event in the previous hour slot. In
4483 // that case we will select the nearby event.