Setting of day width/height
See original GitHub issueIt seems like it’s impossible to change the width and height of the day cells independent of one another. From what I can tell, setting either the height or width turns off autoSize
. I feel like the API mislead me into thinking I could reduce the space between rows (while keeping the width the same) by simply changing the height because they are separate properties.
Perhaps it should be one method that accepts width and height instead?
While a single function would be a step in the right direction, I think this way of setting the cell size is a bit confusing. I expected the library to respect the height and width set on the dayViewRes
, but instead it ignores it, sets it to match_parent
, and uses dayWidth
and dayHeight
from CalendarView
as the sources of truth.
I think this is a bit of a gotcha and it would be helpful to have this behavior documented. Ideally, the user’s layout determines the cell size.
For anyone wondering how to reduce the space between rows, here’s how I did it:
// View.doOnPreDraw is found in core-ktx
doOnPreDraw {
dayWidth = calendarView.width / 7
dayHeight = (dayWidth * .666).toInt()
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
Created #187
Yes, I’ll definitely take a look sometime. Removing the inner framelayout is already a huge win as there would be approx 30 of those in a single month. The inner layouts would only be about 4 per month but would still be great if we can get rid of them.