Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KTX permission dispatcher does not support arguments #702

Open
alaershov opened this issue Dec 10, 2020 · 1 comment
Open

KTX permission dispatcher does not support arguments #702

alaershov opened this issue Dec 10, 2020 · 1 comment

Comments

@alaershov
Copy link

Overview

KTX permission dispatcher does not support passing arguments to functions that require permissions.
For instance, we can do this with annotation-style:

@NeedsPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
fun downloadFile(fileParams: FileParams) {
    ...
}

but it's not possible with KTX-style, because requiresPermission is a pre-defined lambda that must be constructed on activity creation.

Expected

Would be nice to have the possibility to pass arguments to permission-requiring functions.

@hotchemi
Copy link
Member

thx, that'd be cool to have it👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants