korre / android-tv-epg

Classic TV electronic program guide (EPG) with multidirectional scroll
MIT License
160 stars 75 forks source link

Laggy experience #8

Closed JJSarrasin closed 6 years ago

JJSarrasin commented 7 years ago

I'm trying to implement your android-tv-epg in my app and I have some problems with the touchlistener that seems to be laggy when too much content is draw in the window. Your sample works fine because you have only big show (1-2hours) and few channels, but when you have 11 channel with a total of 120 shows to draw, it becomes laggy to fling.

Are you aware of this issue ? Do you have any idea how to fix it ?

korre commented 7 years ago

You'll have to implement some lazy loading of the programs then. Try to just load sufficient data to fill the viewport and som extra. Then use a listener to know when you're close to the end while scrolling and add more.

JJSarrasin commented 7 years ago

Thanks for your answer,

I'm already doing lazy loading. I only load 1 hour more on the left and 1 hour more on the right. The loading web request is not a problem. The problem occurs in the onDraw. I optimize everything I could by analyzing the traceview tool, but my views are more complex than your sample (2 lines text/show, up to 12 channel on screen and more show per channel).

It seems to work very well on a Samsung Galaxy S8, but not that good on Google Pixel XL. The laggyness seems to appear when there is a lot of small shows displayed.. Maybe it's related to how many pixels have to be drawn on screen ?

aatalyk commented 5 years ago

@JJSarrasin Could you share your code on lazy loading?