<!– Here is where we put the SurfaceView, in a frame so that we can stack other views on top of it. –> <FrameLayout android:layout_width=”fill_parent“ android:layout_height=”0px“ android:layout_weight=”1“>

/* * These variables store the previous X and Y * values as well as a fix touch scale factor. * These are necessary for the rotation transformation * added to this lesson, based on the screen touches. ( NEW ) */ private float oldX; private float oldY; private final float TOUCH_SCALE = 0.2f; //Proved to be good for normal rotation ( NEW )