feat: 优化代码

pull/103/head
kunfei 5 years ago
parent 598022661b
commit e478e11f22
  1. 2
      app/src/main/java/io/legado/app/help/permission/OnPermissionsDeniedCallback.kt
  2. 2
      app/src/main/java/io/legado/app/help/permission/Request.kt
  3. 3
      app/src/main/java/io/legado/app/ui/about/AboutFragment.kt

@ -1,5 +1,7 @@
package io.legado.app.help.permission package io.legado.app.help.permission
interface OnPermissionsDeniedCallback { interface OnPermissionsDeniedCallback {
fun onPermissionsDenied(requestCode: Int, deniedPermissions: Array<String>) fun onPermissionsDenied(requestCode: Int, deniedPermissions: Array<String>)
} }

@ -43,7 +43,7 @@ internal class Request : OnRequestPermissionsResultCallback {
} }
fun addPermissions(vararg permissions: String) { fun addPermissions(vararg permissions: String) {
this.permissions?.addAll(Arrays.asList(*permissions)) this.permissions?.addAll(listOf(*permissions))
} }
fun setRequestCode(requestCode: Int) { fun setRequestCode(requestCode: Int) {

@ -97,7 +97,8 @@ class AboutFragment : PreferenceFragmentCompat() {
val intent = Intent() val intent = Intent()
intent.data = intent.data =
Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D$key") Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D$key")
// 此Flag可根据具体产品需要自定义,如设置,则在加群界面按返回,返回手Q主界面,不设置,按返回会返回到呼起产品界面 //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) // 此Flag可根据具体产品需要自定义,如设置,则在加群界面按返回,返回手Q主界面,不设置,按返回会返回到呼起产品界面
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
return try { return try {
startActivity(intent) startActivity(intent)
false false

Loading…
Cancel
Save