permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.22k stars 1.44k forks source link

[Question] - Fragment Documantation #624

Closed TurKurT656 closed 5 years ago

TurKurT656 commented 5 years ago

Is there any doc to show how to use this lib with fragments? i'm using android x library

hotchemi commented 5 years ago

There's no official doc but you can use the library as same as on Activity :D

JFYI: the article may help you: http://mobiledevhub.com/2017/11/24/android-fundamentals-requesting-permissions-in-fragment/

TurKurT656 commented 5 years ago

Ty for quick answer. but in there what is PermissionFragmentPermissionsDispatcher ? i coudnt find that

hotchemi commented 5 years ago

it will be generated at compile time. Try our sample module first of all to figure out the usage~

TurKurT656 commented 5 years ago

yes i saw the sample folder but there is only activity runtime permission

but in my fragment:

@RuntimePermissions
class AddPostFragment : androidx.fragment.app.Fragment() {

    @NeedsPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
    fun openCamera() {
    }

}

it does not generate AddPostFragmentPermisionDispatcher class

hotchemi commented 5 years ago

Check our sample module, especially around gradle.

https://github.com/permissions-dispatcher/PermissionsDispatcher#installation