pull/32/head
Invinciblelee 6 years ago
parent d5266cb50e
commit 9a2f299f07
  1. 8
      app/src/main/java/io/legado/app/help/permission/Request.kt
  2. 1
      app/src/main/java/io/legado/app/ui/main/MainViewModel.kt

@ -14,8 +14,8 @@ import java.util.*
internal class Request : OnRequestPermissionsResultCallback { internal class Request : OnRequestPermissionsResultCallback {
val startTime: Long private val requestTime: Long
private var requestCode: Int = 0 private var requestCode: Int = TYPE_REQUEST_PERMISSION
private var source: RequestSource? = null private var source: RequestSource? = null
private var permissions: ArrayList<String>? = null private var permissions: ArrayList<String>? = null
private var grantedCallback: OnPermissionsGrantedCallback? = null private var grantedCallback: OnPermissionsGrantedCallback? = null
@ -31,15 +31,15 @@ internal class Request : OnRequestPermissionsResultCallback {
} }
constructor(activity: AppCompatActivity) { constructor(activity: AppCompatActivity) {
startTime = System.currentTimeMillis()
source = ActivitySource(activity) source = ActivitySource(activity)
permissions = ArrayList() permissions = ArrayList()
requestTime = System.currentTimeMillis()
} }
constructor(fragment: Fragment) { constructor(fragment: Fragment) {
startTime = System.currentTimeMillis()
source = FragmentSource(fragment) source = FragmentSource(fragment)
permissions = ArrayList() permissions = ArrayList()
requestTime = System.currentTimeMillis()
} }
fun addPermissions(vararg permissions: String) { fun addPermissions(vararg permissions: String) {

@ -6,4 +6,5 @@ import androidx.lifecycle.AndroidViewModel
class MainViewModel(application: Application) : AndroidViewModel(application) { class MainViewModel(application: Application) : AndroidViewModel(application) {
} }
Loading…
Cancel
Save