Skip to content

Commit

Permalink
remove Application label in manifest
Browse files Browse the repository at this point in the history
add method to make viewpager snap on tab click
  • Loading branch information
H07000223 committed Oct 28, 2016
1 parent 7f85f6d commit 55894ea
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHNAGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


4 changes: 2 additions & 2 deletions FlycoTabLayout_Lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 1 addition & 9 deletions FlycoTabLayout_Lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public class SlidingTabLayout extends HorizontalScrollView implements ViewPager.

private int mLastScrollX;
private int mHeight;
private boolean mSnapOnTabClick;

public SlidingTabLayout(Context context) {
this(context, null, 0);
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -644,6 +649,10 @@ public void setTextAllCaps(boolean textAllCaps) {
updateTabStyles();
}

public void setSnapOnTabClick(boolean snapOnTabClick) {
mSnapOnTabClick = snapOnTabClick;
}


public int getTabCount() {
return mTabCount;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 55894ea

Please sign in to comment.