|
|
|
@ -280,6 +280,14 @@ class ThemeConfigFragment : BasePreferenceFragment(), |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { |
|
|
|
|
var hasPermission = true |
|
|
|
|
it.forEach { (t, u) -> |
|
|
|
|
if (!u) { |
|
|
|
|
hasPermission = false |
|
|
|
|
toastOnUi(t) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (hasPermission) { |
|
|
|
|
RealPathUtil.getPath(requireContext(), uri)?.let { path -> |
|
|
|
|
val imgFile = File(path) |
|
|
|
|
if (imgFile.exists()) { |
|
|
|
@ -291,6 +299,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), |
|
|
|
|
success() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}.launch(Permissions.Group.STORAGE) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|