Skip to content

有着类似iOS打开和关闭界面,底层Activity会跟随滑动的滑动返回控件

Notifications You must be signed in to change notification settings

yangjingsong/SwipeBackHelper

Repository files navigation

SwipeBackHelper

####修改自https://github.com/Jude95/SwipeBackHelper ####添加类似iOS,打开和关闭Activity时底层的Activity也有跟随的动画效果

  • 按下返回键时
@Override
    public void onBackPressed() {
        super.onBackPressed();
        if (Build.VERSION.SDK_INT > 11) {
            SwipeBackPage page = SwipeBackHelper.getPrePage(SwipeBackHelper.findHelperByActivity(BaseActivity.this));
            if (page != null) {
                new PageTimeCounter(250, 1, page, true).start();
            }
        }
    }
  • startActivity时
public void startActivityWithAnimation() {
        if (Build.VERSION.SDK_INT > 11) {
            SwipeBackPage page = SwipeBackHelper.getCurrentPage(this);
            if (page != null) {
                new PageTimeCounter(500, 1, page, false).start();
            }
        }
    }

About

有着类似iOS打开和关闭界面,底层Activity会跟随滑动的滑动返回控件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages