diff --git a/app/build.gradle b/app/build.gradle index 28cd0d7..86a38fa 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,11 +5,11 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { applicationId "com.lxj.demo1" minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 31 versionCode 1 versionName "1.0" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 80bf7b5..b4d3012 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,7 +9,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + @@ -17,7 +18,8 @@ - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index d1f0ee3..d8a08b8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.5.0' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.android.tools.build:gradle:4.2.0' 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 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 758de96..f6b961f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0ebb310..bff4ad5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Wed Dec 18 19:13:30 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip diff --git a/statelayout-library/build.gradle b/statelayout-library/build.gradle index a7a2485..5c0223a 100644 --- a/statelayout-library/build.gradle +++ b/statelayout-library/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 28 + compileSdkVersion 31 defaultConfig { minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 31 versionCode 1 versionName "1.0" } @@ -24,13 +24,3 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.1' } - -//publish { -// userOrg = 'li-xiaojun' -// groupId = 'com.lxj' -// artifactId = 'statelayout' -// publishVersion = '1.2.2' -// repoName = 'jrepo' -// desc = 'Simple way to change your layout state, like loading, _statelayout_empty, _statelayout_error. Strong customizitaion, written by Kotlin!' -// website = 'https://github.com/li-xiaojun/StateLayout' -//} \ No newline at end of file diff --git a/statelayout-library/src/main/java/com/lxj/statelayout/StateLayout.kt b/statelayout-library/src/main/java/com/lxj/statelayout/StateLayout.kt index 5c4f7d5..ba9fc8c 100644 --- a/statelayout-library/src/main/java/com/lxj/statelayout/StateLayout.kt +++ b/statelayout-library/src/main/java/com/lxj/statelayout/StateLayout.kt @@ -171,10 +171,10 @@ class StateLayout @JvmOverloads constructor(context: Context, attributeSet: Attr private fun switch(v: View?) { if (switchTask != null) { - mHandler.removeCallbacks(switchTask) + mHandler.removeCallbacks(switchTask!!) } switchTask = SwitchTask(v) - mHandler.post(switchTask) + mHandler.post(switchTask!!) } private fun retry() { diff --git a/statelayout-library/src/main/res/layout/_loading_layout_empty.xml b/statelayout-library/src/main/res/layout/_loading_layout_empty.xml index f0214dd..b1aa33d 100644 --- a/statelayout-library/src/main/res/layout/_loading_layout_empty.xml +++ b/statelayout-library/src/main/res/layout/_loading_layout_empty.xml @@ -3,15 +3,14 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingBottom="30dp" android:gravity="center" android:orientation="vertical"> + android:textColor="@color/_statelayout_hint_color" + android:textSize="14sp" + android:text="@string/_statelayout_nodata"/> \ No newline at end of file diff --git a/statelayout-library/src/main/res/layout/_loading_layout_error.xml b/statelayout-library/src/main/res/layout/_loading_layout_error.xml index 19f2369..f245a6b 100644 --- a/statelayout-library/src/main/res/layout/_loading_layout_error.xml +++ b/statelayout-library/src/main/res/layout/_loading_layout_error.xml @@ -18,9 +18,9 @@ android:layout_gravity="center" android:paddingLeft="14dp" android:paddingRight="14dp" - android:textSize="12sp" + android:textSize="14sp" android:layout_marginTop="15dp" - android:text="@string/load_failed_try_again" - android:textColor="#444"/> + android:text="@string/_statelayout_load_failed" + android:textColor="@color/_statelayout_hint_color"/> \ No newline at end of file diff --git a/statelayout-library/src/main/res/values-en/strings.xml b/statelayout-library/src/main/res/values-en/strings.xml index b025638..951c5a2 100644 --- a/statelayout-library/src/main/res/values-en/strings.xml +++ b/statelayout-library/src/main/res/values-en/strings.xml @@ -1,5 +1,5 @@ - Load failed, try again - No Data + Click to retry + No Data \ No newline at end of file diff --git a/statelayout-library/src/main/res/values/colors.xml b/statelayout-library/src/main/res/values/colors.xml new file mode 100644 index 0000000..e56f2de --- /dev/null +++ b/statelayout-library/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #656565 + \ No newline at end of file diff --git a/statelayout-library/src/main/res/values/strings.xml b/statelayout-library/src/main/res/values/strings.xml index 40703b3..deb3c16 100644 --- a/statelayout-library/src/main/res/values/strings.xml +++ b/statelayout-library/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - 加载失败,点击重试 - 暂无数据 + 点击重试 + 暂无数据 \ No newline at end of file