Android 徽章控件
demo中演示了:
dependencies {
implementation 'com.github.bingoogolapple.BGABadgeView-Android:api:latestVersion'
annotationProcessor 'com.github.bingoogolapple.BGABadgeView-Android:compiler:latestVersion'
}…/**
* 显示圆点徽章
*/
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 |
| 个人主页 | 邮箱 |
|---|---|
| bingoogolapple.cn | [email protected] |
| 个人微信号 | 微信群 | 公众号 |
|---|---|---|
| 个人 QQ 号 | QQ 群 |
|---|---|
如果您觉得 BGA 系列开源库或工具软件帮您节省了大量的开发时间,可以扫描下方的二维码打赏支持。您的支持将鼓励我继续创作,打赏后还可以加我微信免费开通一年 上帝小助手浏览器扩展/插件开发平台 的会员服务
| 微信 | 支付宝 | |
|---|---|---|
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.No open issues yet, or sync has not completed.