Search in sources :

Example 1 with SupportMenuInflater

use of android.support.v7.view.SupportMenuInflater in project MaterialDrawer by mikepenz.

the class DrawerBuilder method inflateMenu.

/**
     * Inflates the DrawerItems from a menu.xml
     *
     * @param menuRes
     * @return
     */
public DrawerBuilder inflateMenu(@MenuRes int menuRes) {
    MenuInflater menuInflater = new SupportMenuInflater(mActivity);
    MenuBuilder mMenu = new MenuBuilder(mActivity);
    menuInflater.inflate(menuRes, mMenu);
    addMenuItems(mMenu, false);
    return this;
}
Also used : SupportMenuInflater(android.support.v7.view.SupportMenuInflater) MenuInflater(android.view.MenuInflater) SupportMenuInflater(android.support.v7.view.SupportMenuInflater) MenuBuilder(android.support.v7.view.menu.MenuBuilder)

Example 2 with SupportMenuInflater

use of android.support.v7.view.SupportMenuInflater in project material-icon-lib by code-mc.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mListview = (GridView) findViewById(R.id.listview);
    List<MaterialDrawableBuilder.IconValue> vals = Arrays.asList(MaterialDrawableBuilder.IconValue.values());
    ImageAdapter adapt = new ImageAdapter(vals);
    mListview.setAdapter(adapt);
    final Toolbar toolbar1 = (Toolbar) findViewById(R.id.toolbar_1);
    MaterialMenuInflater.with(toolbar1.getContext(), new SupportMenuInflater(toolbar1.getContext())).inflate(R.menu.menu_nocolor, toolbar1.getMenu());
    // Activity Theme materialIconColor attribute (lowest priority default color)
    // View specific Theme e.g. app:theme="..."   (2nd lowest in priority)
    // setDefaultColor(Resource) methods (highest priority default color)
    // app:materialIconColor set on an <item> tag in the menu XML file (overrides any other color choice)
    MaterialMenuInflater.with(this).setDefaultColor(Color.BLUE).inflate(R.menu.menu_nocolor, toolbar1.getMenu());
/*
        setContentView(R.layout.circletest);
        ((CircleImageView)findViewById(R.id.profile_image)).setImageDrawable(
                MaterialDrawableBuilder.with(this)
                        .setSizeDp(96)
                        .setIcon(MaterialDrawableBuilder.IconValue.FACEBOOK_BOX)
                        .setColor(Color.BLUE)
                        .build()
        );
        */
/*mIcon = (MaterialIconView) findViewById(R.id.icon);
        ImageView imgicon = (ImageView) findViewById(R.id.image_icon);

        mIcon.setIcon(MaterialDrawableBuilder.IconValue.CONTENT_COPY);
        imgicon.setImageDrawable(
                MaterialDrawableBuilder.with(this)
                        .setColor(Color.WHITE)
                        .setToActionbarSize()
                        .setIcon(MaterialDrawableBuilder.IconValue.AMAZON_CLOUDDRIVE)
                        .build()
        );
        */
}
Also used : SupportMenuInflater(android.support.v7.view.SupportMenuInflater) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with SupportMenuInflater

use of android.support.v7.view.SupportMenuInflater in project bottomsheet by Flipboard.

the class MenuSheetView method inflateMenu.

/**
 * Inflates a menu resource into the menu backing this sheet.
 *
 * @param menuRes Menu resource ID
 */
public void inflateMenu(@MenuRes int menuRes) {
    if (menuRes != -1) {
        SupportMenuInflater inflater = new SupportMenuInflater(getContext());
        inflater.inflate(menuRes, menu);
    }
    prepareMenuItems();
}
Also used : SupportMenuInflater(android.support.v7.view.SupportMenuInflater)

Aggregations

SupportMenuInflater (android.support.v7.view.SupportMenuInflater)3 MenuBuilder (android.support.v7.view.menu.MenuBuilder)1 Toolbar (android.support.v7.widget.Toolbar)1 MenuInflater (android.view.MenuInflater)1