library/src/main/java/com/alamkanak/weekview/WeekView.java
/**
     * Draw all the All day-events of a particular day.
     *
     * @param date           The day.
     * @param startFromPixel The left position of the day area. The events will never go any left from this value.
     * @param canvas         The canvas to draw upon.
     */
Draw all the All day-events of a particular day.
@param date           The day.
@param startFromPixel The left position of the day area. The events will never go any left from this value.
@param canvas         The canvas to draw upon.
Draw all the All day - events of a particular day . @param date The day . @param startFromPixel The left position of the day area . The events will never go any left from this value . @param canvas The canvas to draw upon .
private void drawAllDayEvents(Calendar date, float startFromPixel, Canvas canvas) {
        if (mEventRects != null && mEventRects.size() > 0) {
            for (int i = 0; i < mEventRects.size(); i++) {
                if (isSameDay(mEventRects.get(i).event.getStartTime(), date) && mEventRects.get(i).event.isAllDay()) {
                    float top = mDayHeight + mGridThickness + mEventMargin;
                    float bottom = top + mEventRects.get(i).bottom;
                    float left = startFromPixel + mEventRects.get(i).left * mWidthPerDay;
                    if (left < startFromPixel) {
                        left += mOverlappingEventGap;
                    } else {
                        left += mEventMargin;
                    }
                    float right = left + mEventRects.get(i).width * mWidthPerDay - mGridThickness;
                    if (right < startFromPixel + mWidthPerDay) {
                        right -= mOverlappingEventGap;
                    } else {
                        right -= mEventMargin * 2;
                    }
                    if (left < right && left < getWidth() && top < getHeight() && right > mTimeColumnWidth && bottom > 0) {
                        mEventRects.get(i).rectF = new RectF(left, top, right, bottom);
                        mEventBackgroundPaint.setColor(mEventRects.get(i).event.getColor() == 0 ? Color.WHITE : mEventRects.get(i).event.getColor());
                        canvas.drawRoundRect(mEventRects.get(i).rectF, mEventCornerRadius, mEventCornerRadius, mEventBackgroundPaint);
                        drawEventTitle(mEventRects.get(i).event, mEventRects.get(i).rectF, canvas, top, left);
                    } else {
                        mEventRects.get(i).rectF = null;
                    }
                }
            }
        }
    }
private void drawAllDayEvents ( Calendar date , float startFromPixel , Canvas canvas ) { if ( mEventRects != null && mEventRects . size ( ) > 0 ) { for ( int i = 0 ; i < mEventRects . size ( ) ; i ++ ) { if ( isSameDay ( mEventRects . get ( i ) . event . getStartTime ( ) , date ) && mEventRects . get ( i ) . event . isAllDay ( ) ) { float top = mDayHeight + mGridThickness + mEventMargin ; float bottom = top + mEventRects . get ( i ) . bottom ; float left = startFromPixel + mEventRects . get ( i ) . left * mWidthPerDay ; if ( left < startFromPixel ) { left += mOverlappingEventGap ; } else { left += mEventMargin ; } float right = left + mEventRects . get ( i ) . width * mWidthPerDay - mGridThickness ; if ( right < startFromPixel + mWidthPerDay ) { right -= mOverlappingEventGap ; } else { right -= mEventMargin * 2 ; } if ( left < right && left < getWidth ( ) && top < getHeight ( ) && right > mTimeColumnWidth && bottom > 0 ) { mEventRects . get ( i ) . rectF = new RectF ( left , top , right , bottom ) ; mEventBackgroundPaint . setColor ( mEventRects . get ( i ) . event . getColor ( ) == 0 ? Color . WHITE : mEventRects . get ( i ) . event . getColor ( ) ) ; canvas . drawRoundRect ( mEventRects . get ( i ) . rectF , mEventCornerRadius , mEventCornerRadius , mEventBackgroundPaint ) ; drawEventTitle ( mEventRects . get ( i ) . event , mEventRects . get ( i ) . rectF , canvas , top , left ) ; } else { mEventRects . get ( i ) . rectF = null ; } } } } }
Draw all the All day-events of a particular day.
Draw all the All day - events of a particular day .
// Calculate top. // Calculate bottom. // Calculate left and right. // Draw the event and the event name on top of it.