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

请教个问题 #11

Closed
shaycormac opened this issue Aug 7, 2024 · 2 comments
Closed

请教个问题 #11

shaycormac opened this issue Aug 7, 2024 · 2 comments

Comments

@shaycormac
Copy link

shaycormac commented Aug 7, 2024

你好,作者,首先感谢你开发了这个好用的第三方库,我在项目中已经使用了,但是遇到一个问题,请教指教一下,业务上,我使用的是单activity+多Fragment,所以activity上放了一个空的FrameLayout,承载着不同的Fragment,所以我在使用你的库改造后,大致下面这样
<cn.leaqi.drawer.SwipeDrawer
android:layout_width="match_parent"
android:layout_height="match_parent"
app:mainLayout="@+id/mainDrawer"
app:topLayout="@+id/topDrawer">

<FrameLayout
    android:id="@+id/topDrawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</FrameLayout>

<FrameLayout
    android:id="@+id/mainDrawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</FrameLayout>

</cn.leaqi.drawer.SwipeDrawer>

首先这个top下拉的页面是一个没有滑动的页面,但是id为main,也就是之前我项目里面的空FrameLayout 里面承载的不同Fragment,有的是一个没有滑动的布局,有的是带有上下滑动的RecycleView,还有水平滑动的RecyclerView, 目前我使用你提供的api,可以做到主页没有滑动和水平滑动的 不会和top的Fragment全屏手势下拉冲突,但是带有垂直Recyclerview的fragment加载进去后,它的上下滑动就被top的手势抢占了, 我看有 mainScroll这个api,但是要指定子View的id,但是我的主页加载的Fragment是动态的,没发写死id
所以这种情况 该怎么处理,谢谢~

@Leaqi
Copy link
Owner

Leaqi commented Aug 7, 2024

setMainScroll 动态去设置这个 View
或者手动判断滑动布局是否在顶部 setIntercept 屏蔽或开启触摸事件
@shaycormac

@shaycormac
Copy link
Author

收到,我去试试,非常感谢!

@Leaqi Leaqi closed this as completed Aug 23, 2024
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

2 participants