Search in sources :

Example 6 with CanvasTransformer

use of com.slidingmenu.lib.SlidingMenu.CanvasTransformer in project weiciyuan by qii.

the class CanvasTransformerBuilder method concatTransformer.

public CanvasTransformer concatTransformer(final CanvasTransformer t) {
    initTransformer();
    mTrans = new CanvasTransformer() {

        public void transformCanvas(Canvas canvas, float percentOpen) {
            mTrans.transformCanvas(canvas, percentOpen);
            t.transformCanvas(canvas, percentOpen);
        }
    };
    return mTrans;
}
Also used : Canvas(android.graphics.Canvas) CanvasTransformer(com.slidingmenu.lib.SlidingMenu.CanvasTransformer)

Example 7 with CanvasTransformer

use of com.slidingmenu.lib.SlidingMenu.CanvasTransformer in project weiciyuan by qii.

the class CanvasTransformerBuilder method rotate.

public CanvasTransformer rotate(final int openedDeg, final int closedDeg, final int px, final int py, final Interpolator interp) {
    initTransformer();
    mTrans = new CanvasTransformer() {

        public void transformCanvas(Canvas canvas, float percentOpen) {
            mTrans.transformCanvas(canvas, percentOpen);
            float f = interp.getInterpolation(percentOpen);
            canvas.rotate((openedDeg - closedDeg) * f + closedDeg, px, py);
        }
    };
    return mTrans;
}
Also used : Canvas(android.graphics.Canvas) CanvasTransformer(com.slidingmenu.lib.SlidingMenu.CanvasTransformer)

Example 8 with CanvasTransformer

use of com.slidingmenu.lib.SlidingMenu.CanvasTransformer in project little-bear-dictionary by daimajia.

the class CanvasTransformerBuilder method rotate.

public CanvasTransformer rotate(final int openedDeg, final int closedDeg, final int px, final int py, final Interpolator interp) {
    initTransformer();
    mTrans = new CanvasTransformer() {

        public void transformCanvas(Canvas canvas, float percentOpen) {
            mTrans.transformCanvas(canvas, percentOpen);
            float f = interp.getInterpolation(percentOpen);
            canvas.rotate((openedDeg - closedDeg) * f + closedDeg, px, py);
        }
    };
    return mTrans;
}
Also used : Canvas(android.graphics.Canvas) CanvasTransformer(com.slidingmenu.lib.SlidingMenu.CanvasTransformer)

Aggregations

Canvas (android.graphics.Canvas)8 CanvasTransformer (com.slidingmenu.lib.SlidingMenu.CanvasTransformer)8