Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with WeekCalendar #548

Open
veydoge opened this issue May 20, 2024 · 0 comments
Open

Bug with WeekCalendar #548

veydoge opened this issue May 20, 2024 · 0 comments

Comments

@veydoge
Copy link

veydoge commented May 20, 2024

Library information:

  • Version: 2.5.1
  • Compose

Describe the bug**

Strange gap between second and third element in WeekCalendar. Also not all containers are same size when aspectRatio(1f).
First two are a bit bigger than the others.

To Reproduce (if applicable)

Steps to reproduce the behavior:
1, Run in preview mode or run app

Expected behavior (if applicable)

No gap, same size

Screenshots? (if applicable)

image
image

Additional information

Code used:

        val state = rememberWeekCalendarState(
            startDate = startWeek,
        endDate = endWeek,
        firstVisibleWeekDate = LocalDate.now(),
        firstDayOfWeek = DayOfWeek.MONDAY
        )
        val visibleWeek = rememberFirstVisibleWeekAfterScroll(state = state)
        Text(text = getWeekPageTitle(visibleWeek))

        WeekCalendar(
            state = state,
            dayContent = { Day(it, {}) },
        )
        Text("123")
@Composable
fun Day(day: WeekDay, onClick: (CalendarDay) -> Unit) {
    Box(
        modifier = Modifier.aspectRatio(1f).background(Color.Green),
        contentAlignment = Alignment.Center
    ) { // Change the color of in-dates and out-dates, you can also hide them completely!
        Text(
            text = day.date.dayOfMonth.toString(),
        )
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant