仿QQ可拖拽控件
博客地址:http://blog.csdn.net/fendoudebb/article/details/76146252
dependencies {
compile 'com.fendoudebb.view:dragbadgeview:1.0.3'
}
<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);