Comments (15)
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 FastScrollerBuilder.setPadding()
. This is actually coverd in the sample, where part of the bottom padding is for FAB and part of it is for navigation bar.
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.
from androidfastscroll.
What is the condition to reproduce each case?
This library doesn't have any magic for drawing, and just respects the RecyclerView
bounds (and padding) by default.
from androidfastscroll.
It's the same one.
I tried to make a sample now.
I think it's similar to what I have on the real app.
Please advise what could be done, and also consider to add something similar in your sample.
device-2019-12-18-131421.zip
My Application.zip
from androidfastscroll.
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
from androidfastscroll.
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?
from androidfastscroll.
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.
So I tried to use it instead.
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
MyApplication2.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 ?
from androidfastscroll.
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 ?
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.
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?
Because it's kind of confusing if we have a getPadding()
. The padding in FastScroller
works by first respecting a user-set padding via setPadding()
, then falling back to the RecyclerView
's padding. When there is no user-set padding, the result of getPadding()
can either be null
(unexpected null) or the RecyclerView
padding (but no padding was provided by setPadding()
, and it might change with RecyclerView
without setPadding()
being called). Meanwhile, the developer wrote the UI so they must know what the padding should be, either 0, or RecyclerView.getPadding*()
, or combined with window insets.
As for the sample, only placed I see it's used is in ScrollingViewOnApplyWindowInsetsListener.
So I tried to use it instead.
ScrollingViewOnApplyWindowInsetsListener
mostly handles window insets. In your case, you can call FastScrollerBuilder.setPadding(0, 0, 0, 0)
to tell the impl not to respect any RecyclerView
padding. For RecyclerView being pushed down by CoordinatorLayout
, please check out the link I posted in my previous comment.
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 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.
from androidfastscroll.
Already reported about the bubble issue here :
https://issuetracker.google.com/issues/37065069
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... :)
from androidfastscroll.
If Google Contacts fixed the popup & FAB issue I'll consider fixing it in this library as well.
For your issue with AppBarLayout.ScrollingViewBehavior
, It's not a bug in this library and thus can't get fixed. I already pointed out a solution in my previous comment, which includes a link to source code of my app dealing with the CoordinatorLayout
and view behavior pushing RecyclerView
down, and my app works well, so please read my previous comment again.
from androidfastscroll.
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 ?
from androidfastscroll.
ScrollingViewOnApplyWindowInsetsListener
mostly handles window insets. In your case, you can callFastScrollerBuilder.setPadding(0, 0, 0, 0)
to tell the impl not to respect anyRecyclerView
padding. For RecyclerView being pushed down byCoordinatorLayout
, please check out the link I posted in my previous comment.
from androidfastscroll.
The link is about 1300 lines of code. Which part exactly in it do you handle CoordinatorLayout ? I don't see FastScrollerBuilder/CoordinatorLayout there.
But I do see ScrollingViewOnApplyWindowInsetsListener, again...
from androidfastscroll.
The link contains a line number so you don't need to read 1000 lines of code.
from androidfastscroll.
OK I hope this will work on the big project. Thank you.
from androidfastscroll.
The trick with adding an OffsetChangedListener
implemented here worked like a charm for me! Saved my day. The good thing is it also works for any AppBarLayout
, even when its children don't have scrollFlags="scroll"
, and it also works for NestedScrollViews
.
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.
Cheers!
from androidfastscroll.
Related Issues (20)
- Publish artifacts to Maven Central HOT 8
- android:tint in GradientDrawable HOT 1
- FixItemDecorationRecyclerView HOT 2
- Add a RecyclerView ViewHelper for dynamic item height HOT 1
- Unwanted visualize effect + jumpy effect when applying AndroidFastScroll on RecyclerView HOT 2
- java.lang.IndexOutOfBoundsException HOT 1
- 支持PreferenceFragmentCompat HOT 5
- 和 BottomNavigationView 一起用会显示异常 HOT 4
- Fatal Exception: java.lang.ArithmeticException: divide by zero HOT 1
- 增加隐藏的时间设置 HOT 4
- Thumb is wrong position when scroll in Expanable RecyclerView HOT 1
- https://www.AnonSaintsGithub.com,"Signal Boosters | Federal Communications Commission" https://www.fcc.gov/wireless/bureau-divisions/mobility-division/signal-boostershttps://support.mozilla.org/1/mobile/104.2.0/Android/en-US/whats-new-firefox-focus-androidhttps://support.mozilla.org /1/mobile/104.2.0/Android/en-US/whats-new-firefox-focus-android
- Crash due to old `AppCompat` Library HOT 2
- 能否动态获取recyclerview的内容高度 HOT 1
- scrollbar 容易误触
- Allow styling of text in PopupTextProvider
- Conflict with ItemTouchHelper HOT 1
- ViewHelper with multi item type (多布局的ViewHelper里面如何计算) HOT 1
- Expose methods to adjust mMinTouchTargetSize in FastScroller HOT 2
- Add method to check if FastScroller is currently being displayed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidfastscroll.