/DragMsgView

仿QQ 消息数量拖拽控件

Primary LanguageJava

DragMsgView

GIF

仿QQ 消息数量拖拽控件

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
dependencies {
	        implementation 'com.github.telyo:DragMsgView:v1.0.1'
	}

使用

mDragBall = new DragMsgView(this);
  @Override
public void onBindViewHolder(MyHolder holder, int position) {
     TextView tv = holder.itemView.findViewById(R.id.tv);
     tv.setText(date.get(position));
     final TextView dmv = holder.itemView.findViewById(R.id.dmv);
     dmv.setText("99+");
     mDragBall.bingTargetView(dmv, "99+");
  }

mDragBall.setmOnBubbleStateListener(new DragMsgView.OnBubbleStateListener() {
     @Override
     public void onDrag() {
                
     }

     @Override
     public void onMove() {

     }

     @Override
     public void onRestore() {

     }

     @Override
     public void onDismiss() {
                //todo
     }
  });

感谢:

https://blog.csdn.net/qq_31715429/article/details/54386934