Skip to content

Commit 8441ec6

Browse files
author
Jens Claes
committed
Small improvement for last commit
1 parent 8b92d78 commit 8441ec6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

library/src/main/java/com/alamkanak/weekview/WeekView.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,16 @@ private void drawHeaderRowAndEvents(Canvas canvas) {
383383

384384
if (mAreDimensionsInvalid) {
385385
mAreDimensionsInvalid = false;
386-
double scrollToHour = mScrollToHour;
387-
388386
if(mScrollToDay != null)
389387
goToDate(mScrollToDay);
390-
if(scrollToHour >= 0)
391-
goToHour(scrollToHour);
388+
389+
mAreDimensionsInvalid = false;
390+
if(mScrollToHour >= 0)
391+
goToHour(mScrollToHour);
392+
393+
mScrollToDay = null;
394+
mScrollToHour = -1;
395+
mAreDimensionsInvalid = false;
392396
}
393397
if (mIsFirstDraw){
394398
mIsFirstDraw = false;
@@ -921,8 +925,6 @@ private void deleteFarMonths(Calendar currentDay) {
921925
public void invalidate() {
922926
super.invalidate();
923927
mAreDimensionsInvalid = true;
924-
mScrollToDay = null;
925-
mScrollToHour = -1;
926928
}
927929

928930
/////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)