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

[TopAppBar] Make compress effect flag available via setScrollEffect #2894

Closed
patrickfrei opened this issue Aug 4, 2022 · 0 comments
Closed

Comments

@patrickfrei
Copy link

patrickfrei commented Aug 4, 2022

Is your feature request related to a problem?
Yes, this feature request is related to issue #2887

Describe the solution you'd like

  1. For com.google.android.material.appbar.MaterialToolbar and androidx.appcompat.widget.Toolbar, a compress effect can be added to the toolbar title in XML by using app:layout_scrollEffect="compress".
  2. However, trying to programmatically set that scroll effect (e.g. for certain API levels only) by using setScrollEffect (see documentation) isn't possible. Reason: The scroll effect flag SCROLL_EFFECT_COMPRESS declared in AppBarLayout class is not publicly accessible and can therefore not be set.
  3. Currently, a globally set compress effect can just be unset if null is passed to setScrollEffect but not the other way round.
  4. Therefore, it would be great to have a possiblity to set the scroll effect "compress" programmatically via setScrollEffect by using the SCROLL_EFFECT_COMPRESS flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants