package com.reactnativenavigation.views;

import android.content.Context;
import android.support.v4.widget.DrawerLayout;
import android.view.Gravity;
import android.widget.RelativeLayout;

import com.reactnativenavigation.params.SideMenuParams;
import com.reactnativenavigation.utils.ViewUtils;

public class SideMenu extends DrawerLayout {

    private ContentView sideMenuView;
    private RelativeLayout contentContainer;

    public RelativeLayout getContentContainer() {
        return contentContainer;
    }

    public void destroy() {
        sideMenuView.ensureUnmountOnDetachedFromWindow();
        removeView(sideMenuView);
    }

    public void setVisible(boolean visible, boolean animated) {
        if (!isShown() && visible) {
            openDrawer(animated);
        }

        if (isShown() && !visible) {
            closeDrawer(animated);
        }
    }

    public void openDrawer() {
        openDrawer(Gravity.LEFT);
    }

    public void openDrawer(boolean animated) {
        openDrawer(Gravity.LEFT, animated);
    }

    public void closeDrawer(boolean animated) {
        closeDrawer(Gravity.LEFT, animated);
    }

    public void toggleVisible(boolean animated) {
        if (isShown()) {
            closeDrawer(animated);
        } else {
            openDrawer(animated);
        }
    }

    public SideMenu(Context context, SideMenuParams sideMenuParams) {
        super(context);
        createContentContainer();
        createSideMenu(sideMenuParams);
    }

    private void createContentContainer() {
        LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        contentContainer = new RelativeLayout(getContext());
        contentContainer.setId(ViewUtils.generateViewId());
        addView(contentContainer, lp);
    }

    private void createSideMenu(SideMenuParams sideMenuParams) {
        sideMenuView = new ContentView(getContext(), sideMenuParams.screenId, sideMenuParams.navigationParams);
        LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
        lp.gravity = Gravity.START;
        addView(sideMenuView, lp);
    }
}

@@ -67,16 +67,62 @@
 ontext;%0A
+import android.support.v4.view.GravityCompat;%0A
 import a
@@ -1251,22 +1251,46 @@
   if (is
-Shown(
+DrawerOpen(GravityCompat.START
 )) %7B%0A   

Fix toggleDrawer on Android