Telerik-Verified-Plugins / NativePageTransitions

Native transitions like Slide and Flip for iOS, Android and Windows Phone
277 stars 107 forks source link

Error after navigating using sqlite on android #9

Open Juliete opened 9 years ago

Juliete commented 9 years ago

I´m trying to use this plugin in an app tha uses jaydata(sqlite provider) for database support, after navigating, database calls fails with the message, "database has been closed" .

On iOS works fine.

EddyVerbruggen commented 9 years ago

Hmm, that's not supposed to happen of course.. is there a way for me to take a look at your source code so I can reproduce this problem?

Juliete commented 9 years ago

I´ll try to get time to make a running example that reproduce the behavior. Although my main interest in the plugin is to resolve some navigation issues in iOS8 using the kendo ui mobile framework. Using the plugin this issues disappears.

arfa commented 9 years ago

I have the same issue. My app use websql to store data and when I try to change the page I get a SQLError with the message: "database has been closed".

I noticed that if I navigate between static pages, it works very well. but when I try to navigate to a dynamic page the error appears.

hkcity1111 commented 9 years ago

I got this problem too on android and I search internet that this problem may come back memory leak form webkit. Is there any solution at this moment? Thanks!

https://bugs.webkit.org/show_bug.cgi?id=68303

EddyVerbruggen commented 9 years ago

I'd love to check this out but it's most efficient for me to be able to quickly reproduce it with some sample app or code. If you have something, please dm me at eddyverbruggen at gmail dot com, thanks!

Juliete commented 9 years ago

The problem must be in our code, I tried to reproduce the problem from the sample provided by the people of jaydata, but the error does not happen.

https://github.com/Juliete/kendomobiledemo/tree/NativeTransitions

hkcity1111 commented 9 years ago

I am not so sure whether the code is with problem. But I turn on _flagNativeTransition in my developing app and using jquerymobile with original transition without problem. If I just switch to _flagNativeTransition to true and problem will be easily produced after several slide up transitions are done when I use htmlsql.js to readtransaction in WebSql (Just select * from sometable order by lasteditdate).

Just busy for project. Maybe later produce sample app for further study. The following is sample coding for reference Thanks!

slidePage: function (direction, href, forceTransitionMode, callback, errorCallback) {
        var _flagNativeTransition, _transition, _reverse;

        if (_flagNativeTransition) {
            console.log("*** native transition begin=" + $(':mobile-pagecontainer').pagecontainer('getActivePage')[0].id + ", direction=" + direction + ", href=" + href );

            var _fixedPixelTop, _fixedPixelBottom;

            if (hsDevice.isIOS()) {
                _fixedPixelTop = $("#header-bar").height();
                _fixedPixelBottom = $("#navbar").height();
            } else {
                _fixedPixelTop = $("#header-bar").height();
                _fixedPixelBottom = $("#navbar").height();
            }
            var options = {
                "direction": direction,
                "href" : href,
                "duration": hsConfig.nativeDuration,
                "iodelay": hsConfig.nativeiodelay,
                "androiddelay" : hsConfig.nativeandroiddelay,
                "fixedPixelsTop" : _fixedPixelTop,
                "fixedPixelsBottom" : _fixedPixelBottom
            }
            window.plugins.nativepagetransitions.slide(
                options,
                // on success
                function () {
                    console.log("*** native transition end=" + $(':mobile-pagecontainer').pagecontainer('getActivePage')[0].id + ", direction=" + direction + ", href=" + href );
                    if (callback && typeof(callback) == "function") {
                        console.log("slidePage callback function calling");
                        callback();
                    };

                },
                function () {
                    console.log("*** native transition error=" + $(':mobile-pagecontainer').pagecontainer('getActivePage')[0].id + ", direction=" + direction + ", href=" + href );
                    if (errorCallback && typeof(errorCallback) == "function") {
                        console.log("slidePage error callback function calling");
                        errorCallback();
                    }

                }
            );

        } else {
            if (direction == "left") {
                _transition = "slide";
                _reverse = false;
            } else if (direction == "right") {
                _transition = "slide";
                _reverse = true;
            } else if (direction == "up") {
                _transition = "slideup";
                _reverse = false;
            } else if (direction == "down") {
                _transition = "slideup";
                _reverse = true;
            };

            console.log("direction=" + direction + ",href=" + href + " _transition=" + _transition + " , _reverse=" +_reverse);
            $.mobile.changePage(href, {
                transition: _transition,
                reverse: _reverse
            });
        }
    },