khacpv / Calendar-Day-View

Calendar Day View is an android library to display calendars day view within the app. It supports custom styling.
MIT License
56 stars 34 forks source link

Rendering wrong intervals #11

Closed cristidan94 closed 7 years ago

cristidan94 commented 7 years ago

Hello! I'm encountering a problem, the library does not render the correct intervals of time marked by events.

Start time console Log: D/Event: startTime = java.util.GregorianCalendar[time=?,areFieldsSet=false,lenient=true,zone=Europe/Athens,firstDayOfWeek=2,minimalDaysInFirstWeek=1,ERA=1,YEAR=2017,MONTH=9,WEEK_OF_YEAR=41,WEEK_OF_MONTH=2,DAY_OF_MONTH=2,DAY_OF_YEAR=275,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=2,HOUR_OF_DAY=8,MINUTE=30,SECOND=41,MILLISECOND=763,ZONE_OFFSET=7200000,DST_OFFSET=3600000]

@khacpv End time console Log: D/Event: java.util.GregorianCalendar[time=?,areFieldsSet=false,lenient=true,zone=Europe/Athens,firstDayOfWeek=2,minimalDaysInFirstWeek=1,ERA=1,YEAR=2017,MONTH=9,WEEK_OF_YEAR=41,WEEK_OF_MONTH=2,DAY_OF_MONTH=2,DAY_OF_YEAR=275,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=2,HOUR_OF_DAY=9,MINUTE=30,SECOND=41,MILLISECOND=763,ZONE_OFFSET=7200000,DST_OFFSET=3600000]

And during runtime, the app shows this: device-2017-10-02-142305

(Usually using a CustomDecorator, but for relevance I included the default one).

khacpv commented 7 years ago

@cristidan94 How could I reproduce the problem? It's work properly on my side, startTime=8:30, endTime=9:30, (even change timeZone to Europe/Athens) thanks 👍

cristidan94 commented 7 years ago

@khacpv So I made a new project and rewrote all my code. To my amazement, it worked. So I started debugging to check what I've made different. The only difference I have is where I use it. In my project, I'm using it in a Fragment. So, I retested in the new project and the problem surfaces then. Try using a v4 Fragment and check the results. Thank you!

cristidan94 commented 7 years ago

I commented on GitHub, but i don't think you saw it. Here's the answer!

@khacpv https://github.com/khacpv So I made a new project and rewrote all my code. To my amazement, it worked. So I started debugging to check what I've made different. The only difference I have is where I use it. In my project, I'm using it in a Fragment. So, I retested in the new project and the problem surfaces then. Try using a v4 Fragment and check the results. Thank you!

On Wed, Oct 4, 2017 at 6:29 PM, khacpham notifications@github.com wrote:

@cristidan94 https://github.com/cristidan94 How could I reproduce the problem? It's work properly on my side, startTime=8:30, endTime=9:30, (even change timeZone to Europe/Athens) thanks 👍

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/khacpv/Calendar-Day-View/issues/11#issuecomment-334194524, or mute the thread https://github.com/notifications/unsubscribe-auth/AYeG07o-ct7sMTgzbxsEXkw7LMMaEU0oks5so6RhgaJpZM4Pqgbc .

khacpv commented 7 years ago

@cristidan94 I tried to use fragment (v4) but still can not reproduce the problem? are you missing something not only about fragment? or could you send me your test code (with fragment)

cristidan94 commented 7 years ago

https://drive.google.com/open?id=0B3MPDaIghLT9TmNIRXdONktzazg

Here I have uploaded a test project. The project opens with the MainActivity ( where the calendar is in the activity and works as intended ). It has added two events, if you click them it will take you to the second activity, named TestActivity. This second activity is a container for a TestScheduleFragment where the event code is the same as in the activity, but the results differ.

Also, I have recorded my screen and you can find the video here: https://drive.google.com/open?id=0B3MPDaIghLT9MUREMTlLNloteWM

On Tue, Oct 10, 2017 at 1:01 PM, khacpham notifications@github.com wrote:

@cristidan94 https://github.com/cristidan94 I tried to use fragment (v4) but still can not reproduce the problem? are you missing something not only about fragment? or could you send me your test code (with fragment)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/khacpv/Calendar-Day-View/issues/11#issuecomment-335423932, or mute the thread https://github.com/notifications/unsubscribe-auth/AYeG0wMppL5opiMPCpqftsDPGrc3U7jtks5sq0BigaJpZM4Pqgbc .

khacpv commented 7 years ago

@cristidan94 I found the problem: you missing this:

<com.framgia.library.calendardayview.CalendarDayView
            android:id="@+id/calendar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:dayHeight="@dimen/dayHeight"   ---> missing this
            app:eventMarginLeft="0dp"/>

seem error from library, mDayHeight should have a default value if is not declared in xml. I'll fix this in library. Anw, you could add this for a quick solution. Thank you for ardor contributed!

cristidan94 commented 7 years ago

I cant believe this was the error! Thank you for helping me with this, and I'm glad I could contribute to your awesome library! Keep the awesome projects coming!

On Tue, Oct 10, 2017 at 2:53 PM, khacpham notifications@github.com wrote:

@cristidan94 https://github.com/cristidan94 I found the problem: you missing this:

<com.framgia.library.calendardayview.CalendarDayView android:id="@+id/calendar" android:layout_width="match_parent" android:layout_height="wrap_content" app:dayHeight="@dimen/dayHeight" ---> missing this app:eventMarginLeft="0dp"/>

seem error from library, mDayHeight should have a default value if is not declared in xml. I'll fix this in library. Anw, you could add this for a quick solution. Thank you for ardor contributed!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/khacpv/Calendar-Day-View/issues/11#issuecomment-335448406, or mute the thread https://github.com/notifications/unsubscribe-auth/AYeG04vkIamRd0Ht4LP-8zuv0TNw17Pdks5sq1rAgaJpZM4Pqgbc .