Referring to these tutorials and examples, I tried to implement the swipe action. For that, I wrote below codes in onCreate method of MainActivity.
ActivitySwipeDetector swipe = new ActivitySwipeDetector(this, null);
RelativeLayout swipe_layout = (RelativeLayout) findViewById(R.id.mainll);
swipe_layout.setOnTouchListener(swipe);
Now I have few questions -
- is passing null as SwipeInterface activity is okay?
- What is the use of SwipeInterface activity argument in ActivitySwipeDetector class? Is it okay if I just implement all functions inside ActivitySwipeDetector class, deleting SwipeInterface class?
Thanks for help as usual.