-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Slider] Fix slider label not moving #3917
[Slider] Fix slider label not moving #3917
Conversation
@@ -361,6 +361,8 @@ abstract class BaseSlider< | |||
} | |||
} | |||
}; | |||
@NonNull | |||
private final ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = onScrollChangedListener::onScrollChanged; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sort of confusing. Can we declare a method, say, updateLableVisibility()
, and do something like:
private final ViewTreeObserver.OnScrollChangedListener onScrollChangedListener = this::updateLableVisibility;
private final ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = this::updateLableVisibility;
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much. I tried. I'm not sure if the name of the method is appropriate.
}; | ||
private final ViewTreeObserver.OnScrollChangedListener onScrollChangedListener = this::updateLabel; | ||
@NonNull | ||
private final ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = this::updateLabel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need both the global layout listener and the scroll listener or is just the global layout listener enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By only the global layout listener, the slider label doesn't move while scrolling (#2869).
#3124
#2869 (comment)