Android-PanesLibrary
Android-PanesLibrary copied to clipboard
Menu Fragment with minimum width
Hi!
is it possible to set a minimum width on the menu fragment? So when the menu fragment can be visible, it is shown ( for example ) as a smaller ribbon? Of course if you move deeper into the stack and the menu fragment cannot be shown anymore, that small ribbon would be gone.
So you would see, for example
0 ( small ribbon, showing icons of the menu list ) | 1 | 2
moving to the left
0 ( full menu opened ) | 1 | possible 2 (depending on layouts)
moving to the right
1 | 2 | 3
Thank you.
i should mention this is only important for tablets.
You should be able to implement that using PaneSizer.
public static final int PANE_MENU = 0;
public static final int PANE_DEFAULT = 1;
private class CustomPaneSizer implements PaneSizer {
public int getWidth(int index, int type, int parentWidth, int parentHeight) {
if (type == PANE_MENU) return ?;
return (parentWidth - 80) / 2;
}
public int getType(Object o) {
if (o instanceof MenuFragment) return PANE_MENU;
return PANE_DEFAULT;
}
...
}