Qboxing - 基于boxing的AndroidQ适配

相较于boxing:

1. 兼容AndroidQ

2. 适配AndroidX

3. 100%的Kotlin代码

开始使用

添加依赖

allprojects {

repositories {

...

maven { url 'https://jitpack.io' }

}

}

dependencies {

implementation 'com.github.iDeMonnnnnn:Qboxing:$latest_version'

}

添加权限

注意申请运行时权限。

如何使用

1.初始化

使用前,必须调用此方法初始化。

//初始化,提供一个全局的Context

Boxing.init(this)

2.FileProvider

android:name="androidx.core.content.FileProvider"

android:authorities="${applicationId}.file.provider"

android:exported="false"

android:grantUriPermissions="true">

android:name="android.support.FILE_PROVIDER_PATHS"

android:resource="@xml/file_paths" />

3.获取图片路径

使用newPath代替path,兼容了AndroidQ无法直接通过文件路径获取非作用域文件的问题。

media.path ---> media.newPath

4.更多

基本使用方法与boxing完全一致,可参见其文档

参考app使用示例

使用效果

00605915bf5612bb6ee8ba683c05aa07.png

其他

如果你有问题或者建议,请Issues.

致谢

MIT License

Copyright (c) 2021 DeMon

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐