Search in sources :

Example 1 with CompositeMultiplePermissionsListener

use of com.karumi.dexter.listener.multi.CompositeMultiplePermissionsListener in project Dexter by Karumi.

the class SampleActivity method createPermissionListeners.

private void createPermissionListeners() {
    PermissionListener feedbackViewPermissionListener = new SamplePermissionListener(this);
    MultiplePermissionsListener feedbackViewMultiplePermissionListener = new SampleMultiplePermissionListener(this);
    allPermissionsListener = new CompositeMultiplePermissionsListener(feedbackViewMultiplePermissionListener, SnackbarOnAnyDeniedMultiplePermissionsListener.Builder.with(contentView, R.string.all_permissions_denied_feedback).withOpenSettingsButton(R.string.permission_rationale_settings_button_text).build());
    contactsPermissionListener = new CompositePermissionListener(feedbackViewPermissionListener, SnackbarOnDeniedPermissionListener.Builder.with(contentView, R.string.contacts_permission_denied_feedback).withOpenSettingsButton(R.string.permission_rationale_settings_button_text).withCallback(new Snackbar.Callback() {

        @Override
        public void onShown(Snackbar snackbar) {
            super.onShown(snackbar);
        }

        @Override
        public void onDismissed(Snackbar snackbar, int event) {
            super.onDismissed(snackbar, event);
        }
    }).build());
    PermissionListener dialogOnDeniedPermissionListener = DialogOnDeniedPermissionListener.Builder.withContext(this).withTitle(R.string.audio_permission_denied_dialog_title).withMessage(R.string.audio_permission_denied_dialog_feedback).withButtonText(android.R.string.ok).withIcon(R.mipmap.ic_logo_karumi).build();
    audioPermissionListener = new CompositePermissionListener(feedbackViewPermissionListener, dialogOnDeniedPermissionListener);
    cameraPermissionListener = new SampleBackgroundThreadPermissionListener(this);
    errorListener = new SampleErrorListener();
}
Also used : MultiplePermissionsListener(com.karumi.dexter.listener.multi.MultiplePermissionsListener) SnackbarOnAnyDeniedMultiplePermissionsListener(com.karumi.dexter.listener.multi.SnackbarOnAnyDeniedMultiplePermissionsListener) CompositeMultiplePermissionsListener(com.karumi.dexter.listener.multi.CompositeMultiplePermissionsListener) SnackbarOnDeniedPermissionListener(com.karumi.dexter.listener.single.SnackbarOnDeniedPermissionListener) CompositePermissionListener(com.karumi.dexter.listener.single.CompositePermissionListener) PermissionListener(com.karumi.dexter.listener.single.PermissionListener) DialogOnDeniedPermissionListener(com.karumi.dexter.listener.single.DialogOnDeniedPermissionListener) CompositeMultiplePermissionsListener(com.karumi.dexter.listener.multi.CompositeMultiplePermissionsListener) CompositePermissionListener(com.karumi.dexter.listener.single.CompositePermissionListener) Snackbar(com.google.android.material.snackbar.Snackbar)

Aggregations

Snackbar (com.google.android.material.snackbar.Snackbar)1 CompositeMultiplePermissionsListener (com.karumi.dexter.listener.multi.CompositeMultiplePermissionsListener)1 MultiplePermissionsListener (com.karumi.dexter.listener.multi.MultiplePermissionsListener)1 SnackbarOnAnyDeniedMultiplePermissionsListener (com.karumi.dexter.listener.multi.SnackbarOnAnyDeniedMultiplePermissionsListener)1 CompositePermissionListener (com.karumi.dexter.listener.single.CompositePermissionListener)1 DialogOnDeniedPermissionListener (com.karumi.dexter.listener.single.DialogOnDeniedPermissionListener)1 PermissionListener (com.karumi.dexter.listener.single.PermissionListener)1 SnackbarOnDeniedPermissionListener (com.karumi.dexter.listener.single.SnackbarOnDeniedPermissionListener)1