ticket.40292, ticket.40637: InfiniteViewPager code refactoring and fix f...

InfiniteViewPager : Fix flash issue, code refactoring.