Bug P2
Status Update
Comments
de...@gmail.com <de...@gmail.com> #2
Actually it seems that callback OnApplyWindowInsetsListener
is also not triggered after configuration change (screen orientation) for all non visible fragments in a ViewPager2
despite setting offscreenPageLimit
to maximum.
Description
Component used: Activity
Version used:
1.9.3
Devices/Android versions reproduced on: Android 5.0 Lollipop
I have an Activity that holds four Fragments via
ViewPager2
andFragmentStateAdapter
. I noticed thatViewCompat.setOnApplyWindowInsetsListener
and itsOnApplyWindowInsetsListener
callback only fires one time at the first tab Fragment in Android 5 or probably all version prior to Android 15.Activity -
OnApplyWindowInsetsListener
gets calledOverviewFragment -
OnApplyWindowInsetsListener
gets calledProfileFragment -
OnApplyWindowInsetsListener
gets called for Android 15 but not on Android 5ExchangeFragment -
OnApplyWindowInsetsListener
gets called for Android 15 but not on Android 5MetricsFragment -
OnApplyWindowInsetsListener
gets called for Android 15 but not on Android 5Also worth mentioning that when using other Android's tab solution such as Material Design Component
BottomNavigationView
with Jetpack Navigation, returningWindowInsetsCompat.CONSUMED
on each Fragments does not end the passing of window insets regardless of Android version I am running. So I don't know if this is a bug for backward compatibility of edge-to-edge enforcement, it seems thatViewPager
Fragments view hierarchy are treated as one in older devices?