BGABadgeViewAndroid 徽章控件
BGABadgeView 是 Android 自定義徽章控件。
效果圖:
依賴:
dependencies {
compile 'com.nineoldandroids:library:2.4.0'
compile 'cn.bingoogolapple:bga-badgeview:latestVersion@aar'
}
目前支持的徽章類:
| 類名 | 應(yīng)用場(chǎng)景 |
|---|---|
| BGABadgeRadioButton | 微博首頁(yè)底部導(dǎo)航 |
| BGABadgeImageView | 微博列表用戶頭像 |
| BGABadgeTextView | 其實(shí)這個(gè)可以用BGABadgeCheckedTextView代替 |
| BGABadgeLinearLayout | 列表item右側(cè)消息條數(shù) |
| BGABadgeRelativeLayout | 列表item右側(cè)消息條數(shù) |
| BGABadgeFrameLayout | 列表item右側(cè)消息條數(shù) |
接口說(shuō)明:
/** * 顯示圓點(diǎn)徽章 */ void showCirclePointBadge(); /** * 顯示文字徽章 * * @param badgeText */ void showTextBadge(String badgeText); /** * 隱藏徽章 */ void hiddenBadge(); /** * 顯示圖像徽章 * * @param bitmap */ void showDrawableBadge(Bitmap bitmap); /** * 設(shè)置拖動(dòng)刪除徽章的代理 * * @param delegate */ void setDragDismissDelegage(BGADragDismissDelegate delegate); /** * 是否顯示徽章 * * @return */ boolean isShowBadge();
評(píng)論
圖片
表情
