Open thellmund opened 6 years ago
Thank you :D
Que cambios has hecho para que funcione? Gracias!
Thanks :)
I have made another fork that solves this problem. This time, it supports API 14+
This is what I have done:
I have replaced this
canvas.clipRect(0, mHeaderHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight(), Region.Op.REPLACE);
with this
canvas.save();
canvas.clipRect(0, mHeaderHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight());
canvas.restore();
So basically I have removed Region.Op.REPLACE and I have added canvas.save(); and canvas.restore();
@fersical I’ve done exactly what @marcoscgdev has described above. In the future, I want to make more changes, such as improving the scrolling behavior and tweaking the design a little.
@thellmund Can you update your readme for your release 2.0 with new interfaces and attributes ?
@wallforfry I hope to have some time this weekend to work on the library. This will include updating the readme.
@wallforfry I finally just pushed a new version of the library and an update to the readme. Let me know if there's anything missing or if you have any improvement ideas.
@thellmund Thanks for your work ! I've got improvement ideas :
@wallforfry Great suggestions – I’ll keep them in mind for the next versions 👍
@thellmund this method won't work if I compile my app with API 28
canvas.save(); canvas.clipRect(0, mHeaderHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight()); canvas.restore();
I am getting the same issue .
@nivritgupta You’re referencing @marcoscgdev’s fork.
@thellmund I think @nivritgupta is implementing his own fork. Your fork and also my fork are correctly working.
@marcoscgdev 🤷♂️
@marcoscgdev in the last 2 years I customised this library according to my requirements but now I am using your fork in my app and do some changes according to my requirements but I am getting another issue , single event showing 3 times on same time slot ,
@nivritgupta Everything is working fine for me 🤔
@marcoscgdev I understand your code is working fine , I am trying to find the exact cause of this issue in my code .
@nivritgupta You are likely not implementing the MonthChangeListener (or WeekViewLoader) correctly. It requests 3 periods (eg. previous month, current month, next month). If you return the same event each time then it will display 3 times. Make sure you are correctly constraining the events to the arguments passed into whatever method you've implemented to fetch the events.
Hey there, First of all i must appreciate your work, my developer use this library and he's no more with me so i have to do the changes but the changes i need wasnt in the real library but your updates really save my day. And now im having a little problem like @nivritgupta dose and i have read your suggestion to check MonthChangeListener but i dont find the issue. That would be really helpful if you can help me to make this right. The picture and the code of MonthChangeListener is mentioned below to better explain my problem.
override fun onMonthChange(startDate: Calendar?, endDate: Calendar?): ArrayList<WeekViewDisplayable<Event>>? { return events }
@WasifNadeem90 You need to filter out events that don't exist between the startDate and endDate.
Something like the following should work.
override fun onMonthChange(startDate: Calendar?, endDate: Calendar?): List<WeekViewDisplayable<Event>>? {
return events.filter { event ->
(event.startTime >= startDate && event.startTime <= endDate)
|| (event.endTime >= startDate && event.endTime <= endDate)
}
}
The reason is that the onMonthChange method will get called 3 times (once with the previous month, once with the current month and once with the next month). If you return the same set of events each time, each event will be returned 3 times. This will cause it to show 3 times.
@marcoscgdev hope you are doing well , any ideas how we can implement drag and drop events features in this library ?
@nivritgupta Probably by adding a touch listener when long-pressing an item that listens for user drag events and changes the item position based on that events.
how to disable horizontal scrolling
thanks u work as expected
Hi guys,
I’ve experienced some problems with the library when using API 28 in our app (deprecated canvas methods). Because the library seems to be no longer maintained, I’ve forked the repository and implemented a fix.
You can find it at https://github.com/thellmund/Android-Week-View. Hope this helps anyone who’s had similar problems 😊