diff --git a/README.md b/README.md index 646af09..cd48861 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ dependencies { Or Gradle Maven Central: ```groovy -compile 'com.github.devlight.navigationtabbar:navigationtabbar:1.2.3' +compile 'com.github.devlight.navigationtabbar:navigationtabbar:1.2.5' ``` Or Maven: @@ -48,7 +48,7 @@ Or Maven: com.github.devlight.navigationtabbar navigationtabbar - 1.2.3 + 1.2.5 aar ``` diff --git a/app/src/main/java/com/gigamole/sample/HorizontalCoordinatorNtbActivity.java b/app/src/main/java/com/gigamole/sample/HorizontalCoordinatorNtbActivity.java index e30618c..dd313ae 100644 --- a/app/src/main/java/com/gigamole/sample/HorizontalCoordinatorNtbActivity.java +++ b/app/src/main/java/com/gigamole/sample/HorizontalCoordinatorNtbActivity.java @@ -117,7 +117,6 @@ public Object instantiateItem(final ViewGroup container, final int position) { navigationTabBar.setOnTabBarSelectedIndexListener(new NavigationTabBar.OnTabBarSelectedIndexListener() { @Override public void onStartTabSelected(final NavigationTabBar.Model model, final int index) { - } @Override diff --git a/navigationtabbar/build.gradle b/navigationtabbar/build.gradle index d28d0f2..0b788cc 100644 --- a/navigationtabbar/build.gradle +++ b/navigationtabbar/build.gradle @@ -19,7 +19,7 @@ apply plugin: "com.jfrog.bintray" apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'maven' -version = "1.2.4" +version = "1.2.5" android { compileSdkVersion 23 @@ -29,7 +29,7 @@ android { minSdkVersion 11 targetSdkVersion 23 versionCode 1 - versionName "1.2.4" + versionName "1.2.5" } buildTypes { release { diff --git a/navigationtabbar/src/main/java/com/gigamole/navigationtabbar/ntb/NavigationTabBar.java b/navigationtabbar/src/main/java/com/gigamole/navigationtabbar/ntb/NavigationTabBar.java index 42ced03..6bf91fe 100644 --- a/navigationtabbar/src/main/java/com/gigamole/navigationtabbar/ntb/NavigationTabBar.java +++ b/navigationtabbar/src/main/java/com/gigamole/navigationtabbar/ntb/NavigationTabBar.java @@ -848,11 +848,18 @@ public void setModelIndex(final int modelIndex, final boolean isForce) { // You can use force param or call this method in some post() if (force) { updateIndicatorPosition(MAX_FRACTION); + + if (mOnTabBarSelectedIndexListener != null) + mOnTabBarSelectedIndexListener.onStartTabSelected(mModels.get(mIndex), mIndex); + // Force onPageScrolled listener and refresh VP if (mIsViewPagerMode) { if (!mViewPager.isFakeDragging()) mViewPager.beginFakeDrag(); if (mViewPager.isFakeDragging()) mViewPager.fakeDragBy(0.0F); if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag(); + } else { + if (mOnTabBarSelectedIndexListener != null) + mOnTabBarSelectedIndexListener.onEndTabSelected(mModels.get(mIndex), mIndex); } } else mAnimator.start(); }