Giter Site home page Giter Site logo

Comments (3)

jhoobergs avatar jhoobergs commented on July 29, 2024

@nbeuret I'm sorry for the late reply, seems I forgot to. Can you add an event to the example class from 17 tot 00 ? And check if that event is shown ? If you push it to a fork, I can also test it and debug.

from android-week-view.

Menthuss avatar Menthuss commented on July 29, 2024

Can confirm this bug. Any event that ends at 00:00 is not shown.

EDIT: I've figured out what's causing this issue:
Inside the expandEventsToMaxWidth(List<EventRect> collisionGroup) method in the WeekView class, at line 1414 this statement is the root cause:
eventRect.bottom = getPassedMinutesInDay(eventRect.event.getEndTime());

For events where the endTime is midnight of the next day, the getPassedMinutesInDay() method will return 0.
Later on, when the library tries to render the rectangle for the event in the drawEvents(Calendar date, float startFromPixel, Canvas canvas) method, the following statement, bottom = mHourHeight * bottom / 60 + mCurrentOrigin.y + mHeaderHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2 - mEventMarginVertical - marginTop; at line 1039 will produce a negative float because bottom is 0.

Finally, the If statement at line 1050 if (left < right && left < getWidth() && top < getHeight() && right > mHeaderColumnWidth && bottom > mHeaderHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom) that determines whether or not the EventRect has valid coordinates will fail and result in the event's rectangle getting set to null.

from android-week-view.

Menthuss avatar Menthuss commented on July 29, 2024

@jhoobergs Any chance you could take a look at my pull-request that fixes this issue any time soon?

from android-week-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.