/EasyPermission

Get permission dynamic

Primary LanguageKotlin

EasyPermission Download

Install

implementation 'com.github.boybeak:easy-permission:1.0.0'

Usage

EasyPermission.ask(
            Manifest.permission.WRITE_EXTERNAL_STORAGE,
            Manifest.permission.CAMERA,
            Manifest.permission.ACCESS_FINE_LOCATION
        ).go(this, object : Callback {
            override fun onGranted(permissions: MutableList<String>) {
                Toast.makeText(this@MainActivity, "Granted", Toast.LENGTH_SHORT).show()
            }

            override fun onDenied(
                permission: String,
                shouldShowRequestPermissionRationale: Boolean
            ) {
                Toast.makeText(this@MainActivity, "Denied $permission", Toast.LENGTH_SHORT).show()
            }

        })