瀏覽代碼

Fixed lint errors and updated kotlin version

Vadik Sirekanyan 7 年之前
父節點
當前提交
88722bd225
共有 3 個文件被更改,包括 6 次插入5 次删除
  1. 1 1
      app/build.gradle
  2. 4 3
      app/src/main/java/me/vadik/knigopis/profile/ProfileActivity.kt
  3. 1 1
      build.gradle

+ 1 - 1
app/build.gradle

@@ -23,7 +23,7 @@ android {
 
 dependencies {
     // kotlin standard library
-    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
+    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
 
     // support libraries
     implementation "com.android.support:appcompat-v7:27.1.1"

+ 4 - 3
app/src/main/java/me/vadik/knigopis/profile/ProfileActivity.kt

@@ -104,12 +104,13 @@ class ProfileActivity : AppCompatActivity() {
             })
     }
 
+    @Suppress("USELESS_CAST")
     private fun refreshCounters() {
         api.getFinishedBooks(auth.getAccessToken())
             .io2main()
             .subscribe({ finishedBooks ->
                 doneList.clearAndAddAll(finishedBooks)
-                profileDoneCount.text = getString(R.string.profile_caption_done, doneList.size)
+                profileDoneCount.text = getString(R.string.profile_caption_done, doneList.size as Int)
             }, {
                 logError("cannot check finished books count", it)
             })
@@ -117,9 +118,9 @@ class ProfileActivity : AppCompatActivity() {
             .io2main()
             .subscribe({ plannedBooks ->
                 doingList.clearAndAddAll(plannedBooks.filter { it.priority > 0 })
-                profileDoingCount.text = getString(R.string.profile_caption_doing, doingList.size)
+                profileDoingCount.text = getString(R.string.profile_caption_doing, doingList.size as Int)
                 todoList.clearAndAddAll(plannedBooks.filter { it.priority == 0 })
-                profileTodoCount.text = getString(R.string.profile_caption_todo, todoList.size)
+                profileTodoCount.text = getString(R.string.profile_caption_todo, todoList.size as Int)
             }, {
                 logError("cannot check planned books count", it)
             })

+ 1 - 1
build.gradle

@@ -1,6 +1,6 @@
 buildscript {
     ext {
-        kotlin_version = '1.2.40'
+        kotlin_version = '1.2.41'
     }
     repositories {
         jcenter()