Code example for ScaleGestureDetector

0
    private Matrix4f mIdentityMatrix = new Matrix4f();
 
    public SimpleModelView(Context context) {
        super(context);
        ensureRenderScript(); 
        mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
        // Get an instance of the SensorManager 
        mSensorManager = (SensorManager)getContext().getSystemService(Context.SENSOR_SERVICE);
        // find the rotation-vector sensor 
        mRotationVectorSensor = mSensorManager.getDefaultSensor(
                Sensor.TYPE_ROTATION_VECTOR);
        mIdentityMatrix.loadIdentity();
    } 
 
    private void ensureRenderScript() { 
        if (mRS == null) {
            RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
            sc.setDepth(16, 24);
            mRS = createRenderScriptGL(sc);
            mRender = new SimpleModelRS();
Stop searching for code, let great code find you!  Add Codota to your java IDE