Code example for Canvas

Methods: restoreToCountrotatesavedraw

0
        mState = new RotateState(rotateState, this, res);
    } 
 
    @Override 
    public void draw(Canvas canvas) {
        int saveCount = canvas.save();
        Rect bounds = mState.mDrawable.getBounds();
        int w = bounds.right - bounds.left;
        int h = bounds.bottom - bounds.top;
        final RotateState st = mState;
        float px = st.mPivotXRel ? w * st.mPivotX : st.mPivotX;
        float py = st.mPivotYRel ? h * st.mPivotY : st.mPivotY;
        canvas.rotate(st.mCurrentDegrees, px + bounds.left, py + bounds.top);
        st.mDrawable.draw(canvas);
        canvas.restoreToCount(saveCount);
    } 
 
    @Override 
    public int getChangingConfigurations() { 
        return super.getChangingConfigurations() 
Contextual code suggestions in your IDE  Get Codota for Java