Closed vszakd closed 7 years ago
Hi @mollicaw
Please try to call smoothAppBarLayout. syncOffset(0);
to reset scrolling position after switching to fragment B. Also notice that, you have RecyclerView inside NestedScrollView in fragment B, please call recyclerView.setNestedScrollEnabled(false);
.
Let me know if it works for you. Thanks.
Hello @henrytao-me, thanks for your suggestion!
recyclerView.setNestedScrollEnabled(false);
was already present and syncOffset(0);
resolved the problem, but only partially.
The previous use-case is now solved but there is a new problem, here is how to reproduce it:
RecyclerView
and WHILE the page is scrolling press Android's back button (physical or on-screen)This behaviour does not happen with the support AppBarLayout
. Any thoughts?
Thanks in advance.
Hi @mollicaw
It looks like you use backstack with fragment. In that case, you may need to reset scrolling position (by calling setSyncOffset(0)
) when backstack is changed (doing backpress).
Let me know if you need further assistant.
Cheers, Henry
Hello, I'm experiencing a strange issue that does not happen with the regular support AppBarLayout. This is the main Activity layout:
Fragment B layout
Now let's say that
fragment_placeholder
has fragment A shown. We then replace it via a transaction with fragment B, which calls AppBarLayout.setExpanded(true) in its onCreateView() callback. Here it comes the problem: if the Toolbar was shown in fragment A, then in B the behaviour is as expected. On the contrary, if in A the Toolbar was hidden (e.g.: by scrolling up with the finger), the Toolbar in B does get shown correctly but if a down slide occurs the Toolbar becomes cut in half. If a subsequent up slide is done the behaviours returns normal. Same to be said in case of a first non-down slide: no problems at all.Any ideas? If more information is needed I'm here to help. Thank you.
Attachments
Fragment B is shown correctly, with AppBarLayout expanded
A down slide with the finger is done.