Open selarugirl opened 5 years ago
The reason is this function:
private int getWeekCountBasedOnMode() {
int weekCount = calendarMode.visibleWeeksCount;
boolean isInMonthsMode = calendarMode.equals(CalendarMode.MONTHS);
if (isInMonthsMode && mDynamicHeightEnabled && adapter != null && pager != null) {
Calendar cal = (Calendar) adapter.getItem(pager.getCurrentItem()).getCalendar().clone();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
//noinspection ResourceType
cal.setFirstDayOfWeek(getFirstDayOfWeek());
weekCount = cal.get(Calendar.WEEK_OF_MONTH);
}
return weekCount + DAY_NAMES_ROW;
}
This gives the correct number of lines:
Calendar cal = (Calendar) adapter.getItem(pager.getCurrentItem()).getCalendar().clone();
cal.setMinimalDaysInFirstWeek(1);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
In calendar view, I noticed that in some months, the last week is missing. I'm using the following version of the library.
implementation 'com.prolificinteractive:material-calendarview:1.4.3'
I have checked this with different mobile devices and Android versions, but I get this issue only in some devices. Currently I'm facing this issue in OPPO F5. Below is the xml code of the calendar view.
`<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/white" android:orientation="horizontal" android:paddingBottom="100dp">
`