I have created an Android app that allows people to select products and to then purchase them. My Product Selection screen uses a ViewPager to allow swiping the screen to display different groups of products. The ViewPager area uses a GridView to display the items.
Some of the items have a large name and therefore is not fully shown so I have added a Marquee feature to the text so that the name of the item scrolls which allows the name to be read fully. In general this feature works fine and the text scrolls as expected.
My issue occurs when swiping the screen; pages 1 & 2 work correctly and the text scrolls as expected but when swiping to other pages the text does not scroll. If a page contains lots of items, I can scroll the page up/down which then seems to trigger some sort of refresh on the GridView and the text then begins to scroll correctly.
I'm unsure why the marquee works for the 1st 2 pages and not the others (unless I scroll up/down to get the grid to refresh); the only thing that I can see is that my Fragments onCreateView() method is called twice upon initialization which seems to load the 1st 2 pages into memory. I've done a search on the Internet and this seems to be a normal process so is unlikely to be my issue.
I was wondering if there was a way to load all pages into memory (instead of just the 1st 2) or a way to force the GridView to refresh upon loading?
Any other suggestions would be great and I will give them a try.
Thanks...