Created
October 20, 2015 06:11
-
-
Save bgogetap/7e1d65c2c4494af0dc51 to your computer and use it in GitHub Desktop.
View.DragShadowBuilder that takes in a Point ((int) event.getX(), (int) event.getY()) so your dragged shadow is positioned correctly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyDragShadowBuilder extends View.DragShadowBuilder { | |
private final Point offset; | |
public MyDragShadowBuilder(View view, Point offset) { | |
super(view); | |
this.offset = offset; | |
} | |
@Override | |
public void onProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint) { | |
shadowSize.set(getView().getWidth(), getView().getHeight()); | |
shadowTouchPoint.set(offset.x, offset.y); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment