Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkSangGwon committed Aug 22, 2021
2 parents ec8682a + 86290bf commit 48589e6
Showing 1 changed file with 22 additions and 30 deletions.
52 changes: 22 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ TedPermission makes it easy to check and request android permissions.


## Setup
- Edit `root/app/build.gradle` like below.
- You can choose only one library depend on your code style `normal`/`coroutine`/`rxJava2`/`rxJava3`


### Gradle

Edit `root/app/build.gradle` like below.

#### Normal
[![Maven Central](https://img.shields.io/maven-central/v/io.github.ParkSangGwon/tedpermission.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.ParkSangGwon%22%20AND%20a:%tedpermission%22)
```gradle
repositories {
Expand All @@ -46,36 +42,20 @@ repositories {
}
dependencies {
// Normal
implementation 'io.github.ParkSangGwon:tedpermission-normal:x.y.z'
}
```

#### RxJava2
[![Maven Central](https://img.shields.io/maven-central/v/io.github.ParkSangGwon/tedpermission-rx2.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.ParkSangGwon%22%20AND%20a:%tedpermission-rx2%22)
```gradle
repositories {
google()
mavenCentral()
}
// Coroutine
implementation 'io.github.ParkSangGwon:tedpermission-coroutine:x.y.z'
dependencies {
// RxJava2
implementation 'io.github.ParkSangGwon:tedpermission-rx2:x.y.z'
}
```

#### RxJava3
[![Maven Central](https://img.shields.io/maven-central/v/io.github.ParkSangGwon/tedpermission-rx3.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.ParkSangGwon%22%20AND%20a:%tedpermission-rx3%22)
```gradle
repositories {
google()
mavenCentral()
}
dependencies {
// RxJava3
implementation 'io.github.ParkSangGwon:tedpermission-rx3:x.y.z'
}
```


If you think this library is useful, please press the star button at the top.
<br/>
<img src="https://phaser.io/content/news/2015/09/10000-stars.png" width="200">
Expand Down Expand Up @@ -122,6 +102,18 @@ Call `check()` to start checking for permissions.

<br/><br/>

### Coroutine
If you use kotlin and coroutine, You can use `check()`function.
`TedPermissionResult` instance has `isGranted()`, `getDeniedPermissions()` methods for checking permission check result.
```kotlin
val permissionResult =
TedPermission.create()
.setPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION)
.check()
```
Also if you want know only granted result, you can use `checkGranted(): boolean`
<br/><br/>


### RxJava
If you use RxJava, You can use `request()` method instead `check()`.
Expand Down Expand Up @@ -219,7 +211,7 @@ Also you can use the following utility functions.

## License
```code
Copyright 2017 Ted Park
Copyright 2021 Ted Park
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 48589e6

Please sign in to comment.