Giter Site home page Giter Site logo

Comments (11)

imaffett avatar imaffett commented on July 27, 2024

It's virtually impossible to get the exact native performance. Since only iOS 5 allows fixed positioning (and scrolling divs which act funky), everyone is stuck writing their own scrolling library.

If you can provide more info, we'll be happy to look into this.

from appframework.

kjb avatar kjb commented on July 27, 2024

The iScroll-4 library has an implementation that feels pretty good.

It uses a momentum function as follows:

_momentum: function (dist, time, maxDistUpper, maxDistLower, size) {
    var deceleration = 0.0006,
        speed = m.abs(dist) / time,
        newDist = (speed * speed) / (2 * deceleration),
        newTime = 0, outsideDist = 0;

    // Proportinally reduce speed if we are outside of the boundaries 
    if (dist > 0 && newDist > maxDistUpper) {
        outsideDist = size / (6 / (newDist / speed * deceleration));
        maxDistUpper = maxDistUpper + outsideDist;
        speed = speed * maxDistUpper / newDist;
        newDist = maxDistUpper;
    } else if (dist < 0 && newDist > maxDistLower) {
        outsideDist = size / (6 / (newDist / speed * deceleration));
        maxDistLower = maxDistLower + outsideDist;
        speed = speed * maxDistLower / newDist;
        newDist = maxDistLower;
    }

    newDist = newDist * (dist < 0 ? -1 : 1);
    newTime = speed / deceleration;

    return { dist: newDist, time: mround(newTime) };
},

Under an MIT-type license: https://github.com/cubiq/iscroll/blob/master/license.txt

from appframework.

ryanflorence avatar ryanflorence commented on July 27, 2024

Sencha Touch's implementation feels better on Android than native. It can be done.

from appframework.

matthias avatar matthias commented on July 27, 2024

The same occurs for the carousel. Lists and carousel seem to have a maximum speed that is well bellow the speed of my thumb / fingers.

from appframework.

sindresorhus avatar sindresorhus commented on July 27, 2024

Scrollability is also pretty smooth.

from appframework.

imaffett avatar imaffett commented on July 27, 2024

Sencha Touch's performance has been sub par on every device we have tested (Galaxy S, Droid, Droid Bionic, Droid X/X2).

I think the issue is the easing method. @kjb please commit a patch/pull request and we'll test it.

from appframework.

imaffett avatar imaffett commented on July 27, 2024

I broke out an iPad and found the big culprit is the CSS on the list item elements. When I remove them, scrolling is much better. We're redoing the CSS on the kitchen sink demo for the list items. Also looking into the momentum from iscroll4

from appframework.

cjvraay avatar cjvraay commented on July 27, 2024

It would also help if the "stretch tension" increased as you scroll beyond the bounds of the content, so as you drag the amount of movement becomes less.

from appframework.

imaffett avatar imaffett commented on July 27, 2024

A lot of people seem to have opinions on how things should work, but very few are submitting patches. We're limited in time and resources for what we want to get in the 1.0 release. For the most part, we are happy with how core pieces function, so when we see requests like this it's really low on the priority list.

from appframework.

imaffett avatar imaffett commented on July 27, 2024

@cjvraay - Ok...turns out we had something like this in another project, so it's been merged in and will be apart of the next update.

from appframework.

cjvraay avatar cjvraay commented on July 27, 2024

Thanks @imaffett

from appframework.

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.