SwipeBackLayout icon indicating copy to clipboard operation
SwipeBackLayout copied to clipboard

小米mix2 android9 demo apk 测试返回 闪一下

Open wangyuan0217 opened this issue 5 years ago • 4 comments

demo apk安装测试,操作滑动返回后,页面会重新再有个从上到下消失的闪屏效果

wangyuan0217 avatar May 29 '19 03:05 wangyuan0217

image 同样的问题,设置方向为Top,下拉关闭以后,会有动画的残影闪一下,从上到下

Liar1995 avatar Nov 05 '19 06:11 Liar1995

你们闪一下的问题解决了么,我只有在横屏的时候退出时会闪一下呢!

gudd1991116 avatar Feb 27 '20 07:02 gudd1991116

请问解决了吗?

ChinaZeng avatar Jun 10 '20 09:06 ChinaZeng

我在我的项目如下解决:

/**
 * 解决滑动结束后,finish过程中还设置view可见或者隐藏等触发onLayout出现闪屏的bug
 */
public class SuperSwipeBackLayout extends SwipeBackLayout {
    public SuperSwipeBackLayout(@NonNull Context context) {
        this(context, null);
    }

    public SuperSwipeBackLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public SuperSwipeBackLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        if (isFinish) {
            return;
        }
        super.onLayout(changed, l, t, r, b);
    }


    private boolean isFinish = false;

    @Override
    public void finish() {
        isFinish = true;
        super.finish();

    }
}

ChinaZeng avatar Jun 11 '20 06:06 ChinaZeng