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

Commit 3046f1c

Browse files
authored
Merge pull request #44 from friederbluemle/update-project
Dependency updates and Travis CI
2 parents 42056a1 + 1fece2a commit 3046f1c

16 files changed

+101
-73
lines changed

.gitignore

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
.gradle
2-
/local.properties
3-
/.idea/workspace.xml
4-
/.idea/libraries
5-
.DS_Store
6-
/build
7-
.idea/
8-
*.iml
1+
# Gradle files
2+
.gradle/
93
build/
10-
/local.properties
11-
/captures
12-
google-services.json
4+
5+
# Local configuration file (sdk path, etc)
6+
local.properties
7+
8+
# IntelliJ project files
9+
*.iml
10+
.idea/
11+
12+
# Android Studio captures folder
13+
captures/
14+
15+
# Misc
16+
.DS_Store

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: android
2+
3+
jdk:
4+
- oraclejdk8
5+
6+
before_cache:
7+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
8+
9+
cache:
10+
directories:
11+
- $HOME/.gradle/caches/
12+
- $HOME/.gradle/wrapper/
13+
14+
android:
15+
components:
16+
- tools
17+
- build-tools-24.0.2
18+
- android-24
19+
- platform-tools
20+
- extra-android-m2repository
21+
22+
script:
23+
./gradlew build

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Not Found
1+
Not Found

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# EasyPermissions
1+
# EasyPermissions [![Build Status][1]][2]
22

33
EasyPermissions is a wrapper library to simplify basic system permissions logic when targeting
44
Android M or higher.
@@ -9,7 +9,7 @@ EasyPermissions is installed by adding the following dependency to your `build.g
99

1010
```java
1111
dependencies {
12-
compile 'pub.devrel:easypermissions:0.2.0'
12+
compile 'pub.devrel:easypermissions:0.2.0'
1313
}
1414
```
1515

@@ -21,7 +21,6 @@ To begin using EasyPermissions, have your `Activity` (or `Fragment`) override th
2121

2222
```java
2323
public class MainActivity extends AppCompatActivity {
24-
2524
@Override
2625
protected void onCreate(Bundle savedInstanceState) {
2726
super.onCreate(savedInstanceState);
@@ -35,7 +34,6 @@ public class MainActivity extends AppCompatActivity {
3534
// Forward results to EasyPermissions
3635
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
3736
}
38-
3937
}
4038
```
4139

@@ -58,21 +56,21 @@ The example below shows how to request permissions for a method that requires bo
5856
This can also be achieved by adding logic on the `onPermissionsGranted` callback.
5957

6058
```java
61-
@AfterPermissionGranted(RC_CAMERA_AND_WIFI)
62-
private void methodRequiresTwoPermission() {
63-
String[] perms = {Manifest.permission.CAMERA, Manifest.permission.CHANGE_WIFI_STATE};
64-
if (EasyPermissions.hasPermissions(this, perms)) {
65-
// Already have permission, do the thing
66-
// ...
67-
} else {
68-
// Do not have permissions, request them now
69-
EasyPermissions.requestPermissions(this, getString(R.string.camera_and_wifi_rationale),
70-
RC_CAMERA_AND_WIFI, perms);
71-
}
59+
@AfterPermissionGranted(RC_CAMERA_AND_WIFI)
60+
private void methodRequiresTwoPermission() {
61+
String[] perms = {Manifest.permission.CAMERA, Manifest.permission.CHANGE_WIFI_STATE};
62+
if (EasyPermissions.hasPermissions(this, perms)) {
63+
// Already have permission, do the thing
64+
// ...
65+
} else {
66+
// Do not have permissions, request them now
67+
EasyPermissions.requestPermissions(this, getString(R.string.camera_and_wifi_rationale),
68+
RC_CAMERA_AND_WIFI, perms);
7269
}
70+
}
7371
```
7472

75-
Optionally, for a finer control, you can have your `Activity` / `Framgment` implement
73+
Optionally, for a finer control, you can have your `Activity` / `Fragment` implement
7674
the `PermissionCallbacks` interface.
7775

7876
```java
@@ -144,3 +142,6 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
144142
}
145143
}
146144
```
145+
146+
[1]: https://travis-ci.org/googlesamples/easypermissions.svg?branch=master
147+
[2]: https://travis-ci.org/googlesamples/easypermissions

app/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "23.0.3"
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.2"
66

77
defaultConfig {
88
applicationId "pub.devrel.easypermissions.sample"
99
minSdkVersion 9
10-
targetSdkVersion 23
10+
targetSdkVersion 24
1111
versionCode 1
1212
versionName "1.0"
1313
}
@@ -20,7 +20,7 @@ android {
2020
}
2121

2222
dependencies {
23-
compile 'com.android.support:appcompat-v7:23.4.0'
23+
compile 'com.android.support:appcompat-v7:24.2.1'
2424

2525
compile project(':easypermissions')
2626
}

app/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# By default, the flags in this file are appended to flags specified
3-
# in /usr/local/google/home/samstern/android-sdk-linux/tools/proguard/proguard-android.txt
3+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
44
# You can edit the include path and order by changing the proguardFiles
55
# directive in build.gradle.
66
#

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
88
<uses-permission android:name="android.permission.READ_CONTACTS" />
9-
9+
1010
<uses-permission android:name="android.permission.READ_SMS" />
1111

1212
<application
@@ -23,5 +23,4 @@
2323
</intent-filter>
2424
</activity>
2525
</application>
26-
2726
</manifest>

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.1.0'
8+
classpath 'com.android.tools.build:gradle:2.1.3'
99

10-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
11-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
10+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
11+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1'
1212
}
1313
}
1414

easypermissions/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)