content: package com.alexlionne.apps.avatars.fragments;
  
  import android.os.Bundle;
  import android.support.design.widget.TabLayout;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentPagerAdapter;
  import android.support.v4.view.ViewPager;
  import android.support.v7.widget.Toolbar;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.alexlionne.apps.avatars.R;
  import com.roughike.bottombar.BottomBar;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Created by Alex on 08/03/2016.
   */
  public class KitFragment extends Fragment {
      private ViewGroup root;
      private BottomBar mBottomBar;
      private Toolbar toolbar;
      private TabLayout tabLayout;
      private ViewPager viewPager;
      private int[] tabIcons = {
              R.drawable.ic_trending_up_black_24dp,
              R.drawable.ic_favorite_black_24dp
      };
      public KitFragment() {
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.kit_layout, container, false);
  
          toolbar = (Toolbar) view.findViewById(R.id.toolbar);
  
          viewPager = (ViewPager) view.findViewById(R.id.viewpager);
          setupViewPager(viewPager);
  
          tabLayout = (TabLayout) view.findViewById(R.id.tabs);
          tabLayout.setupWithViewPager(viewPager);
          setupTabIcons();
          return view;
      }
  
      /***Set up the Icons for Tabs
       */
      private void setupTabIcons() {
          tabLayout.getTabAt(0).setIcon(tabIcons[0]);
          tabLayout.getTabAt(1).setIcon(tabIcons[1]);
  
      }
      private void setupViewPager(ViewPager viewPager) {
          ViewPagerAdapter adapter = new ViewPagerAdapter(getChildFragmentManager());
          adapter.addFragment(new LatestKitFragment(), null);
          adapter.addFragment(new MyAvatarsFragment(), null);
  
          viewPager.setAdapter(adapter);
      }
  
      class ViewPagerAdapter extends FragmentPagerAdapter {
          private final List<Fragment> mFragmentList = new ArrayList<>();
          private final List<String> mFragmentTitleList = new ArrayList<>();
  
          public ViewPagerAdapter(FragmentManager manager) {
              super(manager);
          }
  
          @Override
          public Fragment getItem(int position) {
              return mFragmentList.get(position);
          }
  
          @Override
          public int getCount() {
              return mFragmentList.size();
          }
  
          public void addFragment(Fragment fragment, String title) {
              mFragmentList.add(fragment);
              mFragmentTitleList.add(title);
          }
  
          @Override
          public CharSequence getPageTitle(int position) {
              return mFragmentTitleList.get(position);
          }
      }
  
  
  
  
  }