use of permissions.dispatcher.OnPermissionDenied in project ETSMobile-Android2 by ApplETS.
the class MoodleCourseDetailsFragment method showPermissionsSnackbar.
/**
* Shows a snackbar in case he/she needs to allow the app to write to external storage
* in order to download a file coming from Moodle.
*/
@OnPermissionDenied(Manifest.permission.WRITE_EXTERNAL_STORAGE)
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void showPermissionsSnackbar() {
Snackbar snackbar = Snackbar.make(getView(), R.string.moodle_allow_storage_permissions, Snackbar.LENGTH_SHORT).setAction(R.string.action_settings, (listener) -> Utility.goToAppSettings(listener.getContext())).setActionTextColor(ContextCompat.getColor(getActivity(), R.color.ets_red));
snackbar.show();
}
Aggregations