pull/32/head
Invinciblelee 6 years ago
parent 09587ab92d
commit d5266cb50e
  1. 6
      app/build.gradle
  2. 16
      app/src/main/java/io/legado/app/help/permission/Request.kt
  3. 1
      app/src/main/java/io/legado/app/ui/search/SearchActivity.kt

@ -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"

@ -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<String>? = null
@ -28,22 +27,17 @@ internal class Request : OnRequestPermissionsResultCallback {
private val deniedPermissions: Array<String>?
get() {
val permissions: Array<String>?
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() {

@ -17,7 +17,6 @@ class SearchActivity : BaseActivity<SearchDataBinding, SearchViewModel>() {
override fun onViewModelCreated(viewModel: SearchViewModel, savedInstanceState: Bundle?) {
startActivity<SearchActivity>()
}
}

Loading…
Cancel
Save