HarinTrivedi / FABRevealMenu-master

A general purpose android UI library to show a user show menu in accordance of Floating action button with material design guidelines.
https://harintrivedi.github.io/FABRevealMenu-master/
Apache License 2.0
614 stars 117 forks source link

Extracted a menu function for making it possible to extend FABRevealMenu #11

Closed MFlisar closed 6 years ago

MFlisar commented 7 years ago

Why

I'm using icons based on fonts in my whole app so I don't need any drawables in it. Namely I use this library: https://github.com/mikepenz/Android-Iconics/

I recently created a menu inflation wrapper that allows to use the font based icons in menus as well and therefore I would need the change I made.

Usage

If someone wants to use iconics with your library he must simply create following class and can use it in xml:

public class IconicsFABRevealMenu extends FABRevealMenu
{
    public IconicsFABRevealMenu(Context context)
    {
        super(context);
    }

    public IconicsFABRevealMenu(Context context, AttributeSet attrs)
    {
        super(context, attrs);
    }

    public IconicsFABRevealMenu(Context context, AttributeSet attrs, int defStyleAttr)
    {
        super(context, attrs, defStyleAttr);
    }

    protected void inflateMenu(@MenuRes int menuRes, Menu menu) {
        IconicsMenuInflatorUtil.inflate(new MenuInflater(getContext()), getContext(), menuRes, menu);
    }
}