All Projects → innfinity-am → permissions-flow

innfinity-am / permissions-flow

Licence: Apache-2.0 license
A simple library to make it easy requesting permissions in Android using Kotlin Coroutines.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to permissions-flow

Permissionsflow
A simple library to make it easy requesting permissions in Android using Kotlin Coroutines.
Stars: ✭ 49 (-39.51%)
Mutual labels:  android-sdk, permissions, android-development, android-architecture, kotlin-coroutines
Cameraxdemo
A sample camera app with CameraX API from Android Jetpack
Stars: ✭ 112 (+38.27%)
Mutual labels:  android-sdk, android-development, android-architecture, kotlin-coroutines
Android Inappbilling
A sample which uses Google's Play Billing Library and it does InApp Purchases and Subscriptions.
Stars: ✭ 114 (+40.74%)
Mutual labels:  android-sdk, android-development, android-architecture
Android-MonetizeApp
A sample which uses Google's Play Billing Library and it makes In-app Purchases and Subscriptions.
Stars: ✭ 149 (+83.95%)
Mutual labels:  android-sdk, android-development, android-architecture
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (+69.14%)
Mutual labels:  android-sdk, android-development, android-architecture
Expenso
📊 A Minimal Expense Tracker App built to demonstrate the use of modern android architecture component with MVVM Architecture
Stars: ✭ 325 (+301.23%)
Mutual labels:  android-development, android-architecture, kotlin-coroutines
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (+95.06%)
Mutual labels:  android-development, android-architecture, kotlin-coroutines
Android Blogs
Blogs about Android
Stars: ✭ 490 (+504.94%)
Mutual labels:  android-sdk, android-development, android-architecture
android-jetpack
🚀 Road to Accelerate Android Development using Jetpack
Stars: ✭ 50 (-38.27%)
Mutual labels:  android-sdk, android-development, android-architecture
Android-daily-read-tips
log for articles and info in android for every developer
Stars: ✭ 13 (-83.95%)
Mutual labels:  android-sdk, android-development, android-architecture
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (+29.63%)
Mutual labels:  android-sdk, android-development, android-architecture
Androidkex
Extensions for Kotlin. Use the power of Kotlin to make your code smaller and beautiful.
Stars: ✭ 35 (-56.79%)
Mutual labels:  android-sdk, android-development, android-architecture
Einsen
🎯 Einsen is a prioritization app that uses Eisenhower matrix technique as workflow to prioritize a list of tasks & built to Demonstrate use of Jetpack Compose with Modern Android Architecture Components & MVVM Architecture.
Stars: ✭ 821 (+913.58%)
Mutual labels:  android-development, android-architecture, kotlin-coroutines
Droid Feed
Aggregated Android news, articles, podcasts and conferences about Android Development
Stars: ✭ 174 (+114.81%)
Mutual labels:  android-development, android-architecture, kotlin-coroutines
media-picker
Easy customizable picker for all your needs in Android application
Stars: ✭ 167 (+106.17%)
Mutual labels:  android-sdk, android-development, android-architecture
Android Arsenal.com
Source to android-arsenal.herokuapp.com
Stars: ✭ 541 (+567.9%)
Mutual labels:  android-sdk, android-development, android-architecture
Modern Android Development
Modern Android Development tools & key points
Stars: ✭ 219 (+170.37%)
Mutual labels:  android-sdk, android-development, android-architecture
Apkscale
A Gradle plugin to measure the app size impact of Android libraries
Stars: ✭ 76 (-6.17%)
Mutual labels:  android-sdk, android-development
Livesmashbar
An elegant looking and easy to use informative library with LiveData integration for Android.
Stars: ✭ 107 (+32.1%)
Mutual labels:  android-sdk, android-development
Kotlin Android Scaffolding
An android project structure using kotlin and most common libraries.
Stars: ✭ 53 (-34.57%)
Mutual labels:  android-sdk, android-development

Permissions Flow

Maven Central API

A simple library to make it easy requesting permissions in Android using Kotlin Coroutines.

Setup

Add following line of code to your project level gradle file

  repositories {
    mavenCentral()
  }

Gradle:

Add following line of code to your module (app) level gradle file:

    implementation 'com.robertlevonyan.components:PermissionsFlow:<LATEST-VERSION>'

Kotlin:

    implementation("com.robertlevonyan.components:PermissionsFlow:$LATEST_VERSION")

Maven:

  <dependency>
    <groupId>com.robertlevonyan.components</groupId>
    <artifactId>PermissionsFlow</artifactId>
    <version>LATEST-VERSION</version>
    <type>pom</type>
  </dependency>

Usage:

Permission flow offers 2 simple extension functions - both for for activities/fragments:

requestPermissions(vararg permissionsToRequest: String)
requestEachPermissions(vararg permissionsToRequest: String)

Both functions do request all permissions passed to them - the first one emits a list of Permissions, the second one flattens the permissions.

Here's a full code example like it would look like in an activity:

override fun onCreate(savedInstanceState: Bundle?) {
 
    CoroutineScope(Dispatchers.Main).launch {
        // just call requestPermission and pass in all required permissions
        requestPermissions(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)
            .collect { permissions ->
                // here you get the result of the requests, permissions holds a list of Permission requests and you can check if all of them have been granted:
                val allGranted = permissions.find { !it.isGranted } == null
                // or iterate over the permissions and check them one by one
                permissions.forEach { 
                	val granted = it.isGranted
                	// ...
                }
            }
	}
}

That's it!

With only few simple steps you can request permissions without splitting your code or overriding functions.

Versions

1.2.1 - 1.2.3

Update to Java 11, SDK 31 ready, Minor updates

1.2.0

Migration to mavenCentral

1.1.0

Extensions for Fragment and Activity added

1.0.0

First version of library

Contact

Licence

    Permissions Flow©
    Copyright 2020 Robert Levonyan
    Url: https://github.com/innfinity-am/PermissionsFlow

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].