Skip to content

Instantly share code, notes, and snippets.

@pwittchen
Created March 11, 2016 12:39
Show Gist options
  • Save pwittchen/c4fe6cb3963f400baf1d to your computer and use it in GitHub Desktop.
Save pwittchen/c4fe6cb3963f400baf1d to your computer and use it in GitHub Desktop.
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
info = (TextView) findViewById(R.id.info);
swipe = new Swipe();
swipe.addListener(new SwipeListener() {
@Override public void onSwipingLeft(final MotionEvent event) {
info.setText("SWIPING_LEFT");
}
@Override public void onSwipedLeft(final MotionEvent event) {
info.setText("SWIPED_LEFT");
}
@Override public void onSwipingRight(final MotionEvent event) {
info.setText("SWIPING_RIGHT");
}
@Override public void onSwipedRight(final MotionEvent event) {
info.setText("SWIPED_RIGHT");
}
@Override public void onSwipingUp(final MotionEvent event) {
info.setText("SWIPING_UP");
}
@Override public void onSwipedUp(final MotionEvent event) {
info.setText("SWIPED_UP");
}
@Override public void onSwipingDown(final MotionEvent event) {
info.setText("SWIPING_DOWN");
}
@Override public void onSwipedDown(final MotionEvent event) {
info.setText("SWIPED_DOWN");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment