Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

侧滑返回卡半屏幕 #23

Open
AdrianAndroid opened this issue Dec 2, 2020 · 5 comments
Open

侧滑返回卡半屏幕 #23

AdrianAndroid opened this issue Dec 2, 2020 · 5 comments

Comments

@AdrianAndroid
Copy link

Issues Guideline

APP分布(结构):
MainFragment
|----Fragment1
----|----(child)(Fragment1+Fragment2+Fragment3)
|----Fragment2
----|----(child)Fragment
|----Fragment3
----|----Fragment
--------|----(child) Fragment1 + Fragment2
----|----Fragment

点击回退键,上一个Fragment卡半屏幕。

图片

https://github.com/AdrianAndroid/Fragmentation/blob/learn/WechatIMG15.jpeg

@AdrianAndroid
Copy link
Author

我的手机是红米K30
红米K30

@AdrianAndroid
Copy link
Author

在SwipeBackLayout中,将下面几行注释掉,下层就不再跟随一起滑动了

` @OverRide
public void computeScroll() {

    if (mEnable) {
        mScrimOpacity = 1 - mScrollPercent;
        if (mScrimOpacity >= 0) {
            if (mHelper.continueSettling(true)) {
                ViewCompat.postInvalidateOnAnimation(this);
            }

// if (mPreFragment != null && mPreFragment.getView() != null) {
// if (mCallOnDestroyView) {
// mPreFragment.getView().setX(0);
// return;
// }
//
// if (mHelper.getCapturedView() != null) {
// int leftOffset = (int) ((mHelper.getCapturedView().getLeft() - getWidth()) * mParallaxOffset * mScrimOpacity);
// mPreFragment.getView().setX(leftOffset > 0 ? 0 : leftOffset);
// }
// }
}
}
}`

@JantHsueh
Copy link
Owner

你调出虚拟按键,按返回键看会不会出现这个问题。
你可以使用 setSwipeBackEnable(false) 来禁止右滑退出,不用注释这个代码

@ruanbaojun1105
Copy link

其实那不是卡一半,是框架问题,快速pop时候有几率出现,其实和他们反馈的白屏是一个问题

@CAnonymous8
Copy link

这个问题可以参考这里 YoKeyword#1130 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants