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

[Slider] Fix slider label not moving #3917

Closed
wants to merge 2 commits into from
Closed

[Slider] Fix slider label not moving #3917

wants to merge 2 commits into from

Conversation

manabu-nakamura
Copy link
Contributor

@@ -361,6 +361,8 @@ abstract class BaseSlider<
}
}
};
@NonNull
private final ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = onScrollChangedListener::onScrollChanged;
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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).

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

Successfully merging this pull request may close these issues.

None yet

3 participants