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

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

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

2019-11-09 14:14:43
字體:
來源:轉載
供稿:網友

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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 绥阳县| 富民县| 察雅县| 屯昌县| 沾化县| 上蔡县| 侯马市| 台北市| 漳州市| 禄劝| 庄河市| 慈溪市| 肥西县| 侯马市| 永善县| 汉寿县| 新丰县| 和林格尔县| 邛崃市| 四会市| 洛扎县| 濉溪县| 大厂| 徐汇区| 伊宁市| 五原县| 华容县| 星座| 怀远县| 黑河市| 奉节县| 雅江县| 赣州市| 呼伦贝尔市| 湟源县| 外汇| 苍南县| 江川县| 资兴市| 巩义市| 夏邑县|