-
-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb23f43
commit 72c4fc5
Showing
10 changed files
with
490 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
/build | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,131 @@ | ||
//文件开头配置 | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'com.jfrog.bintray' | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.3" | ||
|
||
defaultConfig { | ||
minSdkVersion 11 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
} | ||
|
||
def siteUrl = 'https://github.com/getActivity/XXPermissions' //项目在github中的地址 | ||
def gitUrl = siteUrl + ".git" //项目在github中的地址 | ||
|
||
//compile 'com.hjq:xxpermissions:1.0' | ||
def groupId = 'com.hjq' //定义的maven group id最终引用形式 | ||
def artifactId = 'xxpermissions'//maven的artifact id,不要带大写,可以用“-”代替 | ||
def versionName = '1.0'//maven 上发布版本号 | ||
|
||
def repositoryName = 'maven' //自己创建的仓库名,直接在bintray账号下创建的 | ||
def repositoryDesc = 'Android 6.0 permissions adaptation framework' //仓库描述,自己定义 | ||
def packageName = 'XXPermissions' //在仓库创建的包名称,在maven jcenter上显示的名字,最终引用的名字 | ||
|
||
def idName = 'getactivity' //填写bintray用户名,注意大小写 | ||
def orgName = idName //自己的organization(组织)名称,这里的组织直接就是自己的用户名 | ||
def developerName = 'huangjinqun' //开发者姓名 | ||
def developerEmail = '[email protected]' //开发者邮箱 | ||
|
||
def licensesName = 'Apache-2.0' //不能随便写,只能是仓库创建时选择的license type | ||
def licensesUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' //协议地址 | ||
|
||
def codedFormat = 'UTF-8'//如果你的项目里面有中文注释的话,必须将格式设置为UTF-8,不然会出现乱码 | ||
def packagingType = 'aar'//打包类型,可以打包成aar也可以打包成jar,本质上都是zip包 | ||
|
||
Properties properties = new Properties() | ||
properties.load(project.rootProject.file('local.properties').newDataInputStream()) | ||
|
||
//Gradle配置 | ||
version = versionName | ||
group = groupId | ||
bintray { | ||
user = properties.getProperty('bintray.user') | ||
key = properties.getProperty('bintray.apikey') | ||
pkg { | ||
repo = repositoryName | ||
name = packageName | ||
websiteUrl = siteUrl | ||
vcsUrl = gitUrl | ||
licenses = [licensesName] | ||
userOrg = orgName | ||
publish = true // 是否是公开项目,公开别人可以引用 | ||
version { | ||
name = versionName | ||
desc = repositoryDesc | ||
released = new Date() | ||
vcsTag = 'v1.0' | ||
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] | ||
} | ||
} | ||
configurations = ['archives'] | ||
} | ||
|
||
install { | ||
repositories.mavenInstaller { | ||
// This generates POM.xml with proper parameters | ||
pom { | ||
project { | ||
packaging packagingType | ||
name artifactId | ||
description repositoryDesc | ||
url siteUrl | ||
// Set your license | ||
licenses { | ||
license { | ||
name licensesName | ||
url licensesUrl | ||
} | ||
} | ||
developers { | ||
developer { | ||
id idName | ||
name developerName | ||
email developerEmail | ||
} | ||
} | ||
scm { | ||
connection gitUrl | ||
developerConnection gitUrl | ||
url siteUrl | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
from android.sourceSets.main.java.srcDirs | ||
classifier = 'sources' | ||
} | ||
|
||
task javadoc(type: Javadoc) { | ||
failOnError false //必须添加以免出错 | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives javadocJar | ||
archives sourcesJar | ||
} | ||
|
||
javadoc { | ||
options { | ||
encoding codedFormat | ||
charSet codedFormat | ||
author true | ||
version true | ||
links 'http://docs.oracle.com/javase/7/docs/api' | ||
} | ||
//文件开头配置 | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'com.jfrog.bintray' | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.3" | ||
|
||
defaultConfig { | ||
minSdkVersion 11 | ||
targetSdkVersion 25 | ||
versionCode 2 | ||
versionName "1.1" | ||
} | ||
} | ||
|
||
def siteUrl = 'https://github.com/getActivity/XXPermissions' //项目在github中的地址 | ||
def gitUrl = siteUrl + ".git" //项目在github中的地址 | ||
|
||
//compile 'com.hjq:xxpermissions:1.1' | ||
def groupId = 'com.hjq' //定义的maven group id最终引用形式 | ||
def artifactId = 'xxpermissions'//maven的artifact id,不要带大写,可以用“-”代替 | ||
def versionName = '1.1'//maven 上发布版本号 | ||
|
||
def repositoryName = 'maven' //自己创建的仓库名,直接在bintray账号下创建的 | ||
def repositoryDesc = 'Android 6.0 permissions adaptation framework' //仓库描述,自己定义 | ||
def packageName = 'XXPermissions' //在仓库创建的包名称,在maven jcenter上显示的名字,最终引用的名字 | ||
|
||
def idName = 'getactivity' //填写bintray用户名,注意大小写 | ||
def orgName = idName //自己的organization(组织)名称,这里的组织直接就是自己的用户名 | ||
def developerName = 'huangjinqun' //开发者姓名 | ||
def developerEmail = '[email protected]' //开发者邮箱 | ||
|
||
def licensesName = 'Apache-2.0' //不能随便写,只能是仓库创建时选择的license type | ||
def licensesUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' //协议地址 | ||
|
||
def codedFormat = 'UTF-8'//如果你的项目里面有中文注释的话,必须将格式设置为UTF-8,不然会出现乱码 | ||
def packagingType = 'aar'//打包类型,可以打包成aar也可以打包成jar,本质上都是zip包 | ||
|
||
Properties properties = new Properties() | ||
properties.load(project.rootProject.file('local.properties').newDataInputStream()) | ||
|
||
//Gradle配置 | ||
version = versionName | ||
group = groupId | ||
bintray { | ||
user = properties.getProperty('bintray.user') | ||
key = properties.getProperty('bintray.apikey') | ||
pkg { | ||
repo = repositoryName | ||
name = packageName | ||
websiteUrl = siteUrl | ||
vcsUrl = gitUrl | ||
licenses = [licensesName] | ||
userOrg = orgName | ||
publish = true // 是否是公开项目,公开别人可以引用 | ||
version { | ||
name = versionName | ||
desc = repositoryDesc | ||
released = new Date() | ||
vcsTag = 'v1.0' | ||
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] | ||
} | ||
} | ||
configurations = ['archives'] | ||
} | ||
|
||
install { | ||
repositories.mavenInstaller { | ||
// This generates POM.xml with proper parameters | ||
pom { | ||
project { | ||
packaging packagingType | ||
name artifactId | ||
description repositoryDesc | ||
url siteUrl | ||
// Set your license | ||
licenses { | ||
license { | ||
name licensesName | ||
url licensesUrl | ||
} | ||
} | ||
developers { | ||
developer { | ||
id idName | ||
name developerName | ||
email developerEmail | ||
} | ||
} | ||
scm { | ||
connection gitUrl | ||
developerConnection gitUrl | ||
url siteUrl | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
from android.sourceSets.main.java.srcDirs | ||
classifier = 'sources' | ||
} | ||
|
||
task javadoc(type: Javadoc) { | ||
failOnError false //必须添加以免出错 | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives javadocJar | ||
archives sourcesJar | ||
} | ||
|
||
javadoc { | ||
options { | ||
encoding codedFormat | ||
charSet codedFormat | ||
author true | ||
version true | ||
links 'http://docs.oracle.com/javase/7/docs/api' | ||
} | ||
} |
46 changes: 23 additions & 23 deletions
46
library/src/main/java/com/hjq/permissions/OnPermission.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package com.hjq.permissions; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by HJQ on 2018-6-15. | ||
*/ | ||
public interface OnPermission { | ||
|
||
/** | ||
* 有权限被授予时回调 | ||
* | ||
* @param granted 请求成功的权限组 | ||
*/ | ||
void hasPermission(List<String> granted); | ||
|
||
/** | ||
* 有权限被拒绝授予时回调 | ||
* | ||
* @param denied 请求失败的权限组 | ||
* @param permanent 是否永久拒绝了 | ||
*/ | ||
void noPermission(List<String> denied, boolean permanent); | ||
package com.hjq.permissions; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by HJQ on 2018-6-15. | ||
*/ | ||
public interface OnPermission { | ||
|
||
/** | ||
* 有权限被授予时回调 | ||
* | ||
* @param granted 请求成功的权限组 | ||
*/ | ||
void hasPermission(List<String> granted); | ||
|
||
/** | ||
* 有权限被拒绝授予时回调 | ||
* | ||
* @param denied 请求失败的权限组 | ||
* @param quick 是否永久拒绝了 | ||
*/ | ||
void noPermission(List<String> denied, boolean quick); | ||
} |
Oops, something went wrong.