litho icon indicating copy to clipboard operation
litho copied to clipboard

LithoView works incorrectly after upgraded to viewpager2

Open wooyukit opened this issue 4 years ago • 7 comments

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.

wooyukit avatar Apr 30 '20 13:04 wooyukit

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.

muraziz avatar Apr 30 '20 14:04 muraziz

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 avatar May 16 '20 14:05 wooyukit

@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

colriot avatar Jun 02 '20 14:06 colriot

I found this issue when i wan to upgraded viewpager2. Pls support early.

wangbax avatar Aug 21 '20 12:08 wangbax

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 avatar Aug 26 '20 19:08 colriot

@colriot I need mixed use litho and fragment , so i need warp litho in viewpager2 . ViewPagerComponentSpec can only support simple scene.

wangbax avatar Aug 28 '20 11:08 wangbax

Any update or workaround?

mnayef95 avatar Sep 27 '20 21:09 mnayef95