Android Open Source - ProjectStudio Tasks Tab Pager Adapter






From Project

Back to project page ProjectStudio.

License

The source code is released under:

Apache License

If you think the Android project ProjectStudio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package adapters;
/*from w  ww.  j  av a2s .  c o m*/
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import days_fragments.FridayTaskFragment;
import days_fragments.MondayTaskFragment;
import days_fragments.SaturdayTaskFragment;
import days_fragments.SundayTaskFragment;
import days_fragments.ThursdayTaskFragment;
import days_fragments.TuesdayTaskFragment;
import days_fragments.WednesdayTaskFragment;

/**
 * Created by desmond on 1/21/14.
 */
public class TasksTabPagerAdapter extends FragmentPagerAdapter {

    //DECLARE THE NUMBER OF PAGES
    final int PAGE_COUNT = 7;
    //CREATE AN ARRAY OF STRINGS TO CONTAIN TITLES OF THE TABS
    private String[] days = {"Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

    public TasksTabPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int index) {
        switch (index) {
            case 0:
                MondayTaskFragment mondayTaskFragment = new MondayTaskFragment();
                return mondayTaskFragment;
            case 1:
                TuesdayTaskFragment tuesdayTaskFragment = new TuesdayTaskFragment();
                return tuesdayTaskFragment;
            case 2:
                WednesdayTaskFragment wednesdayTaskFragment = new WednesdayTaskFragment();

                return wednesdayTaskFragment;
            case 3:
                ThursdayTaskFragment thursdayTaskFragment = new ThursdayTaskFragment();
                return thursdayTaskFragment;
            case 4:
                FridayTaskFragment fridayTaskFragment = new FridayTaskFragment();
                return fridayTaskFragment;
            case 5:
                SaturdayTaskFragment saturdayTaskFragment = new SaturdayTaskFragment();
                return saturdayTaskFragment;
            case 6:
                SundayTaskFragment sundayTaskFragment = new SundayTaskFragment();
                return sundayTaskFragment;
        }
        return null;
    }


    @Override
    public CharSequence getPageTitle(int position) {
        return days[position];
    }

    @Override
    public int getCount() {
        // return the number of tabs
        return PAGE_COUNT;
    }
}




Java Source Code List

DB_Provider.CourseDataSource.java
DB_Provider.DBManager.java
DB_Provider.DB_ABSTRACTS.java
DB_Provider.ProfessorDataSource.java
DB_Provider.TaskDataSource.java
Drawables.DrawableAlignedButton.java
FontPackage.TypefaceSpan.java
adapters.CourseCardAdapter.java
adapters.ExamsPassedCardAdapter.java
adapters.ExamsPendingCardAdapter.java
adapters.Exams_TabsPagerAdapter.java
adapters.HomeCardAdapter.java
adapters.MatesCardAdapter.java
adapters.NavDrawerListAdapter.java
adapters.ProfessorCardAdapter.java
adapters.TaskCardAdapter.java
adapters.TasksTabPagerAdapter.java
com.example.uniutilproject.BuildConfig.java
com.example.uniutilproject.UniUtil_MainActivity.java
days_fragments.FridayTaskFragment.java
days_fragments.MondayTaskFragment.java
days_fragments.SaturdayTaskFragment.java
days_fragments.SundayTaskFragment.java
days_fragments.ThursdayTaskFragment.java
days_fragments.TuesdayTaskFragment.java
days_fragments.WednesdayTaskFragment.java
dialog_fragments.DatePickerDialogFragment.java
dialog_fragments.MatesDialogFragment.java
dialog_fragments.ProfessorsDialogFragment.java
dialog_fragments.TimePickerDialogFragment.java
fragments.AddCourseFragment.java
fragments.AddProfFragment.java
fragments.AddTaskFragment.java
fragments.CoursesFragment.java
fragments.CursorLoaderListFragment.java
fragments.ExamsFragment.java
fragments.ExamsPassedFragment.java
fragments.ExamsPendingFragment.java
fragments.HomeFragment.java
fragments.MatesFragment.java
fragments.ProfessorsFragment.java
fragments.StudyPlanFragment.java
fragments.TasksFragment.java
fragments.UpdateCourseFragment.java
fragments.UpdateProfessorFragment.java
interfaces.NoticeDialogListener.java
interfaces.package-info.java
model.Course.java
model.Days.java
model.MyParcelable.java
model.NavDrawerItem.java
model.Professor.java
model.Task.java