-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RxPermission: hasRequested API to check if Permission has been reques…
…ted once before. (#105)
- Loading branch information
1 parent
bba8937
commit 351b2e8
Showing
13 changed files
with
139 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[*.{kt,kts}] | ||
indent_size=2 | ||
continuation_indent_size=2 | ||
insert_final_newline=true | ||
ij_kotlin_allow_trailing_comma=true | ||
ij_kotlin_allow_trailing_comma_on_call_site=true | ||
disabled_rules=annotation,argument-list-wrapping,spacing-between-declarations-with-annotations,filename |
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
6 changes: 4 additions & 2 deletions
6
rxpermission-testing/dependencies/releaseRuntimeClasspath.txt
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,6 +1,8 @@ | ||
androidx.annotation:annotation:1.4.0 | ||
io.reactivex.rxjava2:rxjava:2.2.21 | ||
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21 | ||
org.jetbrains.kotlin:kotlin-stdlib:1.6.21 | ||
org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10 | ||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10 | ||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 | ||
org.jetbrains.kotlin:kotlin-stdlib:1.7.10 | ||
org.jetbrains:annotations:13.0 | ||
org.reactivestreams:reactive-streams:1.0.3 |
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
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,6 +1,8 @@ | ||
androidx.annotation:annotation:1.4.0 | ||
io.reactivex.rxjava2:rxjava:2.2.21 | ||
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21 | ||
org.jetbrains.kotlin:kotlin-stdlib:1.6.21 | ||
org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10 | ||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10 | ||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 | ||
org.jetbrains.kotlin:kotlin-stdlib:1.7.10 | ||
org.jetbrains:annotations:13.0 | ||
org.reactivestreams:reactive-streams:1.0.3 |
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
20 changes: 0 additions & 20 deletions
20
rxpermission/src/main/java/com/vanniktech/rxpermission/RxPermission.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
rxpermission/src/main/java/com/vanniktech/rxpermission/RxPermission.kt
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.vanniktech.rxpermission | ||
|
||
import io.reactivex.Observable | ||
import io.reactivex.Single | ||
import io.reactivex.annotations.CheckReturnValue | ||
|
||
interface RxPermission { | ||
/** Requests a single permission. */ | ||
@CheckReturnValue fun request(permission: String): Single<Permission?> | ||
|
||
/** Requests multiple permissions. */ | ||
@CheckReturnValue fun requestEach(vararg permissions: String): Observable<Permission?> | ||
|
||
/** Returns true when the given permission is granted. */ | ||
@CheckReturnValue fun isGranted(permission: String): Boolean | ||
|
||
/** Returns true when the given permission is revoked by a policy. */ | ||
@CheckReturnValue fun isRevokedByPolicy(permission: String): Boolean | ||
|
||
/** Returns tue when the given permission has been request at least once using either [request] or [requestEach]. */ | ||
@CheckReturnValue fun hasRequested(permission: String): Boolean | ||
} |
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
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,10 +1,26 @@ | ||
<Button xmlns:android="http://schemas.android.com/apk/res/android" | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/enableCamera" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:layout_marginTop="16dp" | ||
android:text="Enable camera" | ||
tools:ignore="HardcodedText" | ||
/> | ||
android:orientation="vertical" | ||
> | ||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:layout_marginTop="16dp" | ||
tools:ignore="HardcodedText" | ||
/> | ||
<Button | ||
android:id="@+id/enableCamera" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:layout_marginTop="16dp" | ||
android:text="Enable camera" | ||
tools:ignore="HardcodedText" | ||
/> | ||
</LinearLayout> |