Code example for Matrix

Methods: postTranslate, preRotate, setTranslate

0
        final int length = isHoriz() ? w : h;
        mRightHandleX = length - edgePadding - mDimpleWidth / 2;
        mDimpleSpacing = (length / 2) - mLeftHandleX;
 
        // bg matrix only needs to be calculated once 
        mBgMatrix.setTranslate(0, 0);
        if (!isHoriz()) { 
            // set up matrix for translating drawing of background and arrow assets 
            final int left = w - mBackgroundHeight;
            mBgMatrix.preRotate(-90, 0, 0);
            mBgMatrix.postTranslate(left, h);
 
        } else { 
            mBgMatrix.postTranslate(0, h - mBackgroundHeight);
        } 
    } 
 
    private boolean isHoriz() { 
        return mOrientation == HORIZONTAL;
    }