SwipeAwayDialog:仿 Tinder 卡片左右滑动消失效果的 Dialog

SwipeAwayDialog:仿 Tinder 卡片左右滑动消失效果的 Dialog

Android 对话框Dialog

访问GitHub主页

共834Star

详细介绍

SwipeAwayDialog

Platform API Android Arsenal Build Status

Android DialogFragment that enables Dialog to be swiped away to dismiss.
It's extremely easy to make Tinder-like UI.

Install

dependencies {
    compile 'com.labo.kaji:swipeawaydialog:0.1.1'
}

Usage

Just extend SwipeAwayDialogFragment instead of DialogFragment.

public class ExampleDialogFragment extends SwipeAwayDialogFragment {
    // Implement DialogFragment as usual.
}

If you want to handle swiped away event, implement onSwipedAway.
You can prevent dismissing by returning true.

@Override
public boolean onSwipedAway(boolean toRight) {
    return false;
}

License

MIT License.

推荐源码