android.support.v4.view.PagerTabStrip Java Examples
The following examples show how to use
android.support.v4.view.PagerTabStrip.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ListPagerFragment.java From recyclerViewToTheRescue with MIT License | 6 votes |
@Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_viewpager, container, false); viewPager = (ViewPager)rootView.findViewById(R.id.view_pager); viewPager.setAdapter(new ListPagerAdapter(getChildFragmentManager())); tabStrip = (PagerTabStrip)rootView.findViewById(R.id.tab_strip); tabStrip.setBackgroundColor(getResources().getColor(R.color.toolbar_background)); tabStrip.setTextColor(getResources().getColor(R.color.dark_text)); tabStrip.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.textSizeTC3)); tabStrip.setTabIndicatorColor(getResources().getColor(R.color.rdio_blue)); return rootView; }
Example #2
Source File: ClassicGameActivity.java From tedroid with Apache License 2.0 | 6 votes |
/** Inicializa la fuente y la coloca en cada textview */ private void setUpFont() { Typeface typeface = Typefaces.get(this, Typefaces.Font.TWOBIT); scoreTextTextView.setTypeface(typeface); linesTextTextView.setTypeface(typeface); nextTetrominoTextTextView.setTypeface(typeface); gameOverTextView.setTypeface(typeface); scoreTextView.setTypeface(typeface); levelTextView.setTypeface(typeface); linesTextView.setTypeface(typeface); PagerTabStrip strip = (PagerTabStrip) viewPager.findViewById(R.id.pager_tab_strip); for (int i = 0; i < strip.getChildCount(); i++) { View nextChild = strip.getChildAt(i); if (nextChild instanceof TextView) { TextView textViewToConvert = (TextView) nextChild; textViewToConvert.setTypeface(typeface); } } }
Example #3
Source File: SpecialGameActivity.java From tedroid with Apache License 2.0 | 6 votes |
/** Inicializa la fuente y la coloca en cada textview */ private void setUpFont() { Typeface typeface = Typefaces.get(this, Typefaces.Font.TWOBIT); scoreTextTextView.setTypeface(typeface); linesTextTextView.setTypeface(typeface); nextTetrominoTextTextView.setTypeface(typeface); gameOverTextView.setTypeface(typeface); scoreTextView.setTypeface(typeface); levelTextView.setTypeface(typeface); linesTextView.setTypeface(typeface); PagerTabStrip strip = (PagerTabStrip) viewPager.findViewById(R.id.pager_tab_strip); for (int i = 0; i < strip.getChildCount(); i++) { View nextChild = strip.getChildAt(i); if (nextChild instanceof TextView) { TextView textViewToConvert = (TextView) nextChild; textViewToConvert.setTypeface(typeface); } } }
Example #4
Source File: ScheduleActivity.java From utexas-utilities with Apache License 2.0 | 6 votes |
private void initialisePaging() { List<PageDescriptor> pages = new ArrayList<>(); pages.add(new SimplePageDescriptor("Exam Schedule", "Exam Schedule")); pages.add(new CourseSchedulePageDescriptor(true, "Current Schedule", DEFAULT_COURSE_SCHEDULE_URL)); mPagerAdapter = new SchedulePagerAdapter(getSupportFragmentManager(), pages, this); pager.setPageMargin(2); pager.setOffscreenPageLimit(2); pager.setAdapter(mPagerAdapter); pager.addOnPageChangeListener(this); pager.setCurrentItem(1, false); // titleIndicator.setOnPageChangeListener(this); // ((PagerTabStrip) findViewById(R.id.titles)).no PagerTabStrip titleIndicator = (PagerTabStrip) findViewById(R.id.tabs); ViewCompat.setElevation(titleIndicator, getResources().getDimensionPixelSize(R.dimen.actionbar_elevation)); }
Example #5
Source File: MainActivity.java From ksyhttpcache_android with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); titlelist = new ArrayList<String>(); fraglist = new ArrayList<Fragment>(); urlFragment = new URLFragment(); cacheFragment = new CacheFragment(); settingFragment = new SettingFragment(); cachingFragment = new CachingFragment(); fraglist.add(cacheFragment); fraglist.add(cachingFragment); fraglist.add(urlFragment); fraglist.add(settingFragment); pager_tab = (PagerTabStrip)findViewById(R.id.pager_tab); pager_tab.setTabIndicatorColor(getResources().getColor(R.color.colorAccent)); pager_tab.setDrawFullUnderline(false); pager_tab.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); pager_tab.setTextSpacing(50); titlelist.add("已完成"); titlelist.add("未完成"); titlelist.add("播放"); titlelist.add("设置"); viewPager = (ViewPager)findViewById(R.id.my_viewpager); verifyStoragePermissions(this); }
Example #6
Source File: RFABGroupSampleActivity.java From RapidFloatingActionButton with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.rfab_group_sample); pts = (PagerTabStrip) findViewById(R.id.rfab_group_sample_pts); pager = (ViewPager) findViewById(R.id.rfab_group_sample_vp); rfabGroup = (RapidFloatingActionButtonGroup) findViewById(R.id.rfab_group_sample_rfabg); rfabGroup.setOnRapidFloatingButtonGroupListener(this); pts.setTabIndicatorColor(Color.RED); pts.setTextColor(0xff3f51b5); fragments.add(new FragmentA()); fragments.add(new FragmentB()); fragments.add(new FragmentC()); pager.setAdapter(new MyPageAdapter(getSupportFragmentManager())); pager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { super.onPageSelected(position); rfabGroup.setSection(position); } }); pager.setOffscreenPageLimit(3); }
Example #7
Source File: ListsFragment.java From twitt4droid with Apache License 2.0 | 5 votes |
private void setUpLayout(View layout) { viewPager = (ViewPager) layout.findViewById(R.id.view_pager); pagerStrip = (PagerTabStrip) layout.findViewById(R.id.pager_strip); adapter = new SwipeTimelineFragmentPagerAdapter(); viewPager.setAdapter(adapter); pagerStrip.setDrawFullUnderline(false); pagerStrip.setTabIndicatorColor(getResources().getColor(R.color.twitt4droid_primary_color)); }
Example #8
Source File: AppOpsSummary.java From AppOpsXposed with GNU General Public License v3.0 | 5 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // initialize the inflater mInflater = inflater; View rootView = mInflater.inflate(R.layout.app_ops_summary, container, false); mContentContainer = container; mRootView = rootView; mPageNames = getResources().getTextArray(R.array.app_ops_categories); mViewPager = (ViewPager) rootView.findViewById(R.id.pager); MyPagerAdapter adapter = new MyPagerAdapter(getChildFragmentManager()); mViewPager.setAdapter(adapter); mViewPager.setOnPageChangeListener(adapter); PagerTabStrip tabs = (PagerTabStrip) rootView.findViewById(R.id.tabs); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { tabs.setTabIndicatorColorResource(android.R.color.holo_blue_light); } else { final TypedValue val = new TypedValue(); getActivity().getTheme().resolveAttribute(android.R.attr.colorAccent, val, true); tabs.setTabIndicatorColor(val.data); } // We have to do this now because PreferenceFrameLayout looks at it // only when the view is added. if (container != null && "android.preference.PreferenceFrameLayout".equals(container.getClass().getName())) { new ObjectWrapper(rootView.getLayoutParams()).set("removeBorders", true); } return rootView; }
Example #9
Source File: SupportCoreUiDSL.java From anvil with MIT License | 4 votes |
public static BaseDSL.ViewClassResult pagerTabStrip() { return BaseDSL.v(PagerTabStrip.class); }
Example #10
Source File: SupportCoreUiDSL.java From anvil with MIT License | 4 votes |
public static Void pagerTabStrip(Anvil.Renderable r) { return BaseDSL.v(PagerTabStrip.class, r); }