pull/915/head
gedoor 4 years ago
parent 751a886f19
commit da7b2276f2
  1. 2
      app/src/main/AndroidManifest.xml
  2. 2
      app/src/main/java/io/legado/app/lib/permission/ActivitySource.kt
  3. 2
      app/src/main/java/io/legado/app/lib/permission/FragmentSource.kt
  4. 2
      app/src/main/java/io/legado/app/lib/permission/OnPermissionsDeniedCallback.kt
  5. 2
      app/src/main/java/io/legado/app/lib/permission/OnPermissionsGrantedCallback.kt
  6. 2
      app/src/main/java/io/legado/app/lib/permission/OnPermissionsResultCallback.kt
  7. 2
      app/src/main/java/io/legado/app/lib/permission/OnRequestPermissionsResultCallback.kt
  8. 2
      app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt
  9. 2
      app/src/main/java/io/legado/app/lib/permission/Permissions.kt
  10. 14
      app/src/main/java/io/legado/app/lib/permission/PermissionsCompat.kt
  11. 2
      app/src/main/java/io/legado/app/lib/permission/Request.kt
  12. 2
      app/src/main/java/io/legado/app/lib/permission/RequestManager.kt
  13. 2
      app/src/main/java/io/legado/app/lib/permission/RequestPlugins.kt
  14. 2
      app/src/main/java/io/legado/app/lib/permission/RequestSource.kt
  15. 4
      app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditActivity.kt
  16. 4
      app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt
  17. 4
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  18. 4
      app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt
  19. 4
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  20. 4
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  21. 4
      app/src/main/java/io/legado/app/ui/filepicker/FilePicker.kt
  22. 2
      app/src/main/java/io/legado/app/ui/filepicker/FilePickerDialog.kt
  23. 4
      app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt

@ -173,7 +173,7 @@
android:launchMode="singleTask" />
<!-- 授权界面 -->
<activity
android:name=".help.permission.PermissionActivity"
android:name="io.legado.app.lib.permission.PermissionActivity"
android:theme="@style/Activity.Permission" />
<!-- 二维码扫描 -->
<activity

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
import android.content.Context
import android.content.Intent

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
import android.content.Context
import android.content.Intent

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
interface OnPermissionsDeniedCallback {

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
interface OnPermissionsGrantedCallback {

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
interface OnPermissionsResultCallback {

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
import android.content.Intent
import android.net.Uri

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
@Suppress("unused")
object Permissions {

@ -1,9 +1,8 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import java.util.*
@Suppress("unused")
class PermissionsCompat private constructor() {
@ -14,17 +13,6 @@ class PermissionsCompat private constructor() {
RequestManager.pushRequest(request)
}
companion object {
// 检查权限, 如果已经拥有返回 true
fun check(activity: AppCompatActivity, vararg permissions: String): Boolean {
val request = Request(activity)
val pers = ArrayList<String>()
pers.addAll(listOf(*permissions))
val data = request.getDeniedPermissions(pers.toTypedArray())
return data == null
}
}
class Builder {
private val request: Request

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
import android.content.Intent
import android.content.pm.PackageManager

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
import android.os.Handler
import android.os.Looper

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
internal object RequestPlugins {

@ -1,4 +1,4 @@
package io.legado.app.help.permission
package io.legado.app.lib.permission
import android.content.Context
import android.content.Intent

@ -12,8 +12,8 @@ import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.Book
import io.legado.app.databinding.ActivityBookInfoEditBinding
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.ui.book.changecover.ChangeCoverDialog
import io.legado.app.utils.*
import java.io.File

@ -18,8 +18,8 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.data.appDb
import io.legado.app.databinding.ActivityImportBookBinding
import io.legado.app.help.AppConfig
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.lib.theme.backgroundColor
import io.legado.app.ui.filepicker.FilePicker
import io.legado.app.ui.filepicker.FilePickerDialog

@ -17,9 +17,9 @@ import io.legado.app.databinding.DialogEditTextBinding
import io.legado.app.databinding.DialogReadBgTextBinding
import io.legado.app.databinding.ItemBgImageBinding
import io.legado.app.help.ReadBookConfig
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.lib.theme.getPrimaryTextColor
import io.legado.app.lib.theme.getSecondaryTextColor

@ -9,12 +9,12 @@ import io.legado.app.R
import io.legado.app.constant.PreferKey
import io.legado.app.help.AppConfig
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.help.storage.Backup
import io.legado.app.help.storage.BookWebDav
import io.legado.app.help.storage.ImportOldData
import io.legado.app.help.storage.Restore
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.ui.filepicker.FilePicker
import io.legado.app.utils.getPrefString
import io.legado.app.utils.isContentScheme

@ -20,10 +20,10 @@ import io.legado.app.constant.PreferKey
import io.legado.app.databinding.DialogEditTextBinding
import io.legado.app.help.AppConfig
import io.legado.app.help.BookHelp
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.lib.theme.ATH
import io.legado.app.receiver.SharedReceiverActivity
import io.legado.app.service.WebService

@ -22,10 +22,10 @@ import io.legado.app.databinding.DialogEditTextBinding
import io.legado.app.help.AppConfig
import io.legado.app.help.LauncherIconHelp
import io.legado.app.help.ThemeConfig
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.widget.number.NumberPickerDialog
import io.legado.app.ui.widget.prefs.ColorPreference

@ -5,9 +5,9 @@ import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import io.legado.app.R
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
@Suppress("unused")
object FilePicker {

@ -16,7 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import io.legado.app.R
import io.legado.app.databinding.DialogFileChooserBinding
import io.legado.app.help.permission.Permissions
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.theme.primaryColor
import io.legado.app.ui.filepicker.adapter.FileAdapter
import io.legado.app.ui.filepicker.adapter.PathAdapter

@ -16,9 +16,9 @@ import io.legado.app.base.BaseDialogFragment
import io.legado.app.constant.PreferKey
import io.legado.app.databinding.DialogFontSelectBinding
import io.legado.app.help.AppConfig
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.lib.theme.primaryColor
import io.legado.app.ui.filepicker.FilePicker
import io.legado.app.ui.filepicker.FilePickerDialog

Loading…
Cancel
Save