Comments (10)
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.
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.
This is with a resolution of 60 ?
from android-week-view.
Yes
from android-week-view.
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.
And can I fix it for events of 1 hour like Google Calendar?
from android-week-view.
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) andendMinute = startMinute + mNewEventTimeResolutionInMinutes
from android-week-view.
Yes, that would be correct
from android-week-view.
@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.
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)
- Bug with goToHour method when time range is set HOT 3
- Serious bug in viewing events : not showing all events that are given HOT 1
- Bug: adding full day WeekViewEvent with same startDate and endDate results in single cell HOT 1
- Event not drawing on 31st day of month HOT 2
- Events Not loading after asynchronous call
- On Load scroll to current time, not 12am HOT 1
- disable fling doesn't seem to work correctly HOT 1
- Crash issue
- Enchanced : customize the date format
- Preview Render Problems HOT 1
- Add Event Dynamically HOT 3
- Crashes on API 28
- doesnt shows anything any help HOT 1
- Needs to Click the gototoday before showing all the events
- How to implement a multi-line String on header date
- Drag and Drop feature on marked Events HOT 3
- 动态添加event 一直返回
- Event title vertical alignment
- Multiple events on same day not showing
- is it possible to turn off zoom?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-week-view.