Comments (11)
I can have a look at some time and see if I can test it with CollapsingToolbarLayout or RecyclerView and fix the problem. It would be good if you can upload an example but it's not required. Maybe an experiment can be to overide the `onTouch()`` for RecyclerView for example and disable scrolling to see what happens.
from compactcalendarview.
I've had a quick look at CollapsingToolbarLayout, I havn't looked at the android source code for this yet. But my hunch is that CollapsingToolbarLayout doesn't play nice with GestureDetector and it might be something todo with how it handles events inside onInterceptTouchEvent
.
I never intended it to be used inside a CollapsingToolbarLayout/RecyclerView so it maybe a little more difficult todo. I think maybe embeding the Calendar inside a custom view pager might fix the problem. But I will keep this ticket posted after I look through the android source code.
from compactcalendarview.
@zilimojo
I had also the same problem and I have fixed it with overriding app:layout_behavior
to my own layout behavior which returns false
in onInterceptTouchEvent
. (This disables vertical scroll for the CollapsingToolbarLayout
)
See for details in this repository. Specifically this and this file.
@SundeepK
Thanks for the great library! I was been searching for some time for a calendar view similar to the Google Calendar app.
from compactcalendarview.
Well done! Yes looks like my hunch was right. I was planning to provide a custom Layout to go with the library that overrided the behaviour but you have done some of that work. Many thanks.
I'll spend some time over the weekend to look further into this.
from compactcalendarview.
As an update, I've been experimenting with some animations for opening/closing the calendar. This way you don't necessarily have to embed the calendar within the toolbar. And the you will be able to open/close the calebdar via method call.
Note the gif is slowed down for some reason, possibly when I compressed it, not sure. Might upload a better one when I get time.
from compactcalendarview.
I have merge a potentail fix for this bug to master, hopefully it will fix the problem. If anyone is interested, you can important the library locally and test it out. Will release a new version once I have made a few changes to master.
from compactcalendarview.
I have released a new version:
dependencies {
compile 'com.github.sundeepk:compact-calendar-view:1.8.5'
}
I think this should resolve this issue, have a go and let me know if this works.
from compactcalendarview.
Hello,
I used your Calendar inside a RecyclerView and had the same issue. The fix you applied still prevents vertical scrolling if we're touching inside the CalendarView. The problem is that you're preventing the parent to intercept touch as soon as the CalendarView is touched, no matter if the touch is a simple click, a scroll (vertical or horizontal) or anything else.
To correct that, I've made 2 changes :
- For the horizontal scrolling, there is actually a method in View (that appeared in API 14) that sets if a given View can scroll horizontally and fortunately, the ViewPager reads it. We simply need to override the method "canScrollHorizontally" and return true :
https://developer.android.com/reference/android/view/View.html#canScrollHorizontally(int) - For the vertical scrolling, I resolved it using the same trick you used for #82 but limited to a horizontal scroll : when I detect that the Calendar is scrolled horizontally, I prevent the parent to scroll. And I then re-allow it to intercept scrolling when the scroll is finished.
I'll open a Pull-Request with those modifications if you're interested in reviewing them.
from compactcalendarview.
@JulienArzul Thanks for the pull request, I've left a comment.
from compactcalendarview.
I believe this problem should now be fixed. I have tested this inside a ViewPager andToolbar (as shown above). I'll test inside a RecyclerView at somepoint just to be sure, before releasing a new version. Perhaps, I can add some additional acitivty to the sample to demonstrate that it works.
from compactcalendarview.
Fixed in version:
dependencies {
compile 'com.github.sundeepk:compact-calendar-view:1.9.4'
}
from compactcalendarview.
Related Issues (20)
- Swipe left and swipe right listener HOT 1
- Background color of abbreviations (weeks)
- Events from REST API
- Work on emulator but not on device
- One event on day : Big circle; multiple event on a day : Big circle + little dot
- Can I use another fonts?
- How to select more days and disable others days tap? How to enable tap only on selected days
- error with add event function
- Color description bar
- error: failed linking references.
- error: resource android:attr/lStar not found.
- using talkback
- Adding Events to CompactCalendar from api call
- Clear Selection
- How to remove the selected current date background when month is scrolled?
- How to present only 1 week ?
- How to pass Calendar as argument?
- Issue
- Events not showing in some android devices api level 33
- Cannot add event line indicator inside selected day circle
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 compactcalendarview.