recruit-mp / LightCalendarView

A lightweight monthly calendar view for Android, fully written in Kotlin. Designed to meet the minimum demands for typical calendars.
Apache License 2.0
445 stars 67 forks source link

Not working within fragment when activity was created already #30

Open sjd753 opened 7 years ago

sjd753 commented 7 years ago

If you put calendarView inside fragment and put that fragment in an activity and start the activity, it works fine but if you have a drawer activity (say) and it already running and when a navigation drawer item is selected and you replace another fragment with this calendarFragment it does show up at all. It's a bug i think. Help required ASAP please!

TKolbusz commented 7 years ago

Yep, I have the same problem. I think layout height and width isn't calculated as it should be when instantiating view at runtime.

sjd753 commented 7 years ago

I kinda agree with "I think layout height and width isn't calculated as it should be " but not with " when instantiating view at runtime" coz when you use calendatView inside a fragment that is attached to its activity in onCreate() then there's no problem! Weird!

sjd753 commented 7 years ago

Basically if the calendarView is instantiated in the onCreate() of an activity whether or not it be in a fragment (fragment attached in onCreate) or not , then there's no issue. If it's not instantiated in onCreate() then calendar does not appear. Although I've noticed that if the activity was restarted forcefully (say by the instant run) then calendar reappears!