I have a ViewPager which switches between Fragments that have a SciChartSurface in their layout. I have two problems with this.
When swiping the ViewPager the SciChartSurface shows a black bar on its side (see attached image).
When swiping I cannot achieve 60 fps on my device. Upon inspecting systrace I see scheduling delay for each frame. Upon inspecting Android profiler’s flame chart I see that SurfaceView calls android.os.BinderProxy.transact() which takes most of the time. If I change the layout of the Fragments used in ViewPager to a normal View, then android.os.MessageQueue.nativePollOnce() takes about 80% of the time, which means most of the time the CPU is idling because drawing takes up so little time.
My question is how can I solve both problems. Have I configured the SciChartSurface wrongly to get the black bars. Can I do anything to speed up changing tabs in ViewPager with SciChartSurfaces in the Fragments?
I have attached a sample project to reproduce the problem.
Can you try to switch to alternative implementation of IRenderSurface which is used to render chart? I believe this issue could be caused by our default RenderSurface implementation. It is based on GlSurfaceView and there is some delay caused by OpenGL initialization when you attach it to View hierarchy so there could be some delay when switching between Fragments. Please try to switch to Canvas based RenderSurface ( it’s a bit slower than OpenGL based RenderSurface but in most cases drawing performance should be OK ):
Hope this will help you! If it doesn’t help then please can you attach a project which reproduces this issue so I can take a look on it?
Please login first to submit.