Giter Site home page Giter Site logo

Click on empty item about android-week-view HOT 10 OPEN

quivr avatar quivr commented on July 29, 2024
Click on empty item

from android-week-view.

Comments (10)

jhoobergs avatar jhoobergs commented on July 29, 2024

You can use the property newEventTimeResolutionInMinutes
You should set it to 60 if you want that 7.00 to 8.00 is highlighted and to 1 if you want 7.23 to 8.23 to be highlighted. The default is 15, so it would highlight from 7.15 to 8.15 (or maybe 7.30 to 8.30 not 100% sure)

from android-week-view.

 avatar commented on July 29, 2024

Thank you for the quick response. But it works incorrectly. When I click on 7:29 it works correctly, but when on 7:31 highlighted next our, that is from 8:00 to 9:00

from android-week-view.

jhoobergs avatar jhoobergs commented on July 29, 2024

This is with a resolution of 60 ?

from android-week-view.

 avatar commented on July 29, 2024

Yes

from android-week-view.

jhoobergs avatar jhoobergs commented on July 29, 2024

I see. The reason is that it always takes the closest time (8 in case of 7.31) as the start time. For events of 1 hour, this might seem a bit strange, but for events of 2 hours, that's more logical.

from android-week-view.

 avatar commented on July 29, 2024

And can I fix it for events of 1 hour like Google Calendar?

from android-week-view.

jhoobergs avatar jhoobergs commented on July 29, 2024

The code is at https://github.com/Quivr/Android-Week-View/blob/develop/library/src/main/java/com/alamkanak/weekview/WeekView.java#L335

It would actually be best to change this code so it returns the interval (with length == resolutionInMinutes) in which the clicked time lies.

This would mean:

  • if resolution = 60 and time = 7.41 -> 7.00 to 8.00 (now 8 to 9)

  • if resolution = 120 and time = 7.41 -> 6.00 to 8.00 (now 8 to 10)

  • if resolution = 15 and time = 7.41 -> 7.30 to 7.45 (now 7.45 to 8.00)

    This would mean something like:
    startMinute = (selectedTime.get(Calendar.MINUTE) / mNewEventTimeResolutionInMinutes) * mNewEventTimeResolutionInMinutes (the first is an integer division) and endMinute = startMinute + mNewEventTimeResolutionInMinutes

from android-week-view.

 avatar commented on July 29, 2024

Yes, that would be correct

from android-week-view.

jhoobergs avatar jhoobergs commented on July 29, 2024

@devoma Do you have the time to fix this and create a PR ?

Maybe create an option to choose between the 2 types, because I think you sometimes want it to go to the closest start instead of the interval in which it lays. The field can be named mNewEventSelectionType and the type would be an Enum EventSelectionType with 2 values: InInterval and ClosestStartTime

It would also be nice if a listener could be used to create your own types maybe ? But that's not the key point.

from android-week-view.

 avatar commented on July 29, 2024

I'm ready to take it. But while I do not have time, and I can't before February. I want to contribute to this great library

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.