public void setListCategSelection(List<Categorie> listCategorieSelected) { adapterViewPager = new SamplePagerAdapter(); adapterViewPager.setSlidingTabLayout(mSlidingTabLayout); adapterViewPager.setData(mapCategCompt, mapCompRen); adapterViewPager.setCategorie(listCategorieSelected); mViewPager.setAdapter(adapterViewPager); mSlidingTabLayout.setViewPager(mViewPager); }
public void setData( List<Categorie> listCateg, Map<Categorie, List<Competition>> mapCategCompt, Map<Competition, List<Rencontre>> mapCompRen) { this.listCategorie = listCateg; this.mapCategCompt = mapCategCompt; this.mapCompRen = mapCompRen; adapterViewPager = new SamplePagerAdapter(); adapterViewPager.setData(mapCategCompt, mapCompRen); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs); adapterViewPager.setSlidingTabLayout(mSlidingTabLayout); mViewPager = (ViewPager) view.findViewById(R.id.viewPager); mViewPager.setAdapter(adapterViewPager); mSlidingTabLayout.setViewPager(mViewPager); MultipleSelectionSpinner spinner = (MultipleSelectionSpinner) getActivity().findViewById(R.id.spinnerCateg); spinner.setVisibility(View.VISIBLE); spinner.setLayoutParams( new Toolbar.LayoutParams( Toolbar.LayoutParams.WRAP_CONTENT, Toolbar.LayoutParams.MATCH_PARENT, Gravity.TOP | Gravity.RIGHT)); spinner.setItems(listCategorie); spinner.setTabsFragment(this); }