Android 仿 QQ 消息提示可拖拽控件 DragBadgeView
Android 大约 1222 字DragBadgeView
仿QQ
可拖拽控件
GitHub
地址:https://github.com/fendoudebb/DragBadgeView
样例演示
引入
添加依赖
dependencies {
compile 'com.fendoudebb.view:dragbadgeview:1.0.3'
}
xml 配置
<com.fendoudebb.view.DragBadgeView
android:id="@+id/drag_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="2dp"
app:dragEnable="false"
app:maxShowValue="99"
app:text="0"
app:textSize="18sp"/>
回调
mDragBadgeView.setOnDragBadgeViewListener(new DragBadgeView.OnDragBadgeViewListener() {
@Override
public void onDisappear(String text) {
Toast.makeText(getApplicationContext(), text + "条信息隐藏!", Toast.LENGTH_SHORT).show();
}
});
设置文字
xml
app:text="测试"
Java
mDragBadgeView.setText("测试");
获取文字
public String getStringText();
public int getIntText();
设置字体大小
xml
app:textSize="12sp"
Java
mDragBadgeView.setTextSize(dp2sp(15));
设置控件颜色
xml
app:bgColor="#f0f"
Java
mDragBadgeView.setBgColor(Color.BLUE);
设置能否拖拽
xml
app:dragEnable="false"
Java
mDragBadgeView.setDragEnable(true);
阅读 2403 · 发布于 2019-04-11
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Docker 部署 Flink阅读 160
-
Nginx 配置之解决 413 错误(Request Entity Too Large)阅读 5121
-
Linux 使用 vmstat 查看虚拟内存状态阅读 5185
-
Redis 过期时间问题阅读 1884
-
Linux 常用命令之进程相关命令阅读 1581
-
Oracle 数据库连接异常 ORA-28001: the password has expired阅读 3054
-
MySQL 使用的是 BTree 还是 B+Tree阅读 2291
-
Linux tac 倒序查看文本内容阅读 2618
-
软考-系统架构设计师:并发控制阅读 971
-
Spring Boot 获取所有 SpringMVC Controller 路径阅读 467