swipe to dismiss code borrowed from
https://github.com/romannurik/Android-SwipeToDismiss