File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
library/src/main/java/com/alamkanak/weekview Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1424,16 +1424,18 @@ public void notifyDatasetChanged(){
1424
1424
* @param hour The hour to scroll to in 24-hour format. Supported values are 0-24.
1425
1425
*/
1426
1426
public void goToHour (double hour ){
1427
- int verticalOffset = (int ) (mHourHeight * hour );
1428
- if (hour < 0 )
1429
- verticalOffset = 0 ;
1430
- else if (hour > 24 )
1431
- verticalOffset = mHourHeight * 24 ;
1432
-
1433
1427
if (mAreDimensionsInvalid ) {
1434
1428
mScrollToHour = hour ;
1435
1429
return ;
1436
- } else if (verticalOffset > mHourHeight * 24 - getHeight () + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom )
1430
+ }
1431
+
1432
+ int verticalOffset = 0 ;
1433
+ if (hour > 24 )
1434
+ verticalOffset = mHourHeight * 24 ;
1435
+ else if (hour > 0 )
1436
+ verticalOffset = (int ) (mHourHeight * hour );
1437
+
1438
+ if (verticalOffset > mHourHeight * 24 - getHeight () + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom )
1437
1439
verticalOffset = (int )(mHourHeight * 24 - getHeight () + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom );
1438
1440
1439
1441
mCurrentOrigin .y = -verticalOffset ;
You can’t perform that action at this time.
0 commit comments