You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ViewPager2 acts as container for fragments. There is one fragment per tab. Each fragment includes a RecyclerView (scrollable list). Similar to your app.
Now, I've implemented fullscreen design with insets similar to example "Ch9 Insets and Fullscreen" in accordance with the Android guidelines within MainActivity.java. I've set mlp.bottomMargin to 0 and android:paddingBottom="50dp" to ViewPager2 in order the see the list scrolling behind the transparent navbar. So far so good.
The issue that I'm now facing is, that...
an ugly white bar appears at the bottom of the screen when scrolling upwards and makes the NavBar intransparent again. See a video of the issue here.
I don't like the hardcoded 50dp on ViewPager2 as different devices might have different paddings.
The solution would be to know the bottom NavBar inset within my fragments. Then, I could simply apply setPadding(0,0,0, navBarPadding); + setClipToPadding(false); to the Recyclerview and could remove the 50dp from ViewPager2. Unfortunately, I don't get that info via setOnApplyWindowInsetsListener in the fragment as the function is never called there.
Do you have any plans to implement a transparent NavBar to "Ch4 Toolbar+TabLayout" and / or would like to share some of your know-how about the issue that I'm facing?
The text was updated successfully, but these errors were encountered:
Hello,
My app uses the same principles as the "Ch4 Toolbar+TabLayout" example on your page:
ViewPager2
acts as container for fragments. There is one fragment per tab. Each fragment includes aRecyclerView
(scrollable list). Similar to your app.Now, I've implemented fullscreen design with insets similar to example "Ch9 Insets and Fullscreen" in accordance with the Android guidelines within
MainActivity.java
. I've setmlp.bottomMargin
to 0 andandroid:paddingBottom="50dp"
toViewPager2
in order the see the list scrolling behind the transparent navbar. So far so good.The issue that I'm now facing is, that...
ViewPager2
as different devices might have different paddings.The solution would be to know the bottom NavBar inset within my fragments. Then, I could simply apply
setPadding(0,0,0, navBarPadding);
+setClipToPadding(false);
to theRecyclerview
and could remove the 50dp fromViewPager2
. Unfortunately, I don't get that info viasetOnApplyWindowInsetsListener
in the fragment as the function is never called there.Do you have any plans to implement a transparent NavBar to "Ch4 Toolbar+TabLayout" and / or would like to share some of your know-how about the issue that I'm facing?
The text was updated successfully, but these errors were encountered: