From c7e0fb5e6a6ef745f171e2b29c4a6e488d1652ae Mon Sep 17 00:00:00 2001 From: Iiro Krankka Date: Sat, 25 Mar 2017 20:04:41 +0200 Subject: [PATCH] Update README.md --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 457ca9fe..5f31bf35 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ bottomBar.setTabSelectionInterceptor(new TabSelectionInterceptor() { public boolean shouldInterceptTabSelection(@IdRes int oldTabId, @IdRes int newTabId) { if (newTabId == R.id.tab_pro_feature && !userHasProVersion()) { startProVersionPurchaseFlow(); - return true + return true; } return false; @@ -161,6 +161,31 @@ bottomBar.setTabSelectionInterceptor(new TabSelectionInterceptor() { }); ``` +### Changing icons based on selection state + +If you want to have different icon when a specific tab is selected, just use state list drawables. + +**res/drawable/my_tab_icon.xml** + +```xml + + + + +``` + +**res/xml/bottombar_tabs.xml** + +```xml +... + + +... +``` + ### Those color changing tabs look dope. Howdoidodat? Just add ```barColorWhenSelected``` to each tab. When that tab is selected, the whole BottomBar background color is changed with a nice animation.