Changes

Jump to: navigation, search
no edit summary
This example application calls for a very simple user interface consisting of a LinearLayout view with a GestureOverlayView layered on top of it to intercept any gestures. Locate the ''res -> layout -> main.xml'' file and double click on it to load it into the main panel. Select the TextView object in the user interface layout and delete it.
Next, select the Advanced section of the Palette and drag and drop a GestureOverlayView object onto the Layout canvas and resize it to fill the entire layout area. Change the ID of the GestureOverlayView object to gOverlay. When completed, the ''main.xml '' file should read as follows:
<pre>
== Loading the Gestures File ==
Now that the gestures file has been added to the project, the next step is to write some code so that the file is loaded when the activity starts up. For the purposes of this project, the code to achieve this will be placed in the onCreate() method of the GestureEventActivity class located in the ''GestureEventActivity.java '' source file:
<pre>
Within the Eclipse environment, perform the usual steps to create an Android project named PinchExample with an appropriate package name using the Android 2.3.3, level 10 SDK and including a template activity.
Within the ''main.xml '' file, locate the TextView object and change the ID to myTextView.Locate and load the ''PinchExampleActivity.java '' file into the Eclipse editor and modify the file as follows:
<pre>

Navigation menu