NappDrawer icon indicating copy to clipboard operation
NappDrawer copied to clipboard

createDrawer inside a window using NappDrawer Android

Open ChunAllen opened this issue 11 years ago • 0 comments

Hi I'm doing an Android app that requires login using Facebook + NappDrawer. I have app.js that has a button of Facebook login and if the Facebook authenticated is success the user should be redirected to authenticated.js that has a authenticatedWindow. How can I redirect my user to a page that has a nappdrawer module if the Facebook authentication is success? : I have this code app.js:

var unauthorizedWin = Ti.UI.createWindow({
    backgroundColor: "#fff"
});

unauthorizedWin.add(btnFB);
unauthorizedWin.open();
fb.addEventListener('login', function(e) {
    if (e.success) {
           var authenticatedWin = Ti.UI.createWindow({
                url: "ui/authenticated.js",
                backgroundColor: "#fff"
       });
    authenticatedWin.open();
    }else if (e.error) {
        displayToast("Failed to authenticate with Facebook");
    } else if (e.cancelled) {
      displayToast("Authenticate with Facebook was cancelled"); 
    }
});

and in authenticated.js

I have this code:

var authenticatedWin = Ti.UI.currentWindow;
.
.
.
var drawer = NappDrawerModule.createDrawer({
    fullscreen:false, 
    leftWindow: leftMenuView ,  
    centerWindow: centerView,
    fading: 0.2, // 0-1
    parallaxAmount: 0.2, //0-1
    shadowWidth:"40dp", 
    leftDrawerWidth: "250dp",
    animationMode: NappDrawerModule.ANIMATION_NONE,
    closeDrawerGestureMode: NappDrawerModule.CLOSE_MODE_MARGIN,
    openDrawerGestureMode: NappDrawerModule.CLOSE_MODE_NONE,
    orientationModes: [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT]
});

authenticatedWin.add(drawer);
authenticatedWin.open();

ChunAllen avatar Feb 14 '14 08:02 ChunAllen