当前位置: 首页>>代码示例>>Java>>正文


Java BadgeView.show方法代码示例

本文整理汇总了Java中com.readystatesoftware.viewbadger.BadgeView.show方法的典型用法代码示例。如果您正苦于以下问题:Java BadgeView.show方法的具体用法?Java BadgeView.show怎么用?Java BadgeView.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.readystatesoftware.viewbadger.BadgeView的用法示例。


在下文中一共展示了BadgeView.show方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setBadgeCount

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
private void setBadgeCount(TopFragmentType type) {
	int count = 0;
	BadgeView view = null;
	if (type == TopFragmentType.MyMessage) {
		count = Cache.self().getUnReadedCount();
		view = mMessageCount;
	} else {
		count = Cache.self().getTimelineCount();
		view = mTimelineCount;
	}

	if (count == 0) {
		view.setVisibility(View.GONE);
	} else {
		view.setVisibility(View.VISIBLE);
		view.setText(String.valueOf(count));
		view.setTextSize(10);
		view.setBadgePosition(BadgeView.POSITION_TOP_LEFT);
		view.show();
	}
}
 
开发者ID:tassadar2002,项目名称:ouser,代码行数:22,代码来源:MenuFragment.java

示例2: showRedPoint

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
public static void showRedPoint(Context context,String type, BadgeView badgeView) {
	//获取当前设备屏幕密度
	DisplayMetrics dm = context.getResources().getDisplayMetrics();
	int displayDpi = dm.densityDpi;

	//根据不同屏幕显示密度设置小红点大小
	if (displayDpi < 320) {
		badgeView.setWidth(9);
		badgeView.setHeight(9);
	}
	else if (displayDpi >= 320 && displayDpi < 480) {
		badgeView.setWidth(19);
		badgeView.setHeight(19);
	}
	else if (displayDpi >= 480) {
		badgeView.setWidth(25);
		badgeView.setHeight(25);
	}

	//badgeView.setText(badgerCount);  //暂不需要计数
	switch (type) {
		case URLs.kSetting:
			badgeView.setBadgeMargin(20, 15);
			break;
		case "tab":
			badgeView.setBadgeMargin(45, 0);
			break;
		case URLs.kSettingPgyer:
		case URLs.kSettingPassword:
		case URLs.kSettingThursdaySay:
			badgeView.setBadgePosition(BadgeView.POSITION_TOP_LEFT);
			break;
		default:
			badgeView.setBadgePosition(BadgeView.POSITION_TOP_RIGHT);
			break;
	}
	badgeView.show();
}
 
开发者ID:jay16,项目名称:shengyiplus-android,代码行数:39,代码来源:RedPointView.java

示例3: create

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
public static BadgeView create(Context context, View view, String textValue) {
    BadgeView badgeView = new BadgeView(context, view);
    badgeView.setTextColor(Color.WHITE);
    badgeView.setText(textValue);
    badgeView.setBackground(context.getResources().getDrawable(R.drawable.dot_bg));
    badgeView.setTextSize(12);
    badgeView.setBadgePosition(BadgeView.POSITION_TOP_RIGHT);
    badgeView.setBadgeMargin(0, 0);
    badgeView.show();
    return badgeView;
}
 
开发者ID:idisfkj,项目名称:HightCopyWX,代码行数:12,代码来源:BadgeViewUtils.java

示例4: onActivityCreated

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mTextViewTitleExample.setText(R.string.criteria_alt_ex2_title);
    mTextViewDescriptionExample.setText(R.string.criteria_alt_ex2_description);
    mTextViewTitleExempleAxsYes.setText(R.string.criteria_accessible_example);
    mTextViewOptionEnabled.setText(getString(R.string.criteria_template_option_tb));

    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    LinearLayout myView = (LinearLayout) inflater.inflate(R.layout.extxt2_frag, null);
    mFrameLayoutExampleAxsYes.addView(myView);

    mTextViewTitleExempleAxsNo.setText(R.string.criteria_not_accessible_example);

    LinearLayout myView2 = (LinearLayout) inflater.inflate(R.layout.extxt2_frag, null);
    mFrameLayoutExampleAxsNo.addView(myView2);

    ImageButton btn = (ImageButton) myView.findViewById(R.id.imageButton10);
    ImageButton btnNo = (ImageButton) myView2.findViewById(R.id.imageButton10);
    BadgeView badge = new BadgeView(getActivity(), btn);
    badge.setText("3");
    badge.show();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        badge.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    }
    btn.setContentDescription(badge.getText() +" "+ getString(R.string.criteria_alt_ex2_cd_btn));

    BadgeView badgeNo = new BadgeView(getActivity(), btnNo);
    badgeNo.setText("3");
    badgeNo.show();
}
 
开发者ID:Orange-OpenSource,项目名称:m-dan,代码行数:33,代码来源:ExTxt2Fragment.java

示例5: potision

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
private void potision() {
    Button button = (Button) findViewById(R.id.position);
    BadgeView badge = new BadgeView(this, button);
    badge.setText("10");
    badge.setBadgePosition(BadgeView.POSITION_TOP_LEFT);
    badge.show();
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:8,代码来源:AndroidViewbadgerSampleActivity.java

示例6: size

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
private void size() {
    Button button = (Button) findViewById(R.id.size);
    BadgeView badge = new BadgeView(this, button);
    badge.setText("update");
    badge.setTextSize(20);
    badge.show();
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:8,代码来源:AndroidViewbadgerSampleActivity.java

示例7: color

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
private void color() {
    Button button = (Button) findViewById(R.id.color);
    BadgeView badge = new BadgeView(this, button);
    badge.setText("12");
    badge.setTextColor(Color.WHITE);
    badge.setBackgroundColor(Color.BLUE);
    badge.show();
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:9,代码来源:AndroidViewbadgerSampleActivity.java

示例8: incremental

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
private void incremental() {
    Button button = (Button) findViewById(R.id.incremental);
    final BadgeView badge = new BadgeView(this, button);
    badge.setText("0");
    badge.show();
    button.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            badge.increment(1);
        }
    });
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:13,代码来源:AndroidViewbadgerSampleActivity.java

示例9: setBadge

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
@Override
public void setBadge(BadgeView badge, int count) {
    if (count == 0) {
        badge.hide();
    } else {
        if (!badge.isShown()) {
            badge.show();
        }
    }
    badge.setText(String.valueOf(count));
}
 
开发者ID:cuipengpeng,项目名称:p1-android,代码行数:12,代码来源:BadgeHelper.java

示例10: defaultStyle

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
private void defaultStyle() {
    Button button = (Button) findViewById(R.id.button);
    BadgeView badge = new BadgeView(this, button);
    badge.setText("6");
    badge.show();
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:7,代码来源:AndroidViewbadgerSampleActivity.java

示例11: incrementBadge

import com.readystatesoftware.viewbadger.BadgeView; //导入方法依赖的package包/类
public void incrementBadge(BadgeView badge) {
    badge.increment(1);
    if (!badge.isShown()) {
        badge.show();
    }
}
 
开发者ID:cuipengpeng,项目名称:p1-android,代码行数:7,代码来源:BadgeHelper.java


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