示例#1
0
 public void setBageViewCount(long num) {
   badgeView.setVisibility(num == 0 ? View.GONE : View.VISIBLE);
   badgeView.setText(String.valueOf(num));
   if (num > 99) {
     badgeView.setText("99+");
   }
 }
示例#2
0
 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);
 }
示例#3
0
  public void setIndicator(int resId) {

    imageView.setImageResource(resId);
    badgeView.setVisibility(View.GONE);
  }