Coder Social home page Coder Social logo

Comments (6)

bduncavage avatar bduncavage commented on August 11, 2024

Thanks for reporting that issue. I hope to be able to devote some time to outstanding issues this weekend.

If you have any patches/insight regarding a fix, feel free to make a pull request :)

from pulltorefresharp.

ansuria avatar ansuria commented on August 11, 2024

You're welcome, and sorry but no, I can't offer a solution. I looked into it and would've made a pull request if I had found a way to work it out.

I went down the path of modifying the ViewWrapper::OnInterceptTouchEvent function to ignore the touch event if the fast scrolling thumb is visible. The android.widget.FastScroller class has a public isVisible() function that would make that easy. Unfortunately, the android.widget.AbsListView class that declares the FastScroller instance declares it privately and doesn't provide a public getter that I saw.

AbsListView also has a protected "isVerticalScrollBarHidden" function, which checks for the existence of a FastScroller instance and its "isVisible" function return value. The result of that function is exactly what is needed to implement the solution I was considering but it is a protected, not public, function.

Hopefully you can come up with a different approach that will work or see something that I overlooked. Good luck and thanks for the component!

from pulltorefresharp.

bduncavage avatar bduncavage commented on August 11, 2024

I've come up with an, admittedly, somewhat naive solution to the problem. Checkout the new fastscroll branch to see what I've done to fix the issue (the sample app has been updated with a test for listview with fast scroll enabled as well), and let me know your thoughts.

Basically, the ViewWrapper checks if the ContentView is an AbsListView and has FastScrollEnabled. If that is the case, it simply ignores any touches within the boundary of where the fast scroll will be displayed. The value for the width of the fast scroll I gleaned from the Android R.dimens.fastscroll_thumb_width, which is unfortunately private (I could make this a configurable value for users who will be setting custom thumb drawables).

I know this isn't the greatest solution, but it does accomplish the goal of allowing fast scroll to work properly in conjunction with PullToRefresharp.

The diff: master...fastscroll

from pulltorefresharp.

ansuria avatar ansuria commented on August 11, 2024

Thanks for coming up with a fix for that Brett. That works for me. Its too bad the needed state info is out of reach, but that isn't your fault. I think this is the best solution given the information the component has available to it.

I also agree it will probably save you a future defect by making the thumb scroll width be configurable. I don't need that, but I can see where other users could.

from pulltorefresharp.

bduncavage avatar bduncavage commented on August 11, 2024

Ok, I'm going to merge this change then. There may be a more accurate way (yet still somewhat hacky) to determine if the fastscroll overlay is visible onscreen by inspecting the view hierarchy for the overlay and checking its visibility state, but for now I think this fix is sufficient.

from pulltorefresharp.

bduncavage avatar bduncavage commented on August 11, 2024

Closed with: 6dc2e19

from pulltorefresharp.

Related Issues (17)

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.