Example usage for android.support.v4.view SlidingTabLayout setBackgroundColor

List of usage examples for android.support.v4.view SlidingTabLayout setBackgroundColor

Introduction

In this page you can find the example usage for android.support.v4.view SlidingTabLayout setBackgroundColor.

Prototype

@RemotableViewMethod
public void setBackgroundColor(@ColorInt int color) 

Source Link

Document

Sets the background color for this view.

Usage

From source file:nl.atcomputing.refcard.tabs.SlidingTabFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    ViewPager viewPager = (ViewPager) view.findViewById(R.id.viewpager);
    viewPager.setAdapter(new MyPagerAdapter(getFragmentManager()));

    SlidingTabLayout slidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs);
    slidingTabLayout.setSelectedIndicatorColors(getResources().getColor(R.color.atbluedark));
    slidingTabLayout.setDividerColors(getResources().getColor(R.color.atbluedark));
    slidingTabLayout.setBackgroundColor(getResources().getColor(R.color.atbluelight));
    //Does not work in landscape mode
    //      mSlidingTabLayout.setCustomTabView(R.layout.slidingtab_tabview, R.id.textview);

    slidingTabLayout.setViewPager(viewPager);
}