Permissions Flow

Additional

Language
Kotlin
Version
N/A
Created
Apr 27, 2020
Updated
Jun 5, 2020
Owner
Innfinity (innfinity-am)
Contributors
Robert (robertlevonyan)
Robert Levonyan (robertpicsart)
2
Activity
Badge
Generate
Download
Source code

Promotion

Permissions Flow

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

Setup

Gradle:

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

    implementation 'com.innfinity:PermissionsFlow:1.0.1'

Maven:

  <dependency>
    <groupId>com.innfinity</groupId>
    <artifactId>PermissionsFlow</artifactId>
    <version>1.0.1</version>
    <type>pom</type>
  </dependency>

Usage

You need to implement few steps use the library.

  // Open a block of PermissionFlow
  permissionFlow {
    // specify permissions you want to request 
    withPermissions(Manifest.permission.CAMERA,Manifest.permission.WRITE_EXTERNAL_STORAGE)

    // add an instance of the fragment or activity, from where you are requesting permissions
    withActivity(this@MainActivity)
    //or
    withFragment(this@MainFragment)

    //request for permissions
    request().collect { granted: Boolean ->
      // do something with result
    }
    //or
    requestEach().collect { permission: Permission ->
      // get result for each permission and see if it is either granted 
      // or not, or should show a rationale explanation
    }
  }

That's it!

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

Versions

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.