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 @@ -1420,16 +1420,18 @@ public void notifyDatasetChanged(){
1420
1420
* @param hour The hour to scroll to in 24-hour format. Supported values are 0-24.
1421
1421
*/
1422
1422
public void goToHour (double hour ){
1423
- int verticalOffset = (int ) (mHourHeight * hour );
1424
- if (hour < 0 )
1425
- verticalOffset = 0 ;
1426
- else if (hour > 24 )
1427
- verticalOffset = mHourHeight * 24 ;
1428
-
1429
1423
if (mAreDimensionsInvalid ) {
1430
1424
mScrollToHour = hour ;
1431
1425
return ;
1432
- } else if (verticalOffset > mHourHeight * 24 - getHeight () + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom )
1426
+ }
1427
+
1428
+ int verticalOffset = 0 ;
1429
+ if (hour > 24 )
1430
+ verticalOffset = mHourHeight * 24 ;
1431
+ else if (hour > 0 )
1432
+ verticalOffset = (int ) (mHourHeight * hour );
1433
+
1434
+ if (verticalOffset > mHourHeight * 24 - getHeight () + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom )
1433
1435
verticalOffset = (int )(mHourHeight * 24 - getHeight () + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom );
1434
1436
1435
1437
mCurrentOrigin .y = -verticalOffset ;
You can’t perform that action at this time.
0 commit comments