A simple way to “badge” any given Android view at runtime without having to cater for it in layout.
使用方法:
View target = findViewById(R.id.target_view); BadgeView badge = new BadgeView(this, target); badge.setText("1"); badge.show();