kizitonwose / Calendar

A highly customizable calendar view and compose library for Android.
MIT License
4.5k stars 492 forks source link

Stable calendar height during scroll #506

Closed trupizzza closed 7 months ago

trupizzza commented 7 months ago

Library information:

Question:

How to show constant 5x7 calendar grid? With any app:cv_outDateStyle, calendar shows 6 rows at some point, even if the last row consists of out days only. I want to see whole current month, with empty "gaps" filled equally with in and out dates

"Bad" behavior

Example 1 (6 rows instead of 5):

image

Example 2 (last row consists fully of outdates):

image

What I want to achieve:

image

Any help would be appreciated

kizitonwose commented 7 months ago

I want to see whole current month, with empty "gaps" filled equally with in and out dates

This is not how a calendar works. If you do not want to fill the empty row, you can use outDateStyle = endOfRow, but there is no way to make a calendar to show the same number of days for in and out dates for every month.

trupizzza commented 7 months ago

I want to see whole current month, with empty "gaps" filled equally with in and out dates

This is not how a calendar works. If you do not want to fill the empty row, you can use outDateStyle = endOfRow, but there is no way to make a calendar to show the same number of days for in and out dates for every month.

First of all, thanks for fast reply!

It is ok for me to have different amount of in and out dates, the main goal is to have each month of calendar layed out in 5 rows, not 6

Can I achieve that type of behavior?

kizitonwose commented 7 months ago

It is ok for me to have different amount of in and out dates, the main goal is to have each month of calendar layed out in 5 rows, not 6

That's not possible with the library. Each month can have either a dynamic number of rows or fixed (6 x 7 grid)

trupizzza commented 7 months ago

Thanks!