private static void setBadgeForTab(BadgeItem badgeItem, BottomNavigationTab bottomNavigationTab) {
        if (badgeItem != null) {

            Context context = bottomNavigationTab.getContext();

            GradientDrawable shape = getBadgeDrawable(badgeItem, context);
            bottomNavigationTab.badgeView.setBackgroundDrawable(shape);

            bottomNavigationTab.setBadgeItem(badgeItem);
            badgeItem.setTextView(bottomNavigationTab.badgeView);
            bottomNavigationTab.badgeView.setVisibility(View.VISIBLE);

            bottomNavigationTab.badgeView.setTextColor(badgeItem.getTextColor(context));
            bottomNavigationTab.badgeView.setText(badgeItem.getText());


            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) bottomNavigationTab.badgeView.getLayoutParams();
            layoutParams.gravity = badgeItem.getGravity();
            bottomNavigationTab.badgeView.setLayoutParams(layoutParams);

            if(badgeItem.isHidden()){
                // if hide is called before the initialisation of bottom-bar this will handle that
                // by hiding it.
                badgeItem.hide();
            }
        }
    }
Used to set badge for given tab

@param badgeItem           holds badge data
@param bottomNavigationTab bottom navigation tab to which badge needs to be attached
common/src/main/java/com/sxjs/common/widget/bottomnavigation/BottomNavigationHelper.java