From 770cf1a6aca55973c0f2f4a549e7fbcd69aa6dad Mon Sep 17 00:00:00 2001 From: Chris Banes Date: Wed, 30 Nov 2016 01:19:07 +0000 Subject: [PATCH] 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 --- api/current.txt | 2 ++ .../support/design/widget/TabLayout.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/api/current.txt b/api/current.txt index 0ccb12051..fdc796877 100644 --- a/api/current.txt +++ b/api/current.txt @@ -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); diff --git a/src/android/support/design/widget/TabLayout.java b/src/android/support/design/widget/TabLayout.java index 60b641049..999dc007f 100755 --- a/src/android/support/design/widget/TabLayout.java +++ b/src/android/support/design/widget/TabLayout.java @@ -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}.