Karumi / Dexter

Android library that simplifies the process of requesting permissions at runtime.
http://karumi.com
Apache License 2.0
5.23k stars 671 forks source link

Introduced Kotlin DSL #188

Closed babedev closed 4 years ago

babedev commented 6 years ago

What's in this PR?

Usage

camera_permission_button.setOnClickListener {
            runtimePermission {
                permission(Manifest.permission.CAMERA) {
                    granted {
                        with(camera_permission_feedback) {
                            setText(R.string.permission_granted_feedback)
                        }
                    }

                    denied {
                        with(camera_permission_feedback) {
                            setText(R.string.permission_denied_feedback)
                        }
                    }

                    rationaleShouldBeShown { _, token ->
                        token.continuePermissionRequest()
                    }

                    error { error ->
                        when (error) {
                            DexterError.NO_PERMISSIONS_REQUESTED -> {

                            }
                            DexterError.REQUEST_ONGOING -> {

                            }
                        }
                    }
                }
            }
        }
pedrovgs commented 6 years ago

First of all @babedev , thank you so much for such an awesome contribution to the repository. I've seen you are working hard to make this PR shine. But before even reviewing the PR the Karumi team needs to review if this DSL is something we want to maintain. @davideme @flipper83 @fjfdeztoro @Serchinastico I'd like to hear your opinions 😃

NicolasDucom commented 6 years ago

Hi ! Any news on whether you are considering to merge this @pedrovgs ? Thanks, love using Dexter ❤️

pedrovgs commented 6 years ago

I'm still waiting for the rest of the team thoughts @davideme @flipper83 @fjfdeztoro @Serchinastico Sorry for the inconveniences.

pedrovgs commented 4 years ago

Hi @babedev I'm afraid we don't want to maintain the Kotlin DSL for now. However, feel free to fork this repository and keep you own version. We really appreciate your time and effort working on this task and I have to personally apologize for the late response.