-
Notifications
You must be signed in to change notification settings - Fork 63
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
Request: show how to use with a CollapsingToolbarLayout #7
Comments
What is the condition to reproduce each case? This library doesn't have any magic for drawing, and just respects the |
It's the same one. Please advise what could be done, and also consider to add something similar in your sample. |
The first case is caused by your bottom padding on RecyclerView - the padding is respected by this library by default, and to override it you need to call The second problem is likely caused by CollapsingToolbarLayout pushing the RecyclerView down. There is no elegant way to do it, and my workaround in my own app is to add to the bottom padding upon RecyclerView being pushing down (link). But this also means triggering re-layout, etc. |
The padding is done because there is a FAB, and it's in the guidelines to avoid having a FAB hiding content on the last items. Do you know of a nice solution? How do other, similar libraries handle those issues? I used to use this solution, but it had issues with fragments |
I didn't say there can't be padding for FAB, and I mentioned the sample app has that padding as well. Could you try the solutions in my last comment? |
Can't you put the fast-scroller and its bubble on a new View that draws them, which can have behavior that will be respected by the CoordinatorLayout ? As for padding, how come it has "setPadding" but no "getPadding" ? How could I know what to put to it? I don't want to change all of the padding. Just probably need to change the bottom one, no? As for the sample, only placed I see it's used is in ScrollingViewOnApplyWindowInsetsListener. Attached the sample now and a video of it. Do you think it is ok now? I hope I can use a similar solution on the real app. device-2019-12-18-225741.zip BTW, in your sample I see the FAB on top of the bubble, and you wrote on the repository explanation that it can be fixed. Can you please update the sample to show how ? |
I can, but didn't. (They are actually in new views, just in the overlay view group of the RecyclerView.) Having to specify where to put views are cumbersome, complicates layout code and may trigger unnecessary re-layouts. It's just a desgin decision.
Because it's kind of confusing if we have a
I don't remember saying that, and it can be cumbersome to fix. Even Google Contacts app (the only Google app I know to have fast scrolling) shows the popup under FAB, so I just didn't bother. Apart from the code, could you please refrain from using rhetorical questions, like "Can't you", ", no?", or even "How come", etc... I feel unpleasant about them and I'm voluntarily answering questions here, so a nicer tone would be appreciated. |
Already reported about the bubble issue here : As for the rest, I don't understand. You mean that it's already fixed? Or that I should try something and let you know? The sample is already attached. You can try it too... :) |
If Google Contacts fixed the popup & FAB issue I'll consider fixing it in this library as well. For your issue with |
I believe they will fix it, eventually, or just use a simple solution such as hiding the FAB. As for the issue, I still don't understand what is the solution. I already looked at the code. You want me to use ScrollingViewOnApplyWindowInsetsListener ? |
|
The link is about 1300 lines of code. Which part exactly in it do you handle CoordinatorLayout ? I don't see FastScrollerBuilder/CoordinatorLayout there. |
The link contains a line number so you don't need to read 1000 lines of code. |
OK I hope this will work on the big project. Thank you. |
The trick with adding an For anyone interested, I made an extension out of it : fun AppBarLayout.fixForFastScroll(container: ViewGroup) {
val contentLayoutInitialPaddingBottom = container.paddingBottom
addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { _, offset ->
container.setPaddingBottom(contentLayoutInitialPaddingBottom + totalScrollRange + offset)
})
} Even if it's not included in the library, it might be a good idea to document it somewhere. I was actually going to create a new issue before stumbling upon this one. |
Currently for some reason when you scroll to the bottom, the fast-scroll can either stop before the RecyclerView:
Or it can reach too far:
The text was updated successfully, but these errors were encountered: