MiCode / FileExplorer

MIUI文件管理器社区开源版(Community edition of MIUI File Explorer)
http://micode.net/forum-51-1.html
1.6k stars 763 forks source link

从远程管理页面切换出来会有卡顿 #13

Closed Noisyfox closed 12 years ago

Noisyfox commented 12 years ago

rt,不知道是哪里的代码,做了什么事情也不知道(貌似是刷新分类?),相关的代码不是很明白,求指点

haonan commented 12 years ago

这个已经修复了。我明天提交代码,你看下。

lishunli commented 12 years ago

确实是有这样的问题,希望尽快 commit code

haonan commented 12 years ago

已经提交代码了,请验证效果是否理想。tab切换,避免重新createView而出现的卡顿

Noisyfox commented 12 years ago

确实不卡了,不过为什么参数是2?

Noisyfox commented 12 years ago

难道说第三个page的编号是2?

haonan commented 12 years ago

你看一下修改的summary。默认的值为1, 所以在tab切换的时候,会有recreate,会有数据加载,导致卡。现在设为2,就全部在内存里。 ViewPager.java类中的setOffscreenPageLimit函数的注释: If you have a small number of pages (3-4) that you can keep active all at once, less time will be spent in layout for newly created view subtrees as the user pages back and forth.

haonan commented 12 years ago

你看一下修改的summary。默认的值为1, 所以在tab切换的时候,会有recreate,会有数据加载,导致卡。现在设为2,就全部在内存里。 ViewPager.java类中的setOffscreenPageLimit函数的注释: If you have a small number of pages (3-4) that you can keep active all at once, less time will be spent in layout for newly created view subtrees as the user pages back and forth.

Noisyfox commented 12 years ago

查了下ViewPage预加载的资料明白了