Comments (11)
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.
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.
Sencha Touch's implementation feels better on Android than native. It can be done.
from appframework.
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.
Scrollability is also pretty smooth.
from appframework.
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.
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.
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.
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.
@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.
Thanks @imaffett
from appframework.
Related Issues (20)
- panelload triggered twice on "back" action HOT 2
- Variable mistyped in adding $.afui.showMask() timeout parameter
- Header buttons doesn't work HOT 1
- hao to add my icon
- ajax problem
- Side menu fail in iOS if fastclick is not installed
- $.afui.loadContent issue HOT 4
- IDE crashes when the app designer is in use HOT 9
- cadastro
- Where is the documentation ? HOT 3
- Docs HOT 2
- $.afui.loadAjax issues HOT 1
- couldn't scroll? pc web can scroll but on the iphone safari couldn't
- Question: "af.ui.js:622 Uncaught ReferenceError: timeout is not defined", why? HOT 2
- how to pass value between two pages? HOT 1
- Handling of 'touchstart' input event was delayed HOT 1
- data-footer="none" not hiding footer
- I doubt that I found some bugs, but can not confirm...
- Why I'cant use Custom Fonts? HOT 1
- How can i add a search box?
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 appframework.