Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PagerAdapter start position

I'm using the following example to impliment my viewPager: http://code.google.com/p/viewpagerexample/issues/list

The problem with this example is that I can't figure out how to set my starting position, the default starting position is 0. Basically I wan't to be able to control if there is an available view on its left or the right.

Is there any way to control center's View current position? is there a better way to do it? is it possible to make it circular?

like image 612
Kirill Kulakov Avatar asked Aug 09 '12 08:08

Kirill Kulakov


1 Answers

I've found a way to set it's position, which is done outside of the class:

 awesomePager = (ViewPager) findViewById(R.id.awesomepager);  awesomePager.setAdapter(awesomeAdapter);  awesomePager.setCurrentItem(CurrentPosition); 

and it can be limited by calculating the amount of items I want to fit in to it

like image 109
Kirill Kulakov Avatar answered Sep 19 '22 02:09

Kirill Kulakov