国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

第三方開源庫:給View添加數字:ShortcutBadger + BadgeView

2019-11-09 15:16:59
字體:
來源:轉載
供稿:網友

ShortcutBadger

給app的快捷圖標添加數字 github:https://github.com/leolin310148/ShortcutBadger 在聯想手機上未成功!

效果圖

這里寫圖片描述

gradle

repositories { mavenCentral()}dependencies { compile "me.leolin:ShortcutBadger:1.1.13@aar"}

* Add the codes below:*

int badgeCount = 1;ShortcutBadger.applyCount(context, badgeCount); //for 1.1.4+ShortcutBadger.with(getapplicationContext()).count(badgeCount); //for 1.1.3

If you want to remove the badge

ShortcutBadger.removeCount(context); //for 1.1.4+ShortcutBadger.with(getApplicationContext()).remove(); //for 1.1.3orShortcutBadger.applyCount(context, 0); //for 1.1.4+ShortcutBadger.with(getApplicationContext()).count(0); //for 1.1.3

BadgeView

給應用內的圖標添加數字,不包含app的快捷圖標

效果圖

這里寫圖片描述

Gradle

compile 'q.rorbin:badgeview:1.0.0'

代碼

添加數字

new QBadgeView(context).bindTarget(textview).setBadgeNumber(5);

可以是給Bottombar的個tab添加數字

View tab1 = bottomBar.findViewById(R.id.tab1);new QBadgeView(this).bindTarget(tab1).setBadgeNumber(5);

這里寫圖片描述 取消數字:

qBadgeView.bindTarget(tv).hide(true);

方法說明

code 說明
setBadgeNumber 設置數值
setBadgeNumberSize 設置數值大小
setBadgeNumberColor 設置數值顏色
setExactMode 設置是否顯示精確模式數值
setBadgeGravity 設置Badge相對于TargetView的位置
setGravityOffset 設置外邊距
setBadgePadding 設置內邊距
setBadgeBackgroundColor 設置背景色
setShowShadow 設置是否顯示陰影
setOnDragStateChangedListener 打開拖拽消除模式并設置監聽
hide 隱藏Badge

源碼

https://git.oschina.net/libraryDemo/BadgeView02


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 郁南县| 天等县| 互助| 新民市| 茶陵县| 犍为县| 荥阳市| 庐江县| 麻阳| 铁岭县| 延津县| 中西区| 故城县| 土默特右旗| 徐水县| 家居| 门头沟区| 明光市| 固安县| 揭西县| 芦溪县| 天长市| 防城港市| 保定市| 赣榆县| 佛坪县| 临清市| 八宿县| 潜江市| 同仁县| 七台河市| 达州市| 哈密市| 寻甸| 和田市| 彭泽县| 嘉禾县| 马边| 永定县| 资阳市| 广元市|