I'm developing an Android Application that has three very similar Activities. I would like the user to be able to switch between them by swiping left and right on the screen. This is how I managed that up to now:
I followed this post
Then I changed the method onSwipe() in this way:
@Override
public void onSwipe(int direction) {
Intent intent = new Intent();
switch (direction) {
case SimpleGestureFilter.SWIPE_RIGHT:
intent.setClass(this, TodoTodaySheet.class);
break;
case SimpleGestureFilter.SWIPE_LEFT:
intent.setClass(this, TrashSheet.class);
break;
}
startActivity(intent);
}
It works but I'm not completely satisfied with this. Moreover, I don't know if this is the correct approach.
I would like to have a behavior like the one on Home apps, when switching desktop. Therefore I would like a smoother animation and the appearance of the called activity from the right direction, eg. from the left side of the screen when swiping on the right.
Any hints? Thank you very much.