Apply transition class to android back button

1
Hi all   I'm adding mobile app functionality to an existing app, and have created an app-like navigation UX using slide transition classes on buttons. However, I'm wondering how I can add one of these classes to the android back button, so that whenever it is pressed, the current screen slides right to reveal the previous screen?   Thanks Ferg
asked
2 answers
1

I think you need something like this in an HTML (javascript) snippet. This is untested but should get you started. It's supposed to listen to the event when the backbutton is pressed, and prep a transition to occur. Then, the transition that we prep here should get picked up by the Mobile Features widget, so that it gets fired as the "back" page navigation occurs.

 

Give it a try and let me know if it works!

document.addEventListener("backbutton", onBackKeyDown, false);

function onBackKeyDown() {
    // Handle the back button
    window.plugins.nativepagetransitions.nextTransition = "slide";
    window.plugins.nativepagetransitions.nextOptions = {
        "direction": "right", // "left|right|up|down"
        "duration": 400, // default 400ms
        "slowdownfactor": 2,
        "iosdelay": -1, //defer transitions until they"re called later
        "androiddelay": -1, //defer transitions until they"re called later
        "winphonedelay": 200, // same as above but for Windows Phone, default 200,
        "fixedPixelsTop": 0, // the number of pixels of your fixed header
        "fixedPixelsBottom": 0 // the number of pixels of your fixed footer
    };
}

 

answered
0

Hi Ferg,

did you got a solution for this one? 

answered