Skip to content

React Native v0.43 ViewPagerAndroid work not well when detached then attach  #13463

@liuzhibopp

Description

@liuzhibopp

Description

Integration With Existing Apps
on 0.42 ViewPagerAndroid work well when detached then attach , after upgrading to React Native v0.43 when i slide one page to other page ,no smooth scroll and stop in middle ,i compared two version of react native.

Reproduction Steps and Sample Code

0.42 when i slide viewpager following codes will work and 0.43 there no updateLayout for ViewPagerAndroid :
java.lang.Thread.State: RUNNABLE at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1705) at android.view.View.layout(View.java:16980) at android.view.ViewGroup.layout(ViewGroup.java:5550) at com.facebook.react.uimanager.NativeViewHierarchyManager.updateLayout(NativeViewHierarchyManager.java:199) at com.facebook.react.uimanager.NativeViewHierarchyManager.updateLayout(NativeViewHierarchyManager.java:184) at com.facebook.react.uimanager.UIViewOperationQueue$UpdateLayoutOperation.execute(UIViewOperationQueue.java:124) at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:784) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:831) - locked <0x1e9d> (a java.lang.Object) at com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:45) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:870) at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32) at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:925) at android.view.Choreographer.doCallbacks(Choreographer.java:718) at android.view.Choreographer.doFrame(Choreographer.java:650) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5660) at java.lang.reflect.Method.invoke(Method.java:-1) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Solution

I don‘t know whether there is a relationship with the following changes :

  • Only call onLayout when layout has actually changed (15429e3)

how to fix ?
thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: FixedA PR that fixes this issue has been merged.Resolution: LockedThis issue was locked by the bot.Resolution: PR SubmittedA pull request with a fix has been provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions