NappDrawer icon indicating copy to clipboard operation
NappDrawer copied to clipboard

[Android] swiping in scrollableView not possible

Open arifje opened this issue 10 years ago • 1 comments

We have a scrollableView in the center view on Android, but scrolling isn't possible.

On iOS on the other hand, this does work. Maybe because it's a window instead of views?

Is it possible to fix this for Android too?

Cheers

arifje avatar Jan 02 '15 12:01 arifje

I did it by adding event listener to the scrollable view, type scroll... In the handler function, I check for the currentPage of the scrollableView, if it's the first one (zero index), I enable the open mode of the drawer, else I disable it..

$.scrollableView.addEventListener('scroll', scrollOfScrollableView);
function scrollOfScrollableView() {
    // Disallow menu gesture while current page is not the first one
    if(OS_ANDROID) {
        var NappDrawerModule = require('dk.napp.drawer');
        if($.scrollableView.currentPage == 0) 
            Alloy.Globals.nappDrawerAndroid.setOpenDrawerGestureMode(NappDrawerModule.OPEN_MODE_ALL);
        else Alloy.Globals.nappDrawerAndroid.setOpenDrawerGestureMode(NappDrawerModule.OPEN_MODE_NONE);
    }
}

Wish I am not too late in adding this code :)

zabady avatar Feb 04 '15 17:02 zabady