// Path: src/edu/bupt/calendar/CalendarController.java
// public interface EventType {
//     final long CREATE_EVENT = 1L;
// 
//     // Simple view of an event
//     final long VIEW_EVENT = 1L << 1;
// 
//     // Full detail view in read only mode
//     final long VIEW_EVENT_DETAILS = 1L << 2;
// 
//     // full detail view in edit mode
//     final long EDIT_EVENT = 1L << 3;
// 
//     final long DELETE_EVENT = 1L << 4;
// 
//     final long GO_TO = 1L << 5;
// 
//     final long LAUNCH_SETTINGS = 1L << 6;
// 
//     final long EVENTS_CHANGED = 1L << 7;
// 
//     final long SEARCH = 1L << 8;
// 
//     // User has pressed the home key
//     final long USER_HOME = 1L << 9;
// 
//     // date range has changed, update the title
//     final long UPDATE_TITLE = 1L << 10;
// 
//     // select which calendars to display
//     final long LAUNCH_SELECT_VISIBLE_CALENDARS = 1L << 11;
// }
// 
// Path: src/edu/bupt/calendar/CalendarController.java
// public interface ViewType {
//     final int DETAIL = -1;
//     final int CURRENT = 0;
//     final int AGENDA = 1;
//     final int DAY = 2;
//     final int WEEK = 3;
//     final int MONTH = 4;
//     final int EDIT = 5;
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.AlertDialog;
import android.app.Service;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.database.Cursor;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Handler;
import android.provider.CalendarContract.Attendees;
import android.provider.CalendarContract.Calendars;
import android.provider.CalendarContract.Events;
import android.text.Layout.Alignment;
import android.text.SpannableStringBuilder;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.text.format.Time;
import android.text.style.StyleSpan;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.GestureDetector;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Interpolator;
import android.view.animation.TranslateAnimation;
import android.widget.EdgeEffect;
import android.widget.ImageView;
import android.widget.OverScroller;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.ViewSwitcher;
import edu.bupt.calendar.CalendarController.EventType;
import edu.bupt.calendar.CalendarController.ViewType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Formatter;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
    protected static StringBuilder mStringBuilder = new StringBuilder(50);
    // TODO recreate formatter when locale changes
    protected static Formatter mFormatter = new Formatter(mStringBuilder, Locale.getDefault());

    private final Runnable mTZUpdater = new Runnable() {
        @Override
        public void run() {
            String tz = Utils.getTimeZone(mContext, this);
            mBaseDate.timezone = tz;
            mBaseDate.normalize(true);
            mCurrentTime.switchTimezone(tz);
            invalidate();
        }
    };

    // Sets the "clicked" color from the clicked event
    private final Runnable mSetClick = new Runnable() {
        @Override
        public void run() {
                mClickedEvent = mSavedClickedEvent;
                mSavedClickedEvent = null;
                DayView.this.invalidate();
        }
    };

    // Clears the "clicked" color from the clicked event and launch the event
    private final Runnable mClearClick = new Runnable() {
        @Override
        public void run() {
            if (mClickedEvent != null) {
// Path: src/edu/bupt/calendar/CalendarController.java
// public interface EventType {
//     final long CREATE_EVENT = 1L;
// 
//     // Simple view of an event
//     final long VIEW_EVENT = 1L << 1;
// 
//     // Full detail view in read only mode
//     final long VIEW_EVENT_DETAILS = 1L << 2;
// 
//     // full detail view in edit mode
//     final long EDIT_EVENT = 1L << 3;
// 
//     final long DELETE_EVENT = 1L << 4;
// 
//     final long GO_TO = 1L << 5;
// 
//     final long LAUNCH_SETTINGS = 1L << 6;
// 
//     final long EVENTS_CHANGED = 1L << 7;
// 
//     final long SEARCH = 1L << 8;
// 
//     // User has pressed the home key
//     final long USER_HOME = 1L << 9;
// 
//     // date range has changed, update the title
//     final long UPDATE_TITLE = 1L << 10;
// 
//     // select which calendars to display
//     final long LAUNCH_SELECT_VISIBLE_CALENDARS = 1L << 11;
// }
// 
// Path: src/edu/bupt/calendar/CalendarController.java
// public interface ViewType {
//     final int DETAIL = -1;
//     final int CURRENT = 0;
//     final int AGENDA = 1;
//     final int DAY = 2;
//     final int WEEK = 3;
//     final int MONTH = 4;
//     final int EDIT = 5;
// }


// Path: src/edu/bupt/calendar/DayView.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.AlertDialog;
import android.app.Service;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.database.Cursor;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Handler;
import android.provider.CalendarContract.Attendees;
import android.provider.CalendarContract.Calendars;
import android.provider.CalendarContract.Events;
import android.text.Layout.Alignment;
import android.text.SpannableStringBuilder;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.text.format.Time;
import android.text.style.StyleSpan;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.GestureDetector;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Interpolator;
import android.view.animation.TranslateAnimation;
import android.widget.EdgeEffect;
import android.widget.ImageView;
import android.widget.OverScroller;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.ViewSwitcher;
import edu.bupt.calendar.CalendarController.EventType;
import edu.bupt.calendar.CalendarController.ViewType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Formatter;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

    protected static StringBuilder mStringBuilder = new StringBuilder(50);
    // TODO recreate formatter when locale changes
    protected static Formatter mFormatter = new Formatter(mStringBuilder, Locale.getDefault());

    private final Runnable mTZUpdater = new Runnable() {
        @Override
        public void run() {
            String tz = Utils.getTimeZone(mContext, this);
            mBaseDate.timezone = tz;
            mBaseDate.normalize(true);
            mCurrentTime.switchTimezone(tz);
            invalidate();
        }
    };

    // Sets the "clicked" color from the clicked event
    private final Runnable mSetClick = new Runnable() {
        @Override
        public void run() {
                mClickedEvent = mSavedClickedEvent;
                mSavedClickedEvent = null;
                DayView.this.invalidate();
        }
    };

    // Clears the "clicked" color from the clicked event and launch the event
    private final Runnable mClearClick = new Runnable() {
        @Override
        public void run() {
            if (mClickedEvent != null) {
                mController.sendEventRelatedEvent(this, EventType.VIEW_EVENT, mClickedEvent.id,