Created
July 2, 2014 13:41
-
-
Save ShawInnes/7d6c369772e73b4cd0ab to your computer and use it in GitHub Desktop.
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
class NullShadowBuilder : View.DragShadowBuilder | |
{ | |
const int centerOffset = 52; | |
int width, height; | |
public NullShadowBuilder (View baseView) : base (baseView) | |
{ | |
} | |
public override void OnProvideShadowMetrics (Point shadowSize, Point shadowTouchPoint) | |
{ | |
width = 75; | |
height = 75; | |
// This is the overall dimension of your drag shadow | |
shadowSize.Set (width * 2, height * 2); | |
// This one tells the system how to translate your shadow on the screen so | |
// that the user fingertip is situated on that point of your canvas. | |
// In my case, the touch point is in the middle of the (height, width) top-right rect | |
shadowTouchPoint.Set (width + width / 2 - centerOffset, height / 2 + centerOffset); | |
} | |
public override void OnDrawShadow (Canvas canvas) | |
{ | |
base.OnDrawShadow (canvas); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment