Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrant committed Oct 11, 2015
2 parents 39fd130 + 8aa4ec6 commit 58a11a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/src/main/java/com/alamkanak/weekview/WeekView.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ private void drawHeaderRowAndEvents(Canvas canvas) {

// If the week view is being drawn for the first time, then consider the first day of the week.
if(mNumberOfVisibleDays >= 7 && mToday.get(Calendar.DAY_OF_WEEK) != mFirstDayOfWeek) {
int difference = 7 + (mToday.get(Calendar.DAY_OF_WEEK) - mFirstDayOfWeek);
int difference = (7 + (mToday.get(Calendar.DAY_OF_WEEK) - mFirstDayOfWeek)) % 7;
mCurrentOrigin.x += (mWidthPerDay + mColumnGap) * difference;
}
}
Expand Down Expand Up @@ -851,7 +851,11 @@ else if (!isEventsCollide(eventRect.event, column.get(column.size()-1).event)) {


// Calculate left and right position for all the events.
int maxRowCount = columns.get(0).size();
// Get the maxRowCount by looking in all columns.
int maxRowCount = 0;
for (List<EventRect> column : columns){
maxRowCount = Math.max(maxRowCount, column.size());
}
for (int i = 0; i < maxRowCount; i++) {
// Set the left and right values of the event.
float j = 0;
Expand Down

0 comments on commit 58a11a1

Please sign in to comment.