Search in sources :

Example 1 with ReminderFragment

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);
}
Also used : TaskFragment(ve.com.abicelis.remindy.app.fragments.TaskFragment) ReminderFragment(ve.com.abicelis.remindy.app.fragments.ReminderFragment) Bundle(android.os.Bundle) TaskViewPagerAdapter(ve.com.abicelis.remindy.app.adapters.TaskViewPagerAdapter)

Aggregations

Bundle (android.os.Bundle)1 TaskViewPagerAdapter (ve.com.abicelis.remindy.app.adapters.TaskViewPagerAdapter)1 ReminderFragment (ve.com.abicelis.remindy.app.fragments.ReminderFragment)1 TaskFragment (ve.com.abicelis.remindy.app.fragments.TaskFragment)1