Add setter for flag enabled/disabled auto check permissions (#775)

* Added setter for auto check permissions flag

* Added info about new method
pull/794/head
Alexander 5 years ago committed by GitHub
parent 858495afde
commit 218b27319d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java
  2. 2
      docs/_docs/runtime-permissions.md

@ -726,6 +726,14 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
//region Lifecycle APIs
/**
* Sets permissions flag if you want enable auto check permissions or disable it.
* @param requestPermissions - true: auto check permissions enabled, false: auto check permissions disabled.
*/
public void setRequestPermissions(boolean requestPermissions) {
mRequestPermissions = requestPermissions;
}
/**
* Returns whether the camera engine has started.
* @return whether the camera has started

@ -46,4 +46,4 @@ The automatic request is currently done at the activity level, so the permission
`onRequestPermissionResults()` will be invoked on the parent activity, not the fragment.
The automatic request can be disabled by setting `app:cameraRequestPermissions="false"` in your
XML declaration.
XML declaration or by using this method `setRequestPermissions(boolean requestPermissions)` in your code.
Loading…
Cancel
Save