Project activity swipe right to exit the activity function

android swipe right to exit activity

Implementation:

// Swipe right to delete
    compile 'com.jude:swipebackhelper:3.1.2'

 Then add code in Baseactivity:

SwipeBackHelper.onCreate(this);
        SwipeBackHelper.getCurrentPage(this)
                .setSwipeBackEnable(true)
                .setSwipeSensitivity(0.5f)
                .setSwipeRelateEnable(true)
                .setSwipeRelateOffset(300);

@Override
    protected void onDestroy() {
        SwipeBackHelper.onDestroy(this);
 
        super.onDestroy ();
    }

 It's that simple

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326150886&siteId=291194637