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

下滑时覆盖其他控件 #9

Open
diov opened this issue Jan 3, 2017 · 3 comments
Open

下滑时覆盖其他控件 #9

diov opened this issue Jan 3, 2017 · 3 comments

Comments

@diov
Copy link

diov commented Jan 3, 2017

我看了一下,探探的卡片向下滑动时会覆盖掉其他 Button 等控件。
如果单纯用 LayoutManager 和 Callback 来实现的话, 卡片滑动到 RecyclerView 的边界以后就消失了。
用 Android Monitor 看了一下,探探的似乎是把下面的两个按钮跟可滑动的卡片放在一个重写的 ViewGroup 里面,并没有用 LayoutManager 来实现。

@mcxtzhang
Copy link
Owner

实现的方法很多,每个人可以按照自己的喜好实现。
我并不是探探的开发人员,我给出的是我的做法。。
探探应该是重写的adapterView实现的,
关于下面的喜欢不喜欢按钮, 你也可以放进RecyclerView的Item里去做嘛

@diov
Copy link
Author

diov commented Jan 3, 2017

我的意思是,如果用layoutmanager来实现的话会有些局限性。当页面上有其他元素的情况下,可能拖动的效果就不太好了。
如果是都放在recyclerview的item来实现的话,在layout的时候需要重写的东西就比较多,代价比较大。
不过我暂时还没想到有什么比较好的解决方案,可以方便的用layoutmanager来实现,并且避免这种情况...

@mcxtzhang
Copy link
Owner

每一种方案都有优缺点哈。
我的朋友们也尝试用ViewGroup实现了,这就要看你的取舍了。以及实际UI的样子,
如果要我做到和探探一模一样,我可能会在window里addView,或者继续改写LayoutManager ItemTouchHelper类。
或者采用自定义ViewGroup做。

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