Android Scroll Issue

I am experiencing an issue with Scrollers in Android. If I start scrolling and lift my finger and go to continue scrolling before the scroll animation has complete the scroll will bounce back and restart from the original position. I have tried making sure touch: true and touchScrolling: true as well as setting the strategyKind: "TranslateScrollStrategy". Nothing seems to fix the issue. I have tested in the emulator, Nexus 4, and Note 4.

If you need to see it in action you grab "Mobile Florist" and go to "Privacy & Security" and try to scroll and you will see the issue.


...

components: [
{kind: "Signals", onbackbutton: "backTap"},
{layoutKind: "FittableRowsLayout", classes: "panelBG", components: [
{kind: "onyx.Toolbar", classes: "headerBar", components: [
{name: "contentHeader", content: "Privacy & Security"}
]},
{kind: "Scroller", touch: true, touchScrolling: true, components: [
{kind: "FittableRows", fit: true, components: [

...

Comments

  • Seems if I set the strategyKind: "ScrollStrategy" the scroll glitch goes away. However now due to an iOS 8 bug, the webview crashes :(

    [WebActionDisablingCALayerDelegate setBeingRemoved:]: unrecognized selector sent to instance
  • We'll take a look into this and see what we can find. I wonder if it might be related to an issue with Android detection we have a pull request for? In any case, you might use platform detection to set the scrollStrategy only for Android.
  • Thanks Roy, however it seems that strategyKind can only be set at design time according to this thread: http://forums.enyojs.com/discussion/1890/scroller-settouch

    Any suggestions on how to approach this till Apple fixes the CSS Touch bug? On the plus side iOS is ignoring the exception so the app still chugs along as if nothing happened but having errors like that just irk me ;).
  • You should be able to add your own evaluation code and apply a different strategy kind by extending the scroller's constructor:

    constructor: enyo.inherit(function(sup) {
    return function(inProps) {
    if (enyo.Scroller.hasNativeScrolling()) {
    inProps.strategyKind = "ScrollStrategy";
    }
    sup.apply(this, arguments);
    };
    }),
    It works in enyo 2.4, probably works in 2.5 as well.
  • Alternately, you can check the enyo platform directly in the declaration. It will be ready by the time the kind is parsed.
  • Just as a follow up, I was able to use Ruben's suggestion to make things work properly on all platforms.
  • roy can you give an example how you do that?
  • Here's a simple example showing how you can use the platformName field during component declaration. You could just as easily use that to set the scroller strategy:

    { kind: Scroller, strategyKind: platform.ios ? ScrollStrategy : TouchScrollStrategy, ...

    As a heads-up: We discovered that the animator was incorrectly using setTimeout on iOS because of a bug in iOS 6. It should have been using requestAnimationFrame on later iOS versions but was not. This could be causing performance issues on iOS. This is corrected in 2.7.
Sign In or Register to comment.