Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

EdgeSize will fail when the slide direction is LEFT or RIGHT. #60

Open
GavinTvs opened this issue Mar 1, 2018 · 2 comments
Open

EdgeSize will fail when the slide direction is LEFT or RIGHT. #60

GavinTvs opened this issue Mar 1, 2018 · 2 comments

Comments

@GavinTvs
Copy link

GavinTvs commented Mar 1, 2018

SlidrConfig config=new SlidrConfig.Builder()
                .position(SlidrPosition.LEFT)
                .edgeSize(0.3f)
                .build();
Slidr.attach(this,config);

左滑还是会在边界才会响应,并不是在30%的区域,但是TOP或者BOTTOM就没有这样的问题

@GavinTvs
Copy link
Author

GavinTvs commented Mar 1, 2018

The left side will only respond at the border, not in the 30% area, but there is no such problem with TOP or BOTTOM.

@GavinTvs GavinTvs changed the title 当滑动方向为LEFT或者RIGHT的时候,edgeSize将会失效 EdgeSize will fail when the slide direction is LEFT or RIGHT. Mar 1, 2018
@BrightVan
Copy link

其实看下源码就很清楚知道怎么解决了
把dragHelper.isEdgeTouched(edgePosition, pointerId)改成isEdgeTouched

  private final ViewDragHelper.Callback leftCallback = new ViewDragHelper.Callback() {

        @Override
        public boolean tryCaptureView(View child, int pointerId) {
            boolean edgeCase = !config.isEdgeOnly() || isEdgeTouched;
            return child.getId() == decorView.getId() && edgeCase;
        }

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

No branches or pull requests

2 participants