use of android.support.v13.app.FragmentPagerAdapter in project ride-read-android by Ride-Read.
the class LoginActivity method initViewPager.
private void initViewPager() {
mFragments = new ArrayList<>(2);
mFragments.add(new LoginFragment());
mFragments.add(new RegisterFragment());
FragmentPagerAdapter fpa = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
public Fragment getItem(int position) {
return mFragments.get(position);
}
@Override
public int getCount() {
return mFragments.size();
}
};
mViewpagerTabView.setAdapter(fpa);
}
use of android.support.v13.app.FragmentPagerAdapter in project RxBus by ViTess.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.main_bt).setOnClickListener(this);
findViewById(R.id.main_bt_void).setOnClickListener(this);
findViewById(R.id.main_bt_tag1).setOnClickListener(this);
findViewById(R.id.main_bt_tag2).setOnClickListener(this);
findViewById(R.id.main_bt_tag3).setOnClickListener(this);
vp = (ViewPager) findViewById(R.id.main_vp);
arrayList.add(f1);
arrayList.add(f2);
adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
public Fragment getItem(int position) {
return arrayList.get(position);
}
@Override
public int getCount() {
return arrayList.size();
}
};
vp.setAdapter(adapter);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fl, f3);
transaction.commit();
RxBus.register(this);
}
use of android.support.v13.app.FragmentPagerAdapter in project ViewPagerIndicator by JakeWharton.
the class SampleTabsDefault method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_tabs);
FragmentPagerAdapter adapter = new GoogleMusicAdapter(getSupportFragmentManager());
ViewPager pager = (ViewPager) findViewById(R.id.pager);
pager.setAdapter(adapter);
TabPageIndicator indicator = (TabPageIndicator) findViewById(R.id.indicator);
indicator.setViewPager(pager);
}
use of android.support.v13.app.FragmentPagerAdapter in project AndroidDevelop by 7449.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewPager = (ViewPager) findViewById(R.id.viewpager);
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.rg_group);
imageView = (ImageView) findViewById(R.id.iv_line);
Display display = getWindow().getWindowManager().getDefaultDisplay();
DisplayMetrics dm = new DisplayMetrics();
display.getMetrics(dm);
ivWidth = (dm.widthPixels / 3);
viewPager.addOnPageChangeListener(this);
radioGroup.setOnCheckedChangeListener(this);
viewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
public Fragment getItem(int position) {
return ViewPagerFragment.startFragment(position);
}
@Override
public int getCount() {
return 3;
}
});
}
use of android.support.v13.app.FragmentPagerAdapter in project BookReader by JustWayward.
the class SubjectBookListActivity method initDatas.
@Override
public void initDatas() {
mDatas = Arrays.asList(getResources().getStringArray(R.array.subject_tabs));
mTabContents = new ArrayList<>();
mTabContents.add(SubjectFragment.newInstance("", 0));
mTabContents.add(SubjectFragment.newInstance("", 1));
mTabContents.add(SubjectFragment.newInstance("", 2));
mAdapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
public int getCount() {
return mTabContents.size();
}
@Override
public Fragment getItem(int position) {
return mTabContents.get(position);
}
};
}
Aggregations