public void setBageViewCount(long num) { badgeView.setVisibility(num == 0 ? View.GONE : View.VISIBLE); badgeView.setText(String.valueOf(num)); if (num > 99) { badgeView.setText("99+"); } }
public void showBageViewCount(boolean visiable) { badgeView.setText(""); RelativeLayout.LayoutParams params = (android.widget.RelativeLayout.LayoutParams) badgeView.getLayoutParams(); params.height = (int) getContext().getResources().getDimension(R.dimen.main_tab_bageSize); params.width = (int) getContext().getResources().getDimension(R.dimen.main_tab_bageSize); badgeView.setLayoutParams(params); badgeView.setVisibility(visiable ? View.VISIBLE : View.GONE); }
public void setIndicator(int resId) { imageView.setImageResource(resId); badgeView.setVisibility(View.GONE); }