jasongaoh / nestedrecyclerview Goto Github PK
View Code? Open in Web Editor NEW🔥Copied the homepage of taobao and jd.com, and realized the TAB ceiling effect through two-layer nesting RecyclerView .
🔥Copied the homepage of taobao and jd.com, and realized the TAB ceiling effect through two-layer nesting RecyclerView .
Introduction:
Welcome to the exciting world of crypto airdrops! Here's a curated list of active airdrops that you wouldn't want to miss. Dive in and explore the opportunities:
Share on Social Media:
🚀 Claim Your Share: Pyth Network Airdrop 🚀 Unlock the potential of $PYTH tokens in this step-by-step guide. Claim yours now! Share on Twitter
— Pyth Network (@pythnetwork) November 28, 2023
Verify Eligibility:
After sharing and connecting your walle
Active Airdrops:
当ChildRecyclerView下滑时,ChildRecyclerView滑动到顶部(非fling),此时ParentRecyclerView不会继续下滑。
可以查看下面这个链接里的视频帮助理解:
https://youzai-1258403966.cos.ap-shanghai.myqcloud.com/70611dc361b5f93d817f50731018918d.mp4
childRecyclerView快速向上滚动的时候出现,还未到顶部,就开始滚动了父布局
用SmartRefreshLayout有冲突
demo提供的viewpager加载recycler,如果换成viewpager加载fragment,fragment布局使用recyclerview,这样支持吗
不知道大佬对childrecyclerview 这个holder重复刷新与复用时,什么时机重置childrecyclerview的状态合适以及如何重置childrecyclerview,否则经常会因为ParentRecyclerview的canScrollVertically方法被拦住不能滑动。
看到有说处理嵌套滚动问题,当我们滑动不松手时会出现无法滑动的问题,咱们解决的方案有吗?
可以支持多次吸顶吗?
private val strArray = arrayOf("推荐", "视频", "直播", "图片", "精华", "热门")
感谢作者的代码!
提个修改建议: ParentRecyclerView中
public boolean canScrollVertically() { ChildRecyclerView childRecyclerView = findNestedScrollingChildRecyclerView(); return (canScrollVertically.get() || childRecyclerView == null || childRecyclerView.isScrollTop()); }
这里上滑时,没有判断子列表未滑动到顶部的情况,改成下面这种方式就OK了
public boolean canScrollVertically() { ChildRecyclerView childRecyclerView = findNestedScrollingChildRecyclerView(); if (childRecyclerView != null && !childRecyclerView.isScrollTop()) { return false; } else { return canScrollVertically.get(); } }
在其中recyclerview里一直按住拖动,到达顶部或者底部,无法联动上或下的recyclerview。fling时没有问题。
代码混乱
当tab1下面子recyclerview滑动到第N项,切换到tab2,在tab2页面下滑,把tab滑动至屏幕**,切回tab1,此时tab1的子recyclerview无法将之前滑上去的项滑出。
如果tab栏上方的项(也就是父recyclerview除了tab栏和子recyclerview之外的项)比较少时,会出现某些tab栏下的recyclerview表现的像是无法滑动。
修改建议:
override fun canScrollVertically(): Boolean {
val childRecyclerView = findNestedScrollingChildRecyclerView()
if(canScrollVertically.get() || childRecyclerView == null || childRecyclerView.isScrollTop()) {
return true
}
return false
}
override fun canScrollVertically(): Boolean {
val childRecyclerView = findNestedScrollingChildRecyclerView()
if (childRecyclerView == null) {
return canScrollVertically.get();
}
if (!childRecyclerView.isScrollTop()) {//先让子recyclerview滑动到顶部
return false
}
return (canScrollVertically.get() || childRecyclerView.isScrollTop())
}
如果有类似问题可以参考此建议,但如果需求就是要那样的效果就不必改了。
rt
1.向上滑动列表时初次滑动会有卡顿问题
2.当下方Recyclerview全部显示的时候,在快速fling的过程中,底部Recyclerview在未全部显示(滑动到顶部时)就已经将手势交给外层列表开始滑动头部Recyclerview
华为P10
Tab置顶之后
切换到其他tab
一下子向上滑动 childRecyclerView
可以发现childRecyclerView 会突然一下子卡主不滑动了
当childRecyclerView 每次加载好数据之后 就不会出现这样的问题
问题重现步骤: A tab 所在页面向上滑动到吸顶后一定位置(假如是4 position 位置),切换到B tab ,然后在B tab 所在页面再向下滑动到非吸顶,再切换到A tab,此时A tab所在页面由于没有重置滑动位置,还是停留在position为4的位置,此时无论向上还是向下滑动都无法看到position为4之前的内容,需要继续滑动到吸顶一定距离再向下滑动才能正常。
viewpager用fragment的话,开启不留活动,fragment生命周期会走,但是不展示出来
问题:只有当滑动到顶部的时候,吸顶组件才会往下滑
1:ParentRecyclerView适配器里面有多个ViewItemType, 每个页面item的高度是不一样的
2:childRecyclerView 的tab置顶之后,缓慢向下滑动,滑动tab 处于页面中间的时候会出现抖动,突然向下滑动了一段距离,导致了页面的闪烁
1、在调用Parent.initLayoutManager()方法前,为ParentRecyclerView再设置一个StaggeredGridLayoutManager,会导致滑动冲突,这是为啥?
2、如果给ParentRecyclerView设置了StaggeredGridLayoutManager,initLayoutManager方法里面的LinearLayoutManager也必须设置为StaggeredGridLayoutManager,这个问题也不清楚是为啥?
华为Android10手机|机型P30,当滑动置顶后,再轻触向下滑动,子recycleview 未滑动到顶部父recycleview就开始滑动,必现。。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.