Вопрос

I need help!!!

There a lot of code. I try to describe the concept.

  1. I have Activity which have ViewPager
  2. ViewPager display Fragments each of them have Loader for data retrieving.
  3. I display data on fragment if onFinishLoader receive data. Rendering data in the Fragment I make in the onFinishLoader method.

My case: I make page flipping very fast. The data loads in the fragment and start rendering while flipping animation in action. This thing make ViewPager stopping between fragments. Below you can see my graphics.

enter image description here

Please help me to kill this issue!!!

Many thanks, Igor

Это было полезно?

Решение

Set an setOnPageChangeListener on your ViewPager. In onPageScrollStateChanged, if the state is anything other than SCROLL_STATE_IDLE, the pages are moving. In this case, notify your fragments not to draw the content as it arrives. Store the data in the fragment and trigger it to draw once SCROLL_STATE_IDLE is true.

Другие советы

Make sure you have the DEFAULT intent filter set to the activity that renders the fragments in the manifest. If that does not help, check out what thread priority is and how to set it for your activity, set it to maximum. If all the loading happens before you render the view, and if this this does not help, you will have to post some code, other vise all answers are gonna be gibberish.

P.S Something that might help: flip library

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top