Question

I'm using the Android MenuDrawer from https://github.com/SimonVT/android-menudrawer in my Activity. After Updating the Library, the Menu was a little bit smaller than before. How can I change the size (width) of the Menu?

Was it helpful?

Solution

MenuDrawer has a xml attribute for the size - mdMenuSize.

Alternatively you can set this programmatically too with the setMenuSize method of the menudrawer.

OTHER TIPS

before on create method:

private MenuDrawer mDrawer;

public static final int TOUCH_MODE_NONE = 0;

After on Create method:

mDrawer.setMenuSize(600);

600 is in dp set as u like

following is piece of my code:

    mDrawer = MenuDrawer.attach(this);
    mDrawer.setTouchMode(TOUCH_MODE_NONE);

    DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    int width = dm.widthPixels;

    if(width>=640)
        mDrawer.setMenuSize(600);
    else if(width<640)
        mDrawer.setMenuSize(400);


    mDrawer.setContentView(R.layout.drawermain);
    mDrawer.setMenuView(R.layout.drawermenu);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top