Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
implementation 'com.github.QianFanYun:QFUtilCode:1.0.1'
}
Application的onCreate方法里添加如下代码
QFLogUtils.newBuilder()
.debug(BuildConfig.DEBUG)
.tag("")// 配置全局TAG 默认为“QF_LOG”
.isSaveLocal(true)// 是否开启保存Log信息到本地
.savePath("")// 设置保存路径
.saveTag("ZOE_LUYS") // 保存指定的TAG信息
.build();
方法 | 说明 |
---|---|
onGranted | 权限授权成功 |
onDenied | 权限授权失败 |
showPermissionRational | 用户第一次拒绝后,下次请求可以提供一个提示信息,返回具体信息内容 |
alwaysDeniedMessage | 用户总是拒绝(勾选了“不再提示”),引导用户去设置页授权,返回具体信息内容 |