imbryk/LoopingViewPager — pull request #15 by marcin-kozinski (2014-10-06 17:27:03+00:00)
Title: Allow empty adapter

Make wrapping adapter empty when the wrapped adapter is empty. Before when the wrapped adapter returned 0 from `getCount()`, signaling that it doesn't want to create any pages, the wrapping adapter returned 2. Because of that view pager could still call `instantiateItem()`. In my case my wrapped adapter wasn't ready at all to run `instantiateItem()` while `getCount()` returned 0 and it crashed. Thanks to this change view pager is blank until I add some data, which exactly what I expect.