Code example for View

Methods: setTranslationX

0
                vt.getXVelocity();
    } 
 
    private void setTranslation(View v, float translate) {
        if (mSwipeDirection == X) {
            v.setTranslationX(translate);
        } else { 
            v.setTranslationY(translate);
        } 
    } 
 
    private float getSize(View v) {
        return mSwipeDirection == X ? v.getMeasuredWidth() :
                v.getMeasuredHeight();
    } 
 
    public void setMinAlpha(float minAlpha) {
        mMinAlpha = minAlpha;
    }