All Projects → bingoogolapple → Bgabadgeview Android

bingoogolapple / Bgabadgeview Android

Android 徽章控件

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bgabadgeview Android

Badgeview
支持自由定制外观、拖拽消除的MaterialDesign风格Android BadgeView
Stars: ✭ 3,966 (+54.86%)
Mutual labels:  badge, badgeview
Badges
Swift version of AXBadgeView. Show badge on any view with autolayout and animations.
Stars: ✭ 67 (-97.38%)
Mutual labels:  badge, badgeview
Github Badges
Star / Fork badges for your GitHub Repository!
Stars: ✭ 76 (-97.03%)
Mutual labels:  badge
Badges
🎴 Standard and acceptable badges list
Stars: ✭ 165 (-93.56%)
Mutual labels:  badge
Drawablebadge
Drawable Badge is an Android library for adding badges to drawables.
Stars: ✭ 128 (-95%)
Mutual labels:  badge
Uitabbaritem Custombadge
UITabBarItem+CustomBadge is a workaround to change the aspect of IOS UIBadgeView
Stars: ✭ 84 (-96.72%)
Mutual labels:  badge
Console Badge
🎨 Create simple badges in the browser console
Stars: ✭ 130 (-94.92%)
Mutual labels:  badge
Hitcon Badge 2019
HITCON electric badge for HITCON CMT 2019.
Stars: ✭ 71 (-97.23%)
Mutual labels:  badge
Shields
Concise, consistent, and legible badges in SVG and raster format
Stars: ✭ 15,716 (+513.67%)
Mutual labels:  badge
Badger
Badge for R Package
Stars: ✭ 114 (-95.55%)
Mutual labels:  badge
Google Play Badge Svg
Hosting for localized versions of Google Play badges in SVG format.
Stars: ✭ 137 (-94.65%)
Mutual labels:  badge
Tdbadgedcell
TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps
Stars: ✭ 1,444 (-43.62%)
Mutual labels:  badge
Materialbadgetextview
As the name describes, this is an Android library that you can use to show new messages badge and new features badge.
Stars: ✭ 1,331 (-48.03%)
Mutual labels:  badge
Github Actions Badge
🛡 Shields.io Badge for your GitHub Actions
Stars: ✭ 131 (-94.88%)
Mutual labels:  badge
Badgeforappicon
The unread badges of the android launcher icon.
Stars: ✭ 83 (-96.76%)
Mutual labels:  badge
Fastlane Plugin Badge
The fastlane plugin for badge
Stars: ✭ 174 (-93.21%)
Mutual labels:  badge
Awesome Github Badges
A curated list of awesome github README.md badges
Stars: ✭ 70 (-97.27%)
Mutual labels:  badge
Qualinsight Plugins Sonarqube Badges
Plugin for SonarQube that generates badges displaying information about a project's or view's quality.
Stars: ✭ 108 (-95.78%)
Mutual labels:  badge
Php badge
This is an identification tag based on SVG, It can quickly generate various labels and status identifiers
Stars: ✭ 101 (-96.06%)
Mutual labels:  badge
Contrast Swatch
🅰️ Image microservice for color contrast information
Stars: ✭ 210 (-91.8%)
Mutual labels:  badge

💗BGABadgeView-Android💗

Android Arsenal License Download

English Document

react-native-bga-badge-view

demo中演示了:

  • 微博底部tab显示最新微博条数
  • 微博列表用户头像显示显示右下角vip徽章
  • 微信消息界面用户新消息
  • 微信消息界面订阅号新消息
  • 使用v4包中的RoundedBitmapDrawable制作圆角头像
  • 拖拽删除徽章

爆炸效果参考的 ExplosionField 改成了只有一个View的情况,只刷新徽章附近的区域

效果图

badgeview

点击下载 Apk 或扫描下方二维码安装体验

Demo

添加 Gradle 依赖

  • maven { url 'https://jitpack.io' } 加入到 repositories 中
  • 添加如下依赖,末尾的「latestVersion」指的是徽章Download里的版本名称,请自行替换。
dependencies {
    implementation 'com.github.bingoogolapple.BGABadgeView-Android:api:latestVersion'
    annotationProcessor 'com.github.bingoogolapple.BGABadgeView-Android:compiler:latestVersion'
}

初始化徽章控件

  1. 在项目任意一个类上面添加 BGABadge 注解,例如新建一个类 BGABadgeInit 专门用于初始化徽章控件
  2. 需要哪些类具有徽章功能,就把那些类的 Class 作为 BGABadge 注解的参数「下面的代码块给出了例子,不需要的可以删掉对应的行」
@BGABadge({
        View.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeView,不想用这个类的话就删了这一行
        ImageView.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeImageView,不想用这个类的话就删了这一行
        TextView.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeFloatingTextView,不想用这个类的话就删了这一行
        RadioButton.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeRadioButton,不想用这个类的话就删了这一行
        LinearLayout.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeLinearLayout,不想用这个类的话就删了这一行
        FrameLayout.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeFrameLayout,不想用这个类的话就删了这一行
        RelativeLayout.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeRelativeLayout,不想用这个类的话就删了这一行
        FloatingActionButton.class, // 对应 cn.bingoogolapple.badgeview.BGABadgeFloatingActionButton,不想用这个类的话就删了这一行
        ...
        ...
        ...
})
public class BGABadgeInit {
}
  1. 再 AS 中执行 Build => Rebuild Project
  2. 经过前面三个步骤后就可以通过「cn.bingoogolapple.badgeview.BGABadge原始类名」来使用徽章控件了

接口说明

/**
 * 显示圆点徽章
 */
void showCirclePointBadge();

/**
 * 显示文字徽章
 *
 * @param badgeText
 */
void showTextBadge(String badgeText);

/**
 * 隐藏徽章
 */
void hiddenBadge();

/**
 * 显示图像徽章
 *
 * @param bitmap
 */
void showDrawableBadge(Bitmap bitmap);

/**
 * 设置拖动删除徽章的代理
 *
 * @param delegate
 */
void setDragDismissDelegage(BGADragDismissDelegate delegate);

/**
 * 是否显示徽章
 *
 * @return
 */
boolean isShowBadge();

/**
 * 是否可拖动
 *
 * @return
 */
boolean isDraggable();

/**
 * 是否正在拖动
 *
 * @return
 */
boolean isDragging();

自定义属性说明

属性名 说明 默认值
badge_bgColor 徽章背景色 Color.RED
badge_textColor 徽章文本的颜色 Color.WHITE
badge_textSize 徽章文本字体大小 10sp
badge_verticalMargin 徽章背景与宿主控件上下边缘间距离 4dp
badge_horizontalMargin 徽章背景与宿主控件左右边缘间距离 4dp
badge_padding 徽章文本边缘与徽章背景边缘间的距离 4dp
badge_gravity 徽章在宿主控件中的位置 BGABadgeImageView和BGABadgeRadioButton是右上方,其他控件是右边垂直居中
badge_draggable 是否开启拖拽删除徽章 false
badge_isResumeTravel 拖拽徽章超出轨迹范围后,再次放回到轨迹范围时,是否恢复轨迹 false
badge_borderWidth 徽章描边宽度 0dp
badge_borderColor 徽章描边颜色 Color.WHITE
badge_dragExtra 触发开始拖拽徽章事件的扩展触摸距离 4dp

关于我

个人主页 邮箱 BGA 系列开源库 QQ 群 GitHub 喵(专注于 GitHub 等一切与程序员有关的内容)
bingoogolapple.cn [email protected] BGA_CODE_CLUB GitHub喵

打赏支持

如果您觉得 BGA 系列开源库帮你节省了大量的开发时间,请扫描下方的二维码随意打赏,要是能打赏个 10.24 🐵就太👍了。您的支持将鼓励我继续创作:octocat:

如果您目前正打算购买通往墙外的梯子,可以使用我的邀请码「YFQ9Q3B」购买 Lantern,双方都赠送三个月的专业版使用时间🍻

License

Copyright 2015 bingoogolapple

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].