SimonVT/android-menudrawer — pull request #37 by mnexo (2012-11-13 12:24:12+00:00)
Title: Support for placing the drawer above the content.

Hey Simon/Jake

First of all, thanks for sharing your app menu drawer implementation.

I've extended the library a little, adding support for placing the drawer above the content, useful for playback controls or other status information.

You can see a use case from one of our apps here where the ongoing cooking timers in a recipe app are displayed in a drawer above the recipe: https://dl.dropbox.com/u/1288556/GoCookTimers.png.

Notes on the implementation:

- All fields now representing width or height (depending on the drawer's gravity) have
been renamed from 'width' to 'size', e.g. `mMenuWidth` => `mMenuSize`.

- Deprecated `MenuDrawer.setMenuWidth` and `MenuDrawer.setDropShadowWidth` in favor of
`MenuDrawer.setMenuSize` and `MenuDrawer.setDropShadowSize`. Same story for the
styleable attributes `mdMenuWidth` and `mdDropShadowWidth`.

- Added `MenuDrawer.MENU_POSITION_TOP` constant for use with the `gravity` argument in
`MenuDrawer.attach`. Also refactored the creation of the drawer object into it's own helper method,
`MenuDrawer.createMenuDrawer`.

- Introduced `HorizontalMenuDrawer` specializing `onMeasure` and touch-related methods for
horizontally oriented drawers (could use a better name).

- `TopDrawer` is simply a clone of `LeftDrawer`, swapping the x and y axes as appropriate.

- Access modifiers on a few fields and methods in `MenuDrawer` had to be changed from
`private` to `protected` in order to specialize behavior in the new sub-classes.

- Added a sample activity demonstrating the use of TopDrawer.

Let me know what you think. Thanks!
Michael Nexo