diff --git a/app/build.gradle b/app/build.gradle index f1c81febc..c3d0fa13c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,12 +41,6 @@ kapt { } } -kotlin{ - experimental{ - coroutines "enable" - } -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" diff --git a/app/src/main/java/io/legado/app/help/permission/Request.kt b/app/src/main/java/io/legado/app/help/permission/Request.kt index c5d389fa6..60db12240 100644 --- a/app/src/main/java/io/legado/app/help/permission/Request.kt +++ b/app/src/main/java/io/legado/app/help/permission/Request.kt @@ -14,8 +14,7 @@ import java.util.* internal class Request : OnRequestPermissionsResultCallback { - var startTime: Long = 0 - private set + val startTime: Long private var requestCode: Int = 0 private var source: RequestSource? = null private var permissions: ArrayList? = null @@ -28,22 +27,17 @@ internal class Request : OnRequestPermissionsResultCallback { private val deniedPermissions: Array? get() { - val permissions: Array? - val size = this.permissions?.size ?: 0 - if (size > 0) { - permissions = this.permissions?.toTypedArray() - } else { - permissions = null - } - return getDeniedPermissions(permissions) + return getDeniedPermissions(this.permissions?.toTypedArray()) } constructor(activity: AppCompatActivity) { + startTime = System.currentTimeMillis() source = ActivitySource(activity) permissions = ArrayList() } constructor(fragment: Fragment) { + startTime = System.currentTimeMillis() source = FragmentSource(fragment) permissions = ArrayList() } @@ -101,8 +95,6 @@ internal class Request : OnRequestPermissionsResultCallback { onPermissionsGranted(requestCode) } } - - startTime = System.currentTimeMillis() } fun clear() { diff --git a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt index c58c611a9..95f4c3be9 100644 --- a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt @@ -17,7 +17,6 @@ class SearchActivity : BaseActivity() { override fun onViewModelCreated(viewModel: SearchViewModel, savedInstanceState: Bundle?) { - startActivity() } }