package cc.wanko.karin.app.adapters;

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

import cc.wanko.karin.app.client.HomeTimelineSource;
import cc.wanko.karin.app.fragments.StatusListFragment;
import cc.wanko.karin.app.fragments.UserListListFragment;

/**
 * Created by eagletmt on 14/05/05.
 */
public class MainPagerAdapter extends FragmentPagerAdapter {
    private FragmentActivity activity;

    public MainPagerAdapter(FragmentActivity activity) {
        super(activity.getSupportFragmentManager());
        this.activity = activity;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                StatusListFragment fragment = new StatusListFragment();
                fragment.setStatusSource(new HomeTimelineSource(activity));
                return fragment;
            case 1:
                return new UserListListFragment();
        }
        throw new IllegalStateException("not reached");
    }

    @Override
    public int getCount() {
        return 2;
    }

    private static final String[] PAGE_TITLES = {
            "Home Timeline",
            "Lists",
    };

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

@@ -225,16 +225,67 @@
 Source;%0A
+import cc.wanko.karin.app.client.UserStatusSource;%0A
 import c
@@ -328,24 +328,24 @@
 stFragment;%0A
-
 import cc.wa
@@ -792,16 +792,18 @@
  case 0:
+ %7B
 %0A       
@@ -976,16 +976,30 @@
 agment;%0A
+            %7D%0A
         
@@ -1053,32 +1053,251 @@
 ListFragment();%0A
+            case 2: %7B%0A                StatusListFragment fragment = new StatusListFragment();%0A                fragment.setStatusSource(new UserStatusSource(activity, -1));%0A                return fragment;%0A            %7D%0A
         %7D%0A      
@@ -1410,17 +1410,17 @@
  return 
-2
+3
 ;%0A    %7D%0A
@@ -1499,16 +1499,16 @@
 eline%22,%0A
-
         
@@ -1520,16 +1520,34 @@
 Lists%22,%0A
+            %22Me%22,%0A
     %7D;%0A%0A

Add my timeline page