implementation of swipe in main activity