Android仿QQ消息提示可拖拽控件DragBadgeView
AndroidDragBadgeView大约 1184 字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();
}
});
设置文字
app:text="测试"
mDragBadgeView.setText("测试");
获取文字
public String getStringText();
public int getIntText();
设置字体大小
app:textSize="12sp"
mDragBadgeView.setTextSize(dp2sp(15));
设置控件颜色
app:bgColor="#f0f"
mDragBadgeView.setBgColor(Color.BLUE);
设置能否拖拽
app:dragEnable="false"
mDragBadgeView.setDragEnable(true);
阅读 809 · 发布于 2019-04-11
————        END        ————
扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看换一批
- Linux uniq命令简单使用阅读 1383
- SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction阅读 717
- MySQL设置与更改用户密码阅读 374
- Android添加音效阅读 517
- Golang中的指数符号e阅读 146
- Linux grep/zgrep提示Binary file matches阅读 1049
- Spring Boot中去除spring-data-mongodb自动生成的_class字段阅读 735
- Android仿iOS删除时抖动效果阅读 1251
- Redis批量删除key阅读 1222
- Golang时间加减、计算方法耗、毫秒转Time阅读 406