Search in sources :

Example 1 with BGABadgeLinearLayout

use of cn.bingoogolapple.badgeview.BGABadgeLinearLayout in project BGABadgeView-Android by bingoogolapple.

the class MessageAdapter method fillData.

@Override
protected void fillData(BGAViewHolderHelper holderHelper, final int position, final MessageModel message) {
    holderHelper.setText(R.id.tv_item_message_title, message.title);
    holderHelper.setText(R.id.tv_item_message_detail, message.detail);
    BGABadgeLinearLayout rootView = (BGABadgeLinearLayout) holderHelper.getConvertView();
    if (message.newMsgCount > 0) {
        rootView.showTextBadge("" + message.newMsgCount);
        rootView.setDragDismissDelegage(new BGADragDismissDelegate() {

            @Override
            public void onDismiss(BGABadgeable badgeable) {
                message.newMsgCount = 0;
                ToastUtil.show(message.title + "的徽章消失");
            }
        });
    } else {
        rootView.hiddenBadge();
    }
}
Also used : BGADragDismissDelegate(cn.bingoogolapple.badgeview.BGADragDismissDelegate) BGABadgeable(cn.bingoogolapple.badgeview.BGABadgeable) BGABadgeLinearLayout(cn.bingoogolapple.badgeview.BGABadgeLinearLayout)

Aggregations

BGABadgeLinearLayout (cn.bingoogolapple.badgeview.BGABadgeLinearLayout)1 BGABadgeable (cn.bingoogolapple.badgeview.BGABadgeable)1 BGADragDismissDelegate (cn.bingoogolapple.badgeview.BGADragDismissDelegate)1