implementation 'com.blankj:utilcodex:1.31.1'
注意:这里的权限,在清单问价也要添加如:
-
"android.permission.READ_EXTERNAL_STORAGE"/> -
"android.permission.WRITE_EXTERNAL_STORAGE"/>
-
- /**
- * 请求动态权限
- */
- PermissionUtils.permission(Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE)
- .callback(new PermissionUtils.FullCallback() {
- @Override
- public void onGranted(@NonNull List
granted) { - mPhotoViewModel.getAllPhotoAndVideo();
- }
-
- @Override
- public void onDenied(@NonNull List
deniedForever, @NonNull List denied) { -
- }
- })
- .request();
mImageWidth = AutoSizeUtils.dp2px(context, 108);
move = FileUtils.move(photoEntity.path, dest.getAbsolutePath());
- List
leafCategories - if (!ListUtil.isEmpty(leafCategories)) {}