Code example for Display

Methods: getOrientation

0
        mFilteredSensorX *= mAlpha;
        mFilteredSensorY *= mAlpha;
        event.values[0] *= 50 * (1.0 - mAlpha);
        event.values[1] *= 50 * (1.0 - mAlpha);
         
        switch (mDisplay.getOrientation()) {
            case Surface.ROTATION_0:
            	mFilteredSensorX -= (int)event.values[0];
            	mFilteredSensorY += (int)event.values[1];
                break; 
            case Surface.ROTATION_90:
            	mFilteredSensorX -= (int)-event.values[1];
            	mFilteredSensorY += (int)event.values[0];
                break; 
            case Surface.ROTATION_180:
            	mFilteredSensorX -= (int)-event.values[0];
            	mFilteredSensorY += (int)-event.values[1];
                break; 
            case Surface.ROTATION_270:
            	mFilteredSensorX -= (int)event.values[1];
Connect your IDE to all the code out there  Get Codota for Java