mercredi 23 avril 2014

Set dragshadow larger than view


Vote count:

0




I have a gridview with some images in it. These image are dragable, and when one of these images is dragged, a dragshadow appears. The dragshadow is currently the same size as the image in the gridview, however I want to make it 1.5 times larger. I have successfully made the dragshadow smaller using onProvideShadowMetrics, but I cannot make it larger..


The code currently looks like this:



public class ImageDragShadow extends View.DragShadowBuilder {

public ImageDragShadow(View v) {
super(v);

}
@Override
public void onDrawShadow(Cansas canvas) {

super.onDrawShadow(canvas);
}

@Override
public void onProvideShadowMetrics(Point shadowSize, Point touchPoint) {
shadowSize.set(50,50);
}


}


This example makes the dragshadow smaller (50px x 50px), but it seems that making the size larger than the view have no effect - the dragshadow simply becomes the same size as the view.



asked 2 mins ago






Aucun commentaire:

Enregistrer un commentaire