Code example for ScaleGestureDetector

0
 
public class TestAppView extends RSSurfaceView { 
 
    public TestAppView(Context context) {
        super(context);
        mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
    } 
 
    private RenderScriptGL mRS;
    TestAppRS mRender;
 
    private ScaleGestureDetector mScaleDetector;
    private static final int INVALID_POINTER_ID = -1;
    private int mActivePointerId = INVALID_POINTER_ID;
 
    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
        super.surfaceChanged(holder, format, w, h);
        if (mRS == null) {
            RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
            sc.setDepth(16, 24);
            sc.setSamples(1, 2, 1);