Permalink
Browse files

remove Application label in manifest

add method to make viewpager snap on tab click
1 parent 7f85f6d commit 55894ea949caff3f21127f0f813ea18d3fb1277b @H07000223 committed Oct 28, 2016
View
@@ -75,4 +75,9 @@ Version 2.0.8 *(2016.7.26)*
---------------------------
* Fix #27,#31(new added method 'setCurrentTab(int currentTab, boolean smoothScroll)' for SlidingTabLayout and redefine attr 'tl_textBold')
+Version 2.1.0 *(2016.10.28)*
+----------------------------
+* remove Application label in manifest
+* add method to make viewpager snap on tab click
+
@@ -3,15 +3,15 @@ apply plugin: 'com.android.library'
//apply plugin: 'com.jfrog.bintray'
// 这个version是区分library版本的,因此当我们需要更新library时记得修改这个version
-version = "2.0.8"
+version = "2.1.0"
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
- versionCode 208
+ versionCode 210
versionName version
}
buildTypes {
@@ -1,11 +1,3 @@
<manifest
- package="com.flyco.tablayout"
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <application
- android:allowBackup="true"
- android:supportsRtl="true">
-
- </application>
-
+ package="com.flyco.tablayout">
</manifest>
@@ -95,6 +95,7 @@
private int mLastScrollX;
private int mHeight;
+ private boolean mSnapOnTabClick;
public SlidingTabLayout(Context context) {
this(context, null, 0);
@@ -120,7 +121,6 @@ public SlidingTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {
//get layout_height
String height = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "layout_height");
- //create ViewPager
if (height.equals(ViewGroup.LayoutParams.MATCH_PARENT + "")) {
} else if (height.equals(ViewGroup.LayoutParams.WRAP_CONTENT + "")) {
} else {
@@ -262,7 +262,12 @@ public void onClick(View v) {
int position = mTabsContainer.indexOfChild(v);
if (position != -1) {
if (mViewPager.getCurrentItem() != position) {
- mViewPager.setCurrentItem(position);
+ if (mSnapOnTabClick) {
+ mViewPager.setCurrentItem(position, false);
+ } else {
+ mViewPager.setCurrentItem(position);
+ }
+
if (mListener != null) {
mListener.onTabSelect(position);
}
@@ -644,6 +649,10 @@ public void setTextAllCaps(boolean textAllCaps) {
updateTabStyles();
}
+ public void setSnapOnTabClick(boolean snapOnTabClick) {
+ mSnapOnTabClick = snapOnTabClick;
+ }
+
public int getTabCount() {
return mTabCount;
View
@@ -69,7 +69,7 @@ dependencies{
After v2.0.2(support 3.0+)
dependencies{
compile 'com.android.support:support-v4:23.1.1'
- compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.0.8@aar'
+ compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.0@aar'
}
```
View
@@ -67,7 +67,7 @@ dependencies{
After v2.0.2(support 3.0+)
dependencies{
compile 'com.android.support:support-v4:23.1.1'
- compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.0.8@aar'
+ compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.0@aar'
}
```
View
@@ -25,7 +25,7 @@ dependencies {
compile project(':FlycoTabLayout_Lib')
//--->support 3.0+
-// compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.0.8@aar'
+// compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.0@aar'
//--->support 2.2+
// compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.0.0@aar'
// compile 'com.nineoldandroids:library:2.4.0'
View
@@ -6,8 +6,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
-// classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
-// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1'
+// classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
+// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

0 comments on commit 55894ea

Please sign in to comment.