am 77eac344: am edad3de0: am c179c5f7: am 613dfb42: Merge "Allow setting the Tab Indicator at runtime" into lmp-mr1-ub-dev

* commit '77eac344dced786faba1b19aabfafca9ea9db9e6':
  Allow setting the Tab Indicator at runtime

GitOrigin-RevId=bc34aa60b5ae4782f40012c1c94b7fad826afb68

PiperOrigin-RevId: 140548740
This commit is contained in:
Chris Banes 2016-11-30 01:19:07 +00:00 committed by Travis Collins
parent ac22c60804
commit 770cf1a6ac
2 changed files with 20 additions and 0 deletions

View File

@ -275,6 +275,8 @@ package android.support.design.widget {
method public void removeTabAt(int);
method public void setOnTabSelectedListener(android.support.design.widget.TabLayout.OnTabSelectedListener);
method public void setScrollPosition(int, float, boolean);
method public void setSelectedTabIndicatorColor(int);
method public void setSelectedTabIndicatorHeight(int);
method public void setTabGravity(int);
method public void setTabMode(int);
method public void setTabTextColors(android.content.res.ColorStateList);

View File

@ -278,6 +278,24 @@ public class TabLayout extends HorizontalScrollView {
applyModeAndGravity();
}
/**
* Sets the tab indicator's color for the currently selected tab.
*
* @param color color to use for the indicator
*/
public void setSelectedTabIndicatorColor(@ColorInt int color) {
mTabStrip.setSelectedIndicatorColor(color);
}
/**
* Sets the tab indicator's height for the currently selected tab.
*
* @param height height to use for the indicator in pixels
*/
public void setSelectedTabIndicatorHeight(int height) {
mTabStrip.setSelectedIndicatorHeight(height);
}
/**
* Set the scroll position of the tabs. This is useful for when the tabs are being displayed as
* part of a scrolling container such as {@link android.support.v4.view.ViewPager}.