Coder Social home page Coder Social logo

Comments (8)

 avatar commented on June 17, 2024

I've run into similar issue with my app and the problem is that TileView (or actually it's parent ZoomPanLayout) triggers a fling gesture even if the distance between two motion events is very small, thus causing some unwanted scrolling. This can be found in ZoomPanLayout.java around line 760 - performFling().

from tileview.

moagrius avatar moagrius commented on June 17, 2024

@redred77 sorry I didn't notice this issue when it was created. i did see the notification when onder7973 replied. My guess is that you're seeing artifacts as new samples and tile sets are rendered before the previous have been cleaned up. I'd suggest turning transtions off and setting all detail levels to the same sample image (just to test, not as a fix). If you don't see the flicker after that, it's probably as I guessed. If not, post back and I'll dig in a little more.

@onder7973 I think redred77 is experiencing something different. I think you're describing a pinch gesture that results in a small fling? LMK if that's not right. Otherwise, if you'd like to modify ZoomPanLayout to have a minimum distance reached before a fling is invoked, feel free to fork and issue a pull request. As long as existing API doesn't break, the code is legible, consistent with existing patterns, and performs reasonably, I'll generally accept pull requests that expand the usability of the widget.

That said, if you don't have the time or inclination to do it, I might add it if/when I get some appreciable free time, or if several users request it as well.

Thanks for your input.

from tileview.

 avatar commented on June 17, 2024

@moagrius my comment was based on redred77's details:

"When I double tap, view scales to that position smoothly but sometimes it flickers."

that seemed very familiar to me as to what I noticed when double tapping the view. If you actually do the double tap pretty quickly it does fling the view and then scrolls/zooms based on doubletap gesture, which may look like flickering. Plus I can confirm that adding a min distance prevents this (I have a code in place that works). I'll see if I can fork it as I am normally using SVN with my projects, not Git.

from tileview.

moagrius avatar moagrius commented on June 17, 2024

cool

from tileview.

kwent avatar kwent commented on June 17, 2024

Changing the MINIMUM_VELOCITY constant from 50 to something like 500 is an easy way to fix the flickering without removing the fling Method.

50 as a default seems way too small I believe as it triggers with double taps.

from tileview.

moagrius avatar moagrius commented on June 17, 2024

I'm open to both approaches. If no one provides a reasonable fork in the next couple weeks, I'll do a patch myself.

from tileview.

redred77 avatar redred77 commented on June 17, 2024

I read all comments and could find the problem.
I think adjusting MINIMUM_VELOCITY is not the solution for inner problem.
The point is, fling scroll and double tap scrolling can occur simultaneously.
I think to stop fling before start double tap scrolling is more reasonable.

if (determineIfQualifiedDoubleTap()) {
scroller.forceFinished(true); // to stop fling
saveHistoricalScale();
saveDoubleTapHistory();
...

I am not sure if it is consistent and working well with all existing sources but it works well on my project.

from tileview.

moagrius avatar moagrius commented on June 17, 2024

thanks @redred77 - I've included your patch in the latest commit.

from tileview.

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.