Why does Android Android app scroll so smoothly

Facebook has the smoothest interface on my Android phone, and I wonder how they can do it.

While I'm writing my demo, a ListView with images always seems laggy, while the behavior of this facebook-style game is so amazing.

Can someone tell me if the Facebook application uses the native ListView, but with some improvement, or just rewrites the whole view for better performance?

EDIT: I have already used a caching strategy such as using asynchronous threads, caching ViewHolder as a tag, and storing images in memory for speed, while I still feel laggy. I really want to know how facebook engineers did it, they are really brilliant.

+4
source share
2 answers

Try connecting the device to adb, open DDMS and click the method profiling button, then start scrolling the bundle for a few seconds. Traceview will open, and you will see that it is using the processor all the time.

+3
source

I had never used ListView before, but if I had to guess, maybe they extract the results and then cache them, while you request the results each time and don't cache them.

0
source

Source: https://habr.com/ru/post/1385462/


All Articles