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;
}
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()
);
*/
}
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();
}
Aggregations