Android-PanesLibrary icon indicating copy to clipboard operation
Android-PanesLibrary copied to clipboard

Menu Fragment with minimum width

Open Trikke opened this issue 11 years ago • 2 comments

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.

Trikke avatar Jul 18 '13 08:07 Trikke

i should mention this is only important for tablets.

Trikke avatar Jul 18 '13 09:07 Trikke

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;
    }

    ...
}

cricklet avatar Jul 29 '13 21:07 cricklet