代码拉取完成,页面将自动刷新
demo中演示了:
dependencies {
implementation 'com.github.bingoogolapple.BGABadgeView-Android:api:latestVersion'
annotationProcessor 'com.github.bingoogolapple.BGABadgeView-Android:compiler:latestVersion'
}
@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 {
}
/**
* 显示圆点徽章
*/
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 | bingoogolapple@gmail.com |
如果您觉得 BGA 系列开源库帮你节省了大量的开发时间,请扫描下方的二维码随意打赏,要是能打赏个 10.24 :monkey_face:就太:thumbsup:了。您的支持将鼓励我继续创作:octocat:
如果您目前正打算购买通往墙外的梯子,可以使用我的邀请码「YFQ9Q3B」购买 Lantern,双方都赠送三个月的专业版使用时间
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。