https://github.com/warting/permissions-ui
Background location permissions request helper
https://github.com/warting/permissions-ui
android jetpack-compose permissions
Last synced: 6 months ago
JSON representation
Background location permissions request helper
- Host: GitHub
- URL: https://github.com/warting/permissions-ui
- Owner: warting
- License: mit
- Created: 2021-09-17T09:00:59.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-12-19T06:36:07.000Z (7 months ago)
- Last Synced: 2025-12-22T02:01:59.910Z (6 months ago)
- Topics: android, jetpack-compose, permissions
- Language: Kotlin
- Homepage:
- Size: 14.9 MB
- Stars: 63
- Watchers: 1
- Forks: 5
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://maven-badges.herokuapp.com/maven-central/se.warting.permissionsui/permissionsui)
[](https://crowdin.com/project/permissions-ui)
# Permission UI
A set of Android-UI components to make it easier to request permission in a user friendly way.
## Access background location
A jetpack compose module to easy request background location permission in a intuitive way.

## How to include in your project
The library is available via MavenCentral:
```
allprojects {
repositories {
// ...
mavenCentral()
}
}
```
Add it to your module dependencies:
```
dependencies {
implementation("se.warting.permissionsui:permissionsui:")
}
```
Snapshots of the development version are available in Sonatype's snapshots repository.
[](https://oss.sonatype.org/content/repositories/snapshots/se/warting/permissionsui/permissionsui/)
```groovy
allprojects {
repositories {
// ...
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
}
```
## How to use
All you need to do is to call `LocationInBackgroundTutorialView`:
```
LocationInBackgroundTutorialView() {
// Permissions granted
}
```
Example:
```
import se.warting.permissionsui.backgroundlocation.LocationInBackgroundTutorialView
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
BackgroundLocationPermissionRationaleTheme {
Surface(color = MaterialTheme.colors.background) {
LocationInBackgroundTutorialView() {
// Permissions granted
}
}
}
}
}
}
```
If you are not using compose in your app you can use `PermissionsUiContracts.RequestBackgroundLocation` See: [kotlin sample](app/src/main/java/se/warting/backgroundlocationpermissionrationale/ResultingActivity.kt) or [java sample](appjava/src/main/java/se/warting/backgroundlocationpermissionrationale/MainActivity.java)
For a full implementation see: [Full sample](app/src/main/java/se/warting/backgroundlocationpermissionrationale/MainActivity.kt)
## Notes
This Library adds the following permissions to your app:
- android.permission.ACCESS_COARSE_LOCATION
- android.permission.ACCESS_FINE_LOCATION
- android.permission.ACCESS_BACKGROUND_LOCATION
## Samples
| SDK | Happy case | Rationale case | Worst case |
| --- | --- | --- | --- |
| 10 |  |  |  |
| 12 |  |  |  |