• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ActionItemBadge类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.mikepenz.actionitembadge.library.ActionItemBadge的典型用法代码示例。如果您正苦于以下问题:Java ActionItemBadge类的具体用法?Java ActionItemBadge怎么用?Java ActionItemBadge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActionItemBadge类属于com.mikepenz.actionitembadge.library包,在下文中一共展示了ActionItemBadge类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_ignore_setting, menu);
    SubMenu subMenu = menu.addSubMenu(GROUP_ID, BASE_ID, 0, "排序");
    subMenu.setIcon(R.drawable.ic_sort_white_24dp);
    subMenu.add(GROUP_ID + 1, BASE_ID + 1, 0, "应用名");
    subMenu.add(GROUP_ID + 1, BASE_ID + 2, 1, "选中");
    subMenu.add(GROUP_ID + 2, BASE_ID + 3, 2, "降序")
           .setCheckable(true)
           .setChecked(true);
    subMenu.setGroupCheckable(GROUP_ID + 1, true, true);
    mMenuItem = menu.findItem(R.id.allcheck);
    ActionItemBadge.update(this, mMenuItem, FontAwesome.Icon.faw_check,
            ActionItemBadge.BadgeStyles.DARK_GREY, 0);
    return true;
}
 
开发者ID:towavephone,项目名称:MemoryCleaner,代码行数:17,代码来源:IgnoreSetting.java


示例2: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_memory_clean, menu);
    SubMenu subMenu = menu.addSubMenu(GROUP_ID, BASE_ID, 0, "排序");
    subMenu.setIcon(R.drawable.ic_sort_white_24dp);
    subMenu.add(GROUP_ID + 1, BASE_ID + 1, 0, "应用名");
    subMenu.add(GROUP_ID + 1, BASE_ID + 2, 1, "大小");
    subMenu.add(GROUP_ID + 1, BASE_ID + 3, 2, "选中");
    subMenu.add(GROUP_ID + 2, BASE_ID + 4, 3, "降序")
           .setCheckable(true)
           .setChecked(true);
    subMenu.setGroupCheckable(GROUP_ID + 1, true, true);
    mMenuItem = menu.findItem(R.id.allcheck);
    ActionItemBadge.update(this, mMenuItem, FontAwesome.Icon.faw_check,
            ActionItemBadge.BadgeStyles.DARK_GREY, 0);
    return true;
}
 
开发者ID:towavephone,项目名称:MemoryCleaner,代码行数:18,代码来源:MemoryClean.java


示例3: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);

    if (badgeCount == 0) {
        ActionItemBadge.hide(menu.findItem(R.id.item_samplebadge));
    } else {
        ActionItemBadge.update(this, menu.findItem(R.id.item_samplebadge), FontAwesome.Icon.faw_android, style, badgeCount);
    }
    if (badgeDrawableCount == 0) {
        ActionItemBadge.hide(menu.findItem(R.id.item_sampleBadge_drawable));
    } else {
        ActionItemBadge.update(this, menu.findItem(R.id.item_sampleBadge_drawable), UIUtil.getCompatDrawable(this, R.drawable.ic_notification), style, NumberUtils.formatNumber(badgeDrawableCount));
    }

    new ActionItemBadgeAdder().act(this).menu(menu).title(R.string.sample_2).itemDetails(0, SAMPLE2_ID, 1).showAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS).add(bigStyle, 1);
    return true;
}
 
开发者ID:sathishmscict,项目名称:AndroidActionItemBadge,代码行数:20,代码来源:ToolbarActivity.java


示例4: onOptionsItemSelected

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.item_samplebadge) {
        Toast.makeText(this, R.string.sample_3, Toast.LENGTH_SHORT).show();
        badgeCount--;
        ActionItemBadge.update(item, badgeCount);
    } else if (id == R.id.item_sampleBadge_drawable) {
        Toast.makeText(this, R.string.sample_3, Toast.LENGTH_SHORT).show();
        badgeDrawableCount = badgeDrawableCount - 1000;
        ActionItemBadge.update(item, NumberUtils.formatNumber(badgeDrawableCount));
        return true;
    } else if (id == SAMPLE2_ID) {
        Toast.makeText(this, R.string.sample_4, Toast.LENGTH_SHORT).show();
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:sathishmscict,项目名称:AndroidActionItemBadge,代码行数:18,代码来源:ToolbarActivity.java


示例5: setMessagesNum

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
public void setMessagesNum(int num) {
    if (num > 0) {
        ActionItemBadge.update(mMessagesButton, ResourcesCompat.getDrawable(getResources(), R.drawable.forum, null), num);
    } else {
        ActionItemBadge.update(mMessagesButton, ResourcesCompat.getDrawable(getResources(), R.drawable.forum, null), Integer.MIN_VALUE);
    }

}
 
开发者ID:sfilmak,项目名称:MakiLite,代码行数:9,代码来源:MainActivity.java


示例6: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    //重载菜单图标
    ActionItemBadge.update(this, menu.findItem(R.id.action_publish), FontAwesome.Icon.faw_plus, Color.GRAY, ActionItemBadge.BadgeStyles.GREY, Integer.MIN_VALUE);
    ActionItemBadge.update(this, menu.findItem(R.id.action_chat), FontAwesome.Icon.faw_comment_o, Color.GRAY, ActionItemBadge.BadgeStyles.GREY, Integer.MIN_VALUE);
    return true;
}
 
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:10,代码来源:AbstractMainActivity.java


示例7: onOptionsItemSelected

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.action_publish:
            startActivityForResult(PublishActivity.newIntent(), PublishActivity.REQUEST_PUBLISH);
            break;
        case R.id.action_chat:
            ActionItemBadge.update(this, item, FontAwesome.Icon.faw_comment_o,Color.GRAY, ActionItemBadge.BadgeStyles.GREY,  Integer.MIN_VALUE);
            PrefService.getInstance(getApplicationContext()).cleanUnread();
            startActivity(ChatListActivity.newIntent());
            break;
    }
    return true;
}
 
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:16,代码来源:AbstractMainActivity.java


示例8: onNewMsg

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
/**
 * 新消息提示
 */
@Override
public void onNewMsg() {
    int count=PrefService.getInstance(getApplicationContext()).getUnread();
    Log.d("MainActivity", "Recieve msg:" + count);
    ActionItemBadge.update(this, toolbar.getMenu().findItem(R.id.action_chat), FontAwesome.Icon.faw_comment_o,Color.GRAY, ActionItemBadge.BadgeStyles.RED, PrefService.getInstance(getApplicationContext()).getUnread());
}
 
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:10,代码来源:AbstractMainActivity.java


示例9: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);

    if (badgeCount > 0) {
        ActionItemBadge.update(this, menu.findItem(R.id.item_samplebadge), FontAwesome.Icon.faw_android, ActionItemBadge.BadgeStyles.GREY, badgeCount);
    } else {
        ActionItemBadge.hide(menu.findItem(R.id.item_samplebadge));
    }

    new ActionItemBadgeAdder().act(this).menu(menu).title(R.string.sample_2).itemDetails(0, SAMPLE2_ID, 1).showAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS).add(ActionItemBadge.BadgeStyles.GREY_LARGE, 1);
    return true;
}
 
开发者ID:sathishmscict,项目名称:AndroidActionItemBadge,代码行数:15,代码来源:MainActivity.java


示例10: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    MenuItem filterMenu = menu.findItem(R.id.filter);
    filterMenu.setVisible(true);

    ActionItemBadge.update(getActivity(), filterMenu, getResources().getDrawable(R.drawable.ic_filter_variant), (BadgeStyle) null, FilterData.getCurrent(getContext()).isAnyActive() ? "\n\n{faw-check-circle}" : null);
}
 
开发者ID:SteamGifts,项目名称:SteamGifts,代码行数:11,代码来源:GiveawayListFragment.java


示例11: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    mNotificationButton = menu.findItem(R.id.action_notifications);

    ActionItemBadge.update(this, mNotificationButton, ResourcesCompat.getDrawable(getResources(), R.drawable.ic_menu_notifications, null), ActionItemBadge.BadgeStyles.RED, Integer.MIN_VALUE);
    return true;
}
 
开发者ID:JakeLane,项目名称:Toffeed,代码行数:10,代码来源:MainActivity.java


示例12: setNotificationNum

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
public void setNotificationNum(int num) {
    if (num > 0) {
        ActionItemBadge.update(mNotificationButton, ResourcesCompat.getDrawable(getResources(), R.drawable.ic_menu_notifications_active, null), num);
    } else {
        // Hide the badge and show the washed-out button
        ActionItemBadge.update(mNotificationButton, ResourcesCompat.getDrawable(getResources(), R.drawable.ic_menu_notifications, null), Integer.MIN_VALUE);
    }
}
 
开发者ID:JakeLane,项目名称:Toffeed,代码行数:9,代码来源:MainActivity.java


示例13: setMessagesNum

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
public void setMessagesNum(int num) {
    // Only update message count if enabled
    if (mPreferences.getBoolean(SettingsActivity.KEY_PREF_MESSAGING, false)) {
        if (num > 0) {
            ActionItemBadge.update(mNavigationView.getMenu().findItem(R.id.nav_messages), num);
        } else {
            // Hide the badge and show the washed-out button
            ActionItemBadge.update(mNavigationView.getMenu().findItem(R.id.nav_messages), Integer.MIN_VALUE);
        }
    }
}
 
开发者ID:JakeLane,项目名称:Toffeed,代码行数:12,代码来源:MainActivity.java


示例14: setRequestsNum

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
public void setRequestsNum(int num) {
    if (num > 0) {
        ActionItemBadge.update(mNavigationView.getMenu().findItem(R.id.nav_friendreq), num);
    } else {
        // Hide the badge and show the washed-out button
        ActionItemBadge.update(mNavigationView.getMenu().findItem(R.id.nav_friendreq), Integer.MIN_VALUE);
    }
}
 
开发者ID:JakeLane,项目名称:Toffeed,代码行数:9,代码来源:MainActivity.java


示例15: updateBadge

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override public void updateBadge(int count) {
    ActionItemBadge.update(mMenuItem, count);
}
 
开发者ID:towavephone,项目名称:MemoryCleaner,代码行数:4,代码来源:IgnoreSetting.java


示例16: onCreateOptionsMenu

import com.mikepenz.actionitembadge.library.ActionItemBadge; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_detail_room, menu);
    new ActionItemBadgeAdder().act(this).menu(menu).title(R.string.notification).itemDetails(0, R.id.user_mentions, 1).showAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS).add(ActionItemBadge.BadgeStyles.RED_LARGE, numMentions);
    return super.onCreateOptionsMenu(menu);
}
 
开发者ID:rebus007,项目名称:Git-Chat,代码行数:7,代码来源:DetailRoomActivity.java



注:本文中的com.mikepenz.actionitembadge.library.ActionItemBadge类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Toggleable类代码示例发布时间:2022-05-23
下一篇:
Java Column类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap