package dk.cmol.arduinorgb_controller;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class MenuPagerAdapter extends FragmentPagerAdapter {

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

	@Override
	public Fragment getItem(int position) {
		// getItem is called to instantiate the fragment for the given page.
		// Return a DummySectionFragment (defined as a static inner class
		// below) with the page number as its lone argument.
		Fragment fragment;
		
		switch (position) {
		case 0:
			fragment = new ColorDotsFragment();
			break;
		case 1:
			fragment = new SliderFragment();
			break;
		default:
			fragment = new ColorDotsFragment();
			break;
		}

		return fragment;
	}

	@Override
	public int getCount() {
		// Show 3 total pages.
		return 2; 
	}

	@Override
	public CharSequence getPageTitle(int position) {
		switch (position) {
		case 0:
			return "Dots";
		case 1:
			return "Slider";
		}
		return null;
	}
}
@@ -706,16 +706,71 @@
 %09break;%0A
+%09%09case 2:%0A%09%09%09fragment = new FaderFragment();%0A%09%09%09break;%0A
 %09%09defaul
@@ -772,16 +772,16 @@
 efault:%0A
-
 %09%09%09fragm
@@ -919,17 +919,17 @@
 %09return 
-2
+3
 ; %0A%09%7D%0A%0A%09
@@ -1048,16 +1048,16 @@
 case 1:%0A
-
 %09%09%09retur
@@ -1068,16 +1068,45 @@
 lider%22;%0A
+%09%09case 2:%0A%09%09%09return %22Fader%22;%0A
 %09%09%7D%0A%09%09re

Add fader to the pagerAdapter