use of pub.devrel.easypermissions.AfterPermissionGranted in project JustAndroid by chinaltz.
the class OtherUtilsFragment method didStartCaptureVideo.
@AfterPermissionGranted(REQUEST_Camera_CAPTUREVIDEO)
public void didStartCaptureVideo() {
if (EasyPermissions.hasPermissions(mContext, Manifest.permission.CAMERA)) {
String videoFilePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + AbStrUtil.get36UUID() + ".mp4";
File videoFile = new File(videoFilePath);
// 启动视频录制
CaptureVideoActivity.start((Activity) mContext, videoFilePath, 1000);
} else {
// Ask for one permission
EasyPermissions.requestPermissions(this, "需要使用相机信息权限", REQUEST_Camera_CAPTUREVIDEO, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO);
}
}
use of pub.devrel.easypermissions.AfterPermissionGranted in project JustAndroid by chinaltz.
the class OtherUtilsFragment method didStartCapture.
@AfterPermissionGranted(REQUEST_Camera_PERM)
public void didStartCapture() {
if (EasyPermissions.hasPermissions(mContext, Manifest.permission.CAMERA)) {
Intent intent = new Intent();
intent.setClass(mContext, CaptureActivity.class);
startActivity(intent);
} else {
// Ask for one permission
EasyPermissions.requestPermissions(this, "需要使用相机信息权限", REQUEST_Camera_PERM, Manifest.permission.CAMERA);
}
}
use of pub.devrel.easypermissions.AfterPermissionGranted in project FirebaseUI-Android by firebase.
the class ImageActivity method choosePhoto.
@AfterPermissionGranted(RC_IMAGE_PERMS)
protected void choosePhoto() {
if (!EasyPermissions.hasPermissions(this, PERMS)) {
EasyPermissions.requestPermissions(this, getString(R.string.rational_image_perm), RC_IMAGE_PERMS, PERMS);
return;
}
Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, RC_CHOOSE_PHOTO);
}
Aggregations