Lines Matching refs:Event
103 private static final long INVALID_EVENT_ID = -1; //This is used for remembering a null event
106 // duration of the more allday event text fade
112 // duration to show the event clicked
131 * ID of the last event which was displayed with the toast popup.
133 * This is used to prevent popping up multiple quick views for the same event, especially
134 * during calendar syncs. This becomes valid when an event is selected, either by default
135 * on starting calendar or by scrolling to an event. It becomes invalid when the user
136 * explicitly scrolls to an empty time slot, changes views, or deletes the event.
186 private Event mClickedEvent; // The event the user clicked on
187 private Event mSavedClickedEvent;
210 // Sets the "clicked" color from the clicked event
220 // Clears the "clicked" color from the clicked event and launch the event
310 private ArrayList<Event> mEvents = new ArrayList<Event>();
311 private ArrayList<Event> mAllDayEvents = new ArrayList<Event>();
322 private Event mSelectedEventForAccessibility;
326 private Event mLastSelectedEventForAccessibility;
329 /** Width of a day or non-conflicting event */
363 // This is the standard height of an allday event with no restrictions
366 * This is the minimum desired height of a allday event.
384 // The largest a single allDay event will become.
420 // smallest height to draw an event with
489 * Flag to decide whether to handle the up event. Cases where up events
501 * The height of the allday event area used during animation
505 * The height of an individual allday event during animation
558 private final ArrayList<Event> mSelectedEvents = new ArrayList<Event>();
561 private Event mSelectedEvent;
562 private Event mPrevSelectedEvent;
586 * Indicates we just received the touch event and we are waiting to see if
630 // whether or not an event is stopping because it was cancelled
896 // Catch long clicks for creating a new event
921 // jump to the "View event" screen.
1032 // target hour + 1 (to give it room to see the event) -
1251 // indicating presence of an all-day event.
1270 // If there is at most one all-day event per day, then use less
1271 // space (but more than the space for a single event).
1286 // continues to hide the last event so the more events text can
1324 Event.computePositions(mEvents, minimumDurationMillis);
1352 //When we get new events we don't want to dismiss the popup unless the event changes
1393 * Switch to another view based on what was selected (an event or a free
1400 Event selectedEvent = mSelectedEvent;
1407 // With track ball, if we selected a free slot, then create an event.
1408 // If we selected a specific event, switch to EventInfo view.
1431 // unambiguous event, then view that event. Otherwise go to
1444 // If we selected a free slot, then create an event.
1445 // If we selected an event, then go to the EventInfo view.
1468 public boolean onKeyUp(int keyCode, KeyEvent event) {
1470 long duration = event.getEventTime() - event.getDownTime();
1499 // if (event.isTracking() && !event.isCanceled()) {
1506 return super.onKeyUp(keyCode, event);
1510 public boolean onKeyDown(int keyCode, KeyEvent event) {
1536 // Delete the selected event, if any
1537 Event selectedEvent = mSelectedEvent;
1553 if (event.getRepeatCount() == 0) {
1554 event.startTracking();
1557 return super.onKeyDown(keyCode, event);
1615 return super.onKeyDown(keyCode, event);
1653 return super.onKeyDown(keyCode, event);
1658 public boolean onHoverEvent(MotionEvent event) {
1660 int action = event.getAction();
1672 Log.e(TAG, "Unknown hover event action. " + event);
1679 return super.onHoverEvent(event);
1681 if (event.getAction() != MotionEvent.ACTION_HOVER_EXIT) {
1682 setSelectionFromPosition((int) event.getX(), (int) event.getY(), true);
1722 // Read out the relevant event(s)
1728 for (Event calEvent : mSelectedEvents) {
1730 // Read out x of numEvents if there are more than one event
1739 // Read out x of numEvents if there are more than one event
1753 AccessibilityEvent event = AccessibilityEvent
1756 event.getText().add(msg);
1757 event.setAddedCount(msg.length());
1758 sendAccessibilityEventUnchecked(event);
1767 private void appendEventAccessibilityString(StringBuilder b, Event calEvent) {
1951 // the all-day event area.
1953 // before jumping to the all-day event area.
1955 // 12am before going up to the all-day event area.
2031 final ArrayList<Event> events = new ArrayList<Event>();
2039 mAllDayEvents = new ArrayList<Event>();
2045 for (Event e : events) {
2102 // Compute the layout relation between each event before measuring cell
2113 // the earliest event in each day.
2115 final ArrayList<Event> events = mEvents;
2121 Event event = events.get(ii);
2122 if (event.startDay > mLastJulianDay || event.endDay < mFirstJulianDay) {
2125 if (event.drawAsAllday()) {
2127 final int firstDay = Math.max(event.startDay, mFirstJulianDay);
2128 final int lastDay = Math.min(event.endDay, mLastJulianDay);
2136 int daynum = event.startDay - mFirstJulianDay;
2137 int durationDays = event.endDay - event.startDay + 1;
2149 int daynum = event.startDay - mFirstJulianDay;
2150 int hour = event.startTime / 60;
2155 // Also check the end hour in case the event spans more than
2157 daynum = event.endDay - mFirstJulianDay;
2158 hour = event.endTime / 60;
2505 // Draw a "new event hint" on top of the highlight
2506 // For the week view, show a "+", for day view, show "+ New event"
2708 Event getSelectedEvent() {
2710 // There is no event at the selected hour, so create a new event.
2721 Event getNewEvent() {
2726 static Event getNewEvent(int julianDay, long utcMillis,
2728 Event event = Event.newInstance();
2729 event.startDay = julianDay;
2730 event.endDay = julianDay;
2731 event.startMillis = utcMillis;
2732 event.endMillis = event.startMillis + MILLIS_PER_HOUR;
2733 event.startTime = minutesSinceMidnight;
2734 event.endTime = event.startTime + MINUTES_PER_HOUR;
2735 return event;
2805 * Return the layout for a numbered event. Create it if not already existing
2807 private StaticLayout getEventLayout(StaticLayout[] layouts, int i, Event event, Paint paint,
2819 if (event.title != null) {
2821 bob.append(drawTextSanitizer(event.title.toString(), MAX_EVENT_TEXT_LEN - 1));
2825 if (event.location != null) {
2826 bob.append(drawTextSanitizer(event.location.toString(),
2830 switch (event.selfAttendeeStatus) {
2832 paint.setColor(event.color);
2846 // Leave a one pixel boundary on the left and right of the rectangle for the event
2890 final ArrayList<Event> events = mAllDayEvents;
2904 // We draw one fewer event than will fit so that more events text
2918 Event event = events.get(i);
2919 int startDay = event.startDay;
2920 int endDay = event.endDay;
2935 // Prevent a single event from getting too big
2941 // event rectangle.
2942 event.left = computeDayLeftPosition(startIndex);
2943 event.right = computeDayLeftPosition(endIndex + 1) - DAY_GAP;
2944 event.top = y + height * event.getColumn();
2945 event.bottom = event.top + height - ALL_DAY_EVENT_RECT_BOTTOM_MARGIN;
2947 // check if we should skip this event. We skip if it starts
2950 if (event.top >= allDayEventClip) {
2953 } else if (event.bottom > allDayEventClip) {
2958 event.bottom = allDayEventClip;
2961 Rect r = drawEventRect(event, canvas, p, eventTextPaint, (int) event.top,
2962 (int) event.bottom);
2964 StaticLayout layout = getEventLayout(mAllDayLayouts, i, event, eventTextPaint, r);
2967 // Check if this all-day event intersects the selected day
2970 mSelectedEvents.add(event);
2995 // to the normal event area, we will highlight the topmost event.
3042 Event ev = mSelectedEvents.get(ii);
3049 // For each event in the selected event list "mSelectedEvents", find
3051 // more efficiently by sorting on the Event.getColumn() field, but
3054 // Find the event in the same row as the previously selected all-day
3055 // event, if any.
3061 Event startEvent = null;
3062 Event maxPositionEvent = null;
3064 Event ev = mSelectedEvents.get(ii);
3076 Event neighbor = mSelectedEvents.get(jj);
3105 final ArrayList<Event> events = mEvents;
3114 Event event = events.get(i);
3115 if (!geometry.computeEventRect(date, left, top, cellWidth, event)) {
3120 if (event.bottom < mViewStartY || event.top > viewEndY) {
3125 && geometry.eventIntersectsSelection(event, selectionArea)) {
3126 mSelectedEvents.add(event);
3129 Rect r = drawEventRect(event, canvas, p, eventTextPaint, mViewStartY, viewEndY);
3136 StaticLayout layout = getEventLayout(mLayouts, i, event, eventTextPaint, r);
3149 // Computes the "nearest" neighbor event in four directions (left, right,
3159 Event ev = mSelectedEvents.get(ii);
3166 Event startEvent = mSelectedEvents.get(0);
3181 // Check if the previously selected event intersects the previous
3182 // selection box. (The previously selected event may be from a
3210 // The previously selected event was to the right of us.
3214 // The previously selected event was to the left of us.
3218 // The previously selected event was above us.
3222 // The previously selected event was below us.
3227 // For each event in the selected event list "mSelectedEvents", search
3231 Event ev = mSelectedEvents.get(ii);
3260 Event upEvent = null;
3261 Event downEvent = null;
3262 Event leftEvent = null;
3263 Event rightEvent = null;
3265 // Pick the starting event closest to the previously selected event,
3311 Event neighbor = mSelectedEvents.get(jj);
3436 private Rect drawEventRect(Event event, Canvas canvas, Paint p, Paint eventTextPaint,
3438 // Draw the Event Rect
3440 r.top = Math.max((int) event.top + EVENT_RECT_TOP_MARGIN, visibleTop);
3441 r.bottom = Math.min((int) event.bottom - EVENT_RECT_BOTTOM_MARGIN, visibleBot);
3442 r.left = (int) event.left + EVENT_RECT_LEFT_MARGIN;
3443 r.right = (int) event.right;
3446 if (event == mClickedEvent) {
3449 color = event.color;
3452 switch (event.selfAttendeeStatus) {
3454 if (event != mClickedEvent) {
3459 if (event != mClickedEvent) {
3474 r.top = Math.max((int) event.top + EVENT_RECT_TOP_MARGIN + floorHalfStroke, visibleTop);
3475 r.bottom = Math.min((int) event.bottom - EVENT_RECT_BOTTOM_MARGIN - ceilHalfStroke,
3487 // If this event is selected, then use the selection color
3488 if (mSelectedEvent == event && mClickedEvent != null) {
3492 // Also, remember the last selected event that we drew
3493 mPrevSelectedEvent = event;
3497 // Also, remember the last selected event that we drew
3498 mPrevSelectedEvent = event;
3511 // r.top = (int) event.top + CALENDAR_COLOR_SQUARE_V_OFFSET;
3512 // r.left = (int) event.left + CALENDAR_COLOR_SQUARE_H_OFFSET;
3523 // p.setColor(event.color);
3527 r.top = (int) event.top + EVENT_RECT_TOP_MARGIN;
3528 r.bottom = (int) event.bottom - EVENT_RECT_BOTTOM_MARGIN;
3529 r.left = (int) event.left + EVENT_RECT_LEFT_MARGIN;
3530 r.right = (int) event.right - EVENT_RECT_RIGHT_MARGIN;
3596 // past the event rect. The current fix is to not draw the staticLayout
3645 Event event = mSelectedEvent;
3647 titleView.setText(event.title);
3650 imageView.setVisibility(event.hasAlarm ? View.VISIBLE : View.GONE);
3653 imageView.setVisibility(event.isRepeating ? View.VISIBLE : View.GONE);
3656 if (event.allDay) {
3667 String timeRange = Utils.formatDateRange(mContext, event.startMillis, event.endMillis,
3673 final boolean empty = TextUtils.isEmpty(event.location);
3675 if (!empty) whereView.setText(event.location);
3691 // Save selection information: we use setSelectionFromPosition to find the selected event
3694 Event oldSelectedEvent = mSelectedEvent;
3699 // is in the selected time, do not show a click on an event to prevent a situation
3700 // of both a selection and an event are clicked when they overlap.
3896 // event
3906 // If the tap is on an event, launch the "View event" view
3915 // Y location is affected by the position of the event in the scrolling
4359 // If there is a selected event, then allow it to be viewed and
4386 // them to create an event. They can also do this by tapping.
4395 // If there is a selected event, then allow it to be viewed and
4470 Event selectedEvent = mSelectedEvent;
4487 private static int getEventAccessLevel(Context context, Event e) {
4492 // Get the calendar id for this event
4553 Event savedEvent = null;
4605 // Log.i("Cal", " num events: " + mSelectedEvents.size() + " event: "
4607 // for (Event ev : mSelectedEvents) {
4630 ArrayList<Event> events = mEvents;
4640 Event closestEvent = null;
4651 Event event = events.get(i);
4652 if (!event.drawAsAllday() ||
4653 (!mShowAllAllDayEvents && event.getColumn() >= maxUnexpandedColumn)) {
4658 if (event.startDay <= mSelectionDay && event.endDay >= mSelectionDay) {
4665 float eventTop = yOffset + height * event.getColumn();
4668 // If the touch is inside the event rectangle, then
4669 // add the event.
4670 mSelectedEvents.add(event);
4671 closestEvent = event;
4674 // Find the closest event
4682 closestEvent = event;
4704 Event event = events.get(i);
4705 // Compute the event rectangle.
4706 if (!geometry.computeEventRect(date, left, top, cellWidth, event)) {
4710 // If the event intersects the selection region, then add it to
4712 if (geometry.eventIntersectsSelection(event, region)) {
4713 mSelectedEvents.add(event);
4721 Event closestEvent = null;
4724 Event ev = mSelectedEvents.get(index);
4734 // event. They could be different if we touched on an empty hour
4735 // slot very close to an event in the previous hour slot. In
4736 // that case we will select the nearby event.
4835 private void setSelectedEvent(Event e) {