Skip to content

Commit

Permalink
fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
XuQK committed Dec 11, 2020
1 parent 1dfa29a commit c004491
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Feb 25 13:40:29 CST 2020
#Fri Dec 11 17:30:32 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,13 @@ class KDTabLayout @JvmOverloads constructor(
}

fun init() {
removeAllViews()
contentAdapter?.let { adapter ->
if (adapter.getTabCount() <= 0) {
throw IllegalArgumentException("数量必须大于0")
indicator = null
return@let
}
removeAllViews()

if (currentItem > adapter.getTabCount() - 1) {
currentItem = adapter.getTabCount() - 1
}
Expand Down

0 comments on commit c004491

Please sign in to comment.