Implementation of the emerging fly-in menu pattern for Android apps. This utilises a high-level modification of the application window to add the fly-in menu (FIM), which is loaded from a menu resource.
This implementation is based on RibbonMenu (Copyright David Scott), but much expanded. It includes support for SearchViews and custom views, improved animations (with two different styles) and is cleaner to use.
Set your activity to override
FlyInFragmentActivity. You can load the FIM at any time by calling
loadFlyInMenu(..), after which you can attach custom views (
getFlyInMenu().setCustomView(..)) or initalise a SearchView (below).
The fly-in animation can be one of two options set using
FLY_IN_OVER_ACTIVITYbrings the fly-in menu over the Activity, obscuring it (left screenshot).
FLY_IN_WITH_ACTIVITYpushes the Activity's contents to the right (right screenshot).
You can enable a SearchView widget for the top of the FIM. After you have loaded your FIM (see above), call
enableSearchView() on the FIM instance, which can be obtained using
enableSearchView() has been called, you can retrieve and act on the SearchView with
FlyInMenu.getSearchView(). Bear in mind, this won't work below Android 3.0, and you should place any calls dealing with the SearchView in conditional clauses.
Icons are 24x24dp and follow the icon guidelines for Holo dark action icons. For quick reference:
- ldpi : 16x16px
- mdpi : 24x24px
- hdpi : 36x36px
- xhdpi : 48x48px
The icon should be white with 80pc opacity.
- The fly-in style isn't currently retained over configuration changes, fix coming soon
- Better styling
- Slide-to-close fly-in menu
- (Maybe) a "slide-under" fly-in menu, where the Activity slides over to reveal the fly-in menu
- Support for shadows
Copyright 2012 Alex Curran, David Scott in parts
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.