Reputation: 178
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?
Upvotes: 2
Views: 1192
Reputation:
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);
Upvotes: 4
Reputation: 6928
MenuDrawer has a xml attribute for the size - mdMenuSize.
Alternatively you can set this programmatically too with the setMenuSize method of the menudrawer.
Upvotes: 4