Giter Site home page Giter Site logo

Comments (11)

SundeepK avatar SundeepK commented on July 29, 2024

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.

SundeepK avatar SundeepK commented on July 29, 2024

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.

 avatar commented on July 29, 2024

@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)

Demo:
Demo of the behavior

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.

SundeepK avatar SundeepK commented on July 29, 2024

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.

SundeepK avatar SundeepK commented on July 29, 2024

calendar-animation-optimised

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.

SundeepK avatar SundeepK commented on July 29, 2024

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.

SundeepK avatar SundeepK commented on July 29, 2024

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.

JulienArzul avatar JulienArzul commented on July 29, 2024

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 :

  1. 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)
  2. 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.

SundeepK avatar SundeepK commented on July 29, 2024

@JulienArzul Thanks for the pull request, I've left a comment.

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

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.

SundeepK avatar SundeepK commented on July 29, 2024

Fixed in version:

dependencies {
    compile 'com.github.sundeepk:compact-calendar-view:1.9.4'
}

from compactcalendarview.

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.