use of ve.com.abicelis.remindy.app.fragments.ReminderFragment in project Remindy by abicelis.
the class TaskActivity method setupViewPagerAndTabLayout.
private void setupViewPagerAndTabLayout() {
mTaskFragment = new TaskFragment();
mReminderFragment = new ReminderFragment();
Bundle bundle = new Bundle();
bundle.putSerializable(TaskFragment.TASK_ARGUMENT, mTask);
mTaskFragment.setArguments(bundle);
bundle = new Bundle();
bundle.putSerializable(ReminderFragment.TASK_ARGUMENT, mTask);
mReminderFragment.setArguments(bundle);
//Rebuild lists
mTitleList.clear();
mFragmentList.clear();
mTitleList.add(getResources().getString(R.string.activity_task_fragment_task_tab_title));
mTitleList.add(getResources().getString(R.string.activity_task_fragment_reminder_tab_title));
mFragmentList.add(mTaskFragment);
mFragmentList.add(mReminderFragment);
//Setup adapter, viewpager and tablayout
mTaskViewPagerAdapter = new TaskViewPagerAdapter(getSupportFragmentManager(), mTitleList, mFragmentList);
mViewpager.setAdapter(mTaskViewPagerAdapter);
mTabLayout.setupWithViewPager(mViewpager);
}
Aggregations