Android Open Source - android-drag-drop My Drag Shadow Builder






From Project

Back to project page android-drag-drop.

License

The source code is released under:

MIT License

If you think the Android project android-drag-drop listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.mydraggable;
/* ww  w  .  j a v  a 2s  . c  o m*/
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Paint.Style;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.DragShadowBuilder;

public class MyDragShadowBuilder extends DragShadowBuilder {
  Paint mPaint;
  
  public MyDragShadowBuilder(View view){
    super(view);
    // ??????
    mPaint = new Paint();
    // mPaint.setColor(0xFFDD0000); // ?
    // mPaint.setColor(0xFF000000); // ?
    mPaint.setColor(0xFF00FFFF); // ????
    mPaint.setStrokeWidth(5);
    mPaint.setAntiAlias(true);
    mPaint.setStyle(Style.STROKE);
  }

  @Override
  public void onProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint) {
    // TODO Auto-generated method stub
    super.onProvideShadowMetrics(shadowSize, shadowTouchPoint);
  }

  @Override
  public void onDrawShadow(Canvas canvas) {
    // TODO Auto-generated method stub
    super.onDrawShadow(canvas);
    canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), mPaint);
  }

}




Java Source Code List

com.example.mydraggable.MainActivity.java
com.example.mydraggable.MyDragShadowBuilder.java
com.example.mydraggable.MyTextView.java