Code example for ViewConfiguration

Methods: getScaledTouchSlop

0
public boolean onTouch(View v, MotionEvent event) 
{ 
    if (config == null)
    { 
        config = ViewConfiguration.get(v.getContext());
        minSwipeDistance = config.getScaledTouchSlop();
    } 
 
 
 
    switch(event.getAction())
    { 
    case MotionEvent.ACTION_DOWN:
        downX = event.getX();
        downY = event.getY();
        return true; 
    case MotionEvent.ACTION_UP:
        upX = event.getX();
        upY = event.getY();
 
        float deltaX = downX - upX;