Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 556b2ce

Browse files
SUPERCILEXsamtstern
authored andcommitted
Update all the things (#152)
1 parent 86424dd commit 556b2ce

File tree

7 files changed

+30
-25
lines changed

7 files changed

+30
-25
lines changed

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ android:
1414
components:
1515
- tools
1616
- platform-tools
17-
- build-tools-25.0.3
18-
- android-25
19-
- extra-android-m2repository
17+
- build-tools-26.0.1
18+
- android-26
2019

2120
script: ./gradlew build

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ android {
66

77
defaultConfig {
88
applicationId "pub.devrel.easypermissions.sample"
9-
minSdkVersion 9
9+
minSdkVersion 14
1010
targetSdkVersion targetSdk
1111
versionCode 1
1212
versionName "1.0"
@@ -28,5 +28,5 @@ dependencies {
2828
compile project(':easypermissions')
2929

3030
testCompile 'junit:junit:4.12'
31-
testCompile 'org.robolectric:robolectric:3.3.2'
31+
testCompile 'org.robolectric:robolectric:3.4.2'
3232
}

build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
22
repositories {
33
jcenter()
4-
maven { url 'https://maven.google.com' }
4+
google()
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.0.0-alpha8'
8+
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
99

1010
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1111
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
@@ -15,7 +15,7 @@ buildscript {
1515
allprojects {
1616
repositories {
1717
jcenter()
18-
maven { url 'https://maven.google.com' }
18+
google()
1919
}
2020
}
2121

@@ -35,9 +35,9 @@ ext {
3535

3636
bintrayOrg = 'easygoogle'
3737

38-
support_library_version = '25.3.1'
38+
support_library_version = '26.0.1'
3939

40-
buildTools = '25.0.3'
41-
compileSdk = 25
42-
targetSdk = 25
40+
buildTools = '26.0.1'
41+
compileSdk = 26
42+
targetSdk = 26
4343
}

easypermissions/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ android {
55
buildToolsVersion buildTools
66

77
defaultConfig {
8-
minSdkVersion 9
8+
minSdkVersion 14
99
targetSdkVersion targetSdk
1010
versionCode 1
1111
versionName mavenVersion

easypermissions/src/main/java/pub/devrel/easypermissions/EasyPermissions.java

+16-10
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public static boolean hasPermissions(Context context, @NonNull String... perms)
8989

9090
/**
9191
* Request permissions from an Activity with standard OK/Cancel buttons.
92+
*
9293
* @see #requestPermissions(Activity, String, int, int, int, String...)
9394
*/
9495
public static void requestPermissions(
@@ -100,6 +101,7 @@ public static void requestPermissions(
100101

101102
/**
102103
* Request permissions from a Support Fragment with standard OK/Cancel buttons.
104+
*
103105
* @see #requestPermissions(Activity, String, int, int, int, String...)
104106
*/
105107
public static void requestPermissions(
@@ -112,6 +114,7 @@ public static void requestPermissions(
112114

113115
/**
114116
* Request permissions from a standard Fragment with standard OK/Cancel buttons.
117+
*
115118
* @see #requestPermissions(Activity, String, int, int, int, String...)
116119
*/
117120
public static void requestPermissions(
@@ -145,6 +148,7 @@ public static void requestPermissions(
145148

146149
/**
147150
* Request permissions from a Support Fragment.
151+
*
148152
* @see #requestPermissions(Activity, String, int, int, int, String...)
149153
*/
150154
public static void requestPermissions(
@@ -302,7 +306,7 @@ public static boolean permissionPermanentlyDenied(@NonNull android.app.Fragment
302306
/**
303307
* See if some denied permission has been permanently denied.
304308
*
305-
* @param host requesting context.
309+
* @param host requesting context.
306310
* @param perms array of permissions.
307311
* @return true if the user has previously denied any of the {@code perms} and we should show a
308312
* rationale, false otherwise.
@@ -329,11 +333,12 @@ public static boolean somePermissionDenied(@NonNull android.app.Fragment host,
329333
}
330334

331335
/**
332-
* Run permission callbacks on an object that requested permissions but already has them
333-
* by simulating {@link PackageManager#PERMISSION_GRANTED}.
334-
* @param object the object requesting permissions.
336+
* Run permission callbacks on an object that requested permissions but already has them by
337+
* simulating {@link PackageManager#PERMISSION_GRANTED}.
338+
*
339+
* @param object the object requesting permissions.
335340
* @param requestCode the permission request code.
336-
* @param perms a list of permissions requested.
341+
* @param perms a list of permissions requested.
337342
*/
338343
private static void notifyAlreadyHasPermissions(@NonNull Object object,
339344
int requestCode,
@@ -348,8 +353,9 @@ private static void notifyAlreadyHasPermissions(@NonNull Object object,
348353

349354
/**
350355
* Find all methods annotated with {@link AfterPermissionGranted} on a given object with the
351-
* correc requestCode argument.
352-
* @param object the object with annotated methods.
356+
* correct requestCode argument.
357+
*
358+
* @param object the object with annotated methods.
353359
* @param requestCode the requestCode passed to the annotation.
354360
*/
355361
private static void runAnnotatedMethods(@NonNull Object object, int requestCode) {
@@ -360,9 +366,9 @@ private static void runAnnotatedMethods(@NonNull Object object, int requestCode)
360366

361367
while (clazz != null) {
362368
for (Method method : clazz.getDeclaredMethods()) {
363-
if (method.isAnnotationPresent(AfterPermissionGranted.class)) {
369+
AfterPermissionGranted ann = method.getAnnotation(AfterPermissionGranted.class);
370+
if (ann != null) {
364371
// Check for annotated methods with matching request code.
365-
AfterPermissionGranted ann = method.getAnnotation(AfterPermissionGranted.class);
366372
if (ann.value() == requestCode) {
367373
// Method must be void so that we can invoke it
368374
if (method.getParameterTypes().length > 0) {
@@ -390,7 +396,7 @@ private static void runAnnotatedMethods(@NonNull Object object, int requestCode)
390396
}
391397

392398
/**
393-
* Determine if the project is using the AndroidAnnoations library.
399+
* Determine if the project is using the AndroidAnnotations library.
394400
*/
395401
private static boolean isUsingAndroidAnnotations(@NonNull Object object) {
396402
if (!object.getClass().getSimpleName().endsWith("_")) {

gradle/wrapper/gradle-wrapper.jar

-3 Bytes
Binary file not shown.
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Jun 14 07:57:23 PDT 2017
1+
#Fri Aug 18 16:20:16 PDT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

0 commit comments

Comments
 (0)