Java Code Examples for android.support.v4.view.PagerTabStrip#setBackgroundColor()
The following examples show how to use
android.support.v4.view.PagerTabStrip#setBackgroundColor() .
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: 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); }