litho
litho copied to clipboard
LithoView works incorrectly after upgraded to viewpager2
- I have searched existing issues and this is not a duplicate
Version
0.34
Issues and Steps to Reproduce
I upgraded my app fragment viewpager from ViewPager to ViewPager2. It only shows the first fragment page and other fragment pages keep blank.
Expected Behavior
Should display correctly like ViewPager widget.
Hey @wooyukit , can you give bit more details here? If you can repro in our sample app and share that, it would make it easier for us to debug that.
I found that it is related to the incremental mount issue. Sometimes, the litho view wrongly detect if it is visible or not for example in the recyclerview with snap animation.
@wooyukit LithoView is not always able to understand if it's visible. Especially if its visibility was changed from the outside, like LV is in a container that is scrolled partially off the screen. So, sometimes you need to call notifyVisibleBoundsChanged(..)
method manually
I found this issue when i wan to upgraded viewpager2. Pls support early.
Hey! Have you checked out ViewPagerComponentSpec
sample from the sample app? https://github.com/facebook/litho/tree/master/sample/src/main/java/com/facebook/samples/litho/viewpager
@colriot I need mixed use litho and fragment , so i need warp litho in viewpager2
. ViewPagerComponentSpec
can only support simple scene.
Any update or workaround?