import com.android.indianexpress.pagertabs.AwesomePagerClass;
import com.android.indianexpress.pagertabs.ViewPagerTabs;
public class StoryActivity extends Activity {
private ViewPager awesomePager;
private Context context;
private AwesomePagerClass awesomeAdapter;
private ViewPagerTabs mTabs ;
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.pager);
context = this;
awesomeAdapter = new AwesomePagerClass(context,storyLists);
mTabs =(ViewPagerTabs) findViewById(R.id.tabs);
awesomePager = (ViewPager) findViewById(R.id.awesomepager);
awesomePager.setAdapter(awesomeAdapter);
awesomePager.setCurrentItem(position,true);
});
awesomePager.setOnPageChangeListener(new MyPagerChangeListener());
}
class MyPagerChangeListener extends ViewPager.SimpleOnPageChangeListener {
@Override
public void onPageScrollStateChanged(int arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
// TODO Auto-generated method stub
}
@Override
public void onPageSelected(int position) {
}
}
No comments:
Post a Comment