question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Height doesn't adjust for each month with wrap_content on horizontal paged calendar

See original GitHub issue

Steps to reproduce

  1. I’ve added calendar view with wrap_content
<com.kizitonwose.calendarview.CalendarView
            android:id="@+id/cv_custom_calendar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            app:cv_dayViewResource="@layout/calendar_day"
            app:cv_hasBoundaries="true"
            app:cv_outDateStyle="none"
            app:cv_monthHeaderResource="@layout/calendar_header"
            app:cv_orientation="horizontal"
            app:cv_scrollMode="paged"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/tv_month_year" />
  1. Open fragment for the first time, scroll to the previous month and height of the CalendarView stays the same even though the number of days and rows increased
  2. Open the same fragment again, resize works.

Note: Is this an edge case because February starts on Monday with 28 days and it has 4 rows? With fixed android:layout_height it shows all dates, but doesn’t look nice with extra space at the bottom. Also, I can’t find the right height that will show all days for every screen size.

Is there a possibility to have fixed size and spacing between rows to be auto-adjusted?

Device: Samsung S8, Samsung A5 2017

Video: https://vimeo.com/user133404315/review/511093300/5daa85a221

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kizitonwosecommented, Feb 15, 2021

Ok, please check with version 1.0.2 which was released yesterday, this issue is likely fixed.

0reactions
nikolasamardzijacommented, Mar 2, 2021

@kizitonwose You solved the first problem with the library, the second one with disappearing dates was on my side in binding logic, it’s fixed now.

Thanks for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Height doesn't adjust for each month with wrap_content on ...
Ok, that's not possible. The calendar adjusts its height from the bottom when a month has fewer rows than the previous one. The...
Read more >
Changing the height of ConstraintLayout from wrap-content to ...
When I manually enter a height e.g. '30dp' as a View's height, it works, but wrap-content for a Views's height does not work....
Read more >
TextView - Android Developers
By setting it to "false" the view will not take focus. This value does not impact the behavior of directly calling android.view.View#requestFocus, which ......
Read more >
Using DialogFragment | CodePath Android Cliffnotes
Overview. DialogFragment is a specialized Fragment used when you want to display an overlay modal window within an activity that floats on top...
Read more >
Wrap text and change row height in a Project view in Project ...
A quick way to wrap text that isn't wrapped or completely visible in a cell is to increase the row height to enlarge...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found