Created
May 30, 2010 11:45
-
-
Save tily/418968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cc.omora; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.MotionEvent; | |
import android.view.GestureDetector; | |
import android.util.Log; | |
public class AllEvents extends Activity implements | |
GestureDetector.OnGestureListener, | |
GestureDetector.OnDoubleTapListener | |
{ | |
private GestureDetector mGestureDetector; | |
public void onCreate(Bundle savedInstanceState) { | |
Log.v("Test", "onCreate()"); | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
mGestureDetector = new GestureDetector(this); | |
} | |
protected void onResume() { | |
Log.v("Test", "onResume()"); | |
super.onResume(); | |
} | |
protected void onPause() { | |
Log.v("Test", "onPause()"); | |
} | |
public boolean onTouchEvent(MotionEvent event) { | |
Log.v("Test", "onTouchEvent()"); | |
if (mGestureDetector.onTouchEvent(event)) { | |
return true; | |
} | |
return super.onTouchEvent(event); | |
} | |
public boolean onDown(MotionEvent event) { | |
Log.v("Test", "onDown()"); | |
return false; | |
} | |
public void onLongPress(MotionEvent event) { | |
Log.v("Test", "onLongPress()"); | |
} | |
public boolean onDoubleTap(MotionEvent e) { | |
Log.v("Test", "onDoubleTap()"); | |
return false; | |
} | |
public boolean onDoubleTapEvent(MotionEvent e) { | |
Log.v("Test", "onDoubleTapEvent()"); | |
return false; | |
} | |
public boolean onFling(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { | |
Log.v("Test", "onFling()"); | |
return false; | |
} | |
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { | |
Log.v("Test", "onScroll()"); | |
return false; | |
} | |
public void onShowPress(MotionEvent e) { | |
Log.v("Test", "onShowPress()"); | |
} | |
public boolean onSingleTap(MotionEvent e) { | |
Log.v("Test", "onSingleTap()"); | |
return false; | |
} | |
public boolean onSingleTapUp(MotionEvent e) { | |
Log.v("Test", "onSingleTapUp()"); | |
return false; | |
} | |
public boolean onSingleTapConfirmed(MotionEvent e) { | |
Log.v("Test", "onSingleTapConfirmed()"); | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment