Java Code Examples for com.mikepenz.actionitembadge.library.utils.BadgeStyle

The following examples show how to use com.mikepenz.actionitembadge.library.utils.BadgeStyle. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: SkyTube   Source File:    License: GNU General Public License v3.0 6 votes vote down vote up
 * Setup the video blocker notification icon which will be displayed in the tool bar.
void setupIconForToolBar(final Menu menu) {
	if (getTotalBlockedVideos() > 0) {
		// display a red bubble containing the number of blocked videos
				ContextCompat.getDrawable(activity, R.drawable.ic_video_blocker),
	} else {
		// Else, set the bubble to transparent.  This is required so that when the user
		// clicks on the icon, the app will be able to detect such click and displays the
		// BlockedVideosDialog (otherwise, the ActionItemBadge would just ignore such clicks.
				ContextCompat.getDrawable(activity, R.drawable.ic_video_blocker),
				new BadgeStyle(BadgeStyle.Style.DEFAULT, com.mikepenz.actionitembadge.library.R.layout.menu_action_item_badge, Color.TRANSPARENT, Color.TRANSPARENT, Color.WHITE),
Example 2
Source Project: fingen   Source File:    License: Apache License 2.0 5 votes vote down vote up
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(, menu);
    MenuItem menuItemInbox = menu.findItem(;
    Drawable icon = ContextCompat.getDrawable(this, R.drawable.ic_sms_white);
    int badgeColor = ContextCompat.getColor(this, R.color.negative_color);
    BadgeStyle badgeStyle = new BadgeStyle(BadgeStyle.Style.DEFAULT, com.mikepenz.actionitembadge.library.R.layout.menu_action_item_badge, badgeColor, badgeColor, -1);
    if (mUnreadSms > 0) {
        ActionItemBadge.update(this, menuItemInbox, icon, badgeStyle, NumberUtils.formatNumber(mUnreadSms));
    } else {
    return true;
Example 3
Source Project: SteamGifts   Source File:    License: MIT License 5 votes vote down vote up
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    MenuItem filterMenu = menu.findItem(;

    ActionItemBadge.update(getActivity(), filterMenu, getResources().getDrawable(R.drawable.ic_filter_variant), (BadgeStyle) null, FilterData.getCurrent(getContext()).isAnyActive() ? "\n\n{faw-check-circle}" : null);