这个功能需要自己做兼容处理,需要自己去实现,实现代码为:
1.拿取回调接口mUploadCallbackAboveL
private ValueCallback<Uri[]> mUploadCallbackAboveL;//回调图片选择,5.0以上
mWebView.setWebChromeClient(new WebChromeClient() {
// For Android 5.0+
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
mUploadCallbackAboveL = filePathCallback;
if (acceptTypes.length > 0) {
videoFlag = acceptTypes[0].contains("video");
}
if (videoFlag) {
recordVideo();
} else {
openImageChooserActivity();
}
return true;
}
}
2.openImageChooserActivity()方法的代码
///选择拍照还是相册
public void openImageChooserActivity() {
if (picSelectorHelper == null) {
picSelectorHelper = new PicSelectorHelper(PicSelectorHelper.SelectorType.PICTURE);
}
picSelectorHelper.showPicSelectorDialogWithDismiss(getActivity(), 1, new PicSelectorHelper.OnPicSelectedListener() {
@Override
public void onSelected(List<String> paths) {
Uri result = Uri.fromFile(new File(paths.get(0)));
if (mUploadCallbackAboveL != null) {
mUploadCallbackAboveL.onReceiveValue(new Uri[]{result});
mUploadCallbackAboveL = null;
}
}
@Override
public void onError() {
}
@Override
public void onCancel() {
super.onCancel();
cancel();
}
}, new PicSelectorHelper.OnDialogListener() {
@Override
public void onDismiss() {
cancel();
}
});
3.PicSelectorHelper工具类的代码
package com.utsp.wit.iov.base.util.picselect;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.ActivityInfo;
import android.util.Log;
import android.view.View;
import com.luck.picture.lib.PictureSelectionModel;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.listener.OnResultCallbackListener;
import com.luck.picture.lib.style.PictureParameterStyle;
import com.luck.picture.lib.tools.SdkVersionUtils;
import com.tencent.cloud.iov.util.ResourcesUtils;
import com.tencent.cloud.uikit.widget.dialog.BottomSheetDialog;
import com.utsp.wit.iov.base.R;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
/**
* @ProjectName: wit-android
* @Package: com.utsp.wit.iov.base.util
* @ClassName: PicSelectorHelper
* @Description: java类作用描述
* @Author: peijie.yang
* @CreateDate: 2021/10/29 13:40
* @UpdateUser: 更新者
* @UpdateDate: 2021/10/29 13:40
* @UpdateRemark: 更新说明
* @Version: 1.0
*/
public class PicSelectorHelper {
public static final String TAG = PicSelectorHelper.class.getSimpleName();
private final SelectorType selectorType;
private int chooseMode;
private int videoMinSecond = 0;
private int videoMaxSecond = 0;
private int videoMaxSize = 50;
private boolean jumpLimit = false;
private boolean isCircleCrop = false;
public enum SelectorType {
PICTURE, VIDEO
}
public static abstract class OnPicSelectedListener {
public abstract void onSelected(List<String> paths);
public abstract void onError();
public void onCancel() {
Log.d(TAG, "OnUserIconSelectListener onCancel");
}
}
public PicSelectorHelper(@NonNull SelectorType selectorType) {
this.selectorType = selectorType;
switch (selectorType) {
case PICTURE:
chooseMode = PictureMimeType.ofImage();
break;
case VIDEO:
chooseMode = PictureMimeType.ofVideo();
break;
default:
Log.w(TAG, "PicSelectorHelper: 未匹配到 selector type");
chooseMode = PictureMimeType.ofImage();
break;
}
}
/**
* dialog 样式的选择器。
*/
public void showPicDialogWithCrop(@NonNull Activity activity, OnPicSelectedListener onPicSelectedListener) {
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(activity);
bottomSheetDialog.setTextColor(ResourcesUtils.getColor(R.color.app_com_text_2626));
bottomSheetDialog.setBackgroundColorTintList(ResourcesUtils.getColor(R.color.app_com_bg_color));
View.OnClickListener listener = new View.OnClickListener() {
@Override
public void onClick(View v) {
int id = v.getId();
if (R.id.btn_take_photo == id) {
PictureSelectionModel model = onTakePhoto(activity);
configBase(model, activity);
model.isEnableCrop(true)// 是否裁剪
.circleDimmedLayer(false)// 是否圆形裁剪
.cutOutQuality(90)// 裁剪输出质量 默认100
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽
.withAspectRatio(1, 1)// 裁剪比例 如16:9 3:2 3:4 1:1 可自定义
.showCropFrame(true)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false
.showCropGrid(true)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false
.rotateEnabled(false) // 裁剪是否可旋转图片
.scaleEnabled(true)// 裁剪是否可放大缩小图片
.renameCropFileName(System.currentTimeMillis() + ".jpg")// 重命名裁剪文件名、 注意这个不要重复,只适用于单张图裁剪使用
.setCropDimmedColor(ResourcesUtils.getColor(R.color.transparent))// 设置裁剪背景色值
// .setCircleDimmedBorderColor(ContextCompat.getColor(getApplicationContext(), R.color.app_color_white))// 设置圆形裁剪边框色值
// .setCircleStrokeWidth(3)// 设置圆形裁剪边框粗细
;
configMaxNum(model, 1);
model.forResult(new UserIconSelectCallback(onPicSelectedListener));
} else if (R.id.btn_photo_album == id) {
PictureSelectionModel model = onOpenAlbum(activity);
configBase(model, activity);
model.isEnableCrop(true)// 是否裁剪
.circleDimmedLayer(false)// 是否圆形裁剪
.cutOutQuality(90)// 裁剪输出质量 默认100
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽
.withAspectRatio(1, 1)// 裁剪比例 如16:9 3:2 3:4 1:1 可自定义
.showCropFrame(true)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false
.showCropGrid(true)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false
.rotateEnabled(false) // 裁剪是否可旋转图片
.scaleEnabled(true)// 裁剪是否可放大缩小图片
.renameCropFileName(System.currentTimeMillis() + ".jpg")// 重命名裁剪文件名、 注意这个不要重复,只适用于单张图裁剪使用
.setCropDimmedColor(ResourcesUtils.getColor(R.color.transparent))// 设置裁剪背景色值
// .setCircleDimmedBorderColor(ContextCompat.getColor(getApplicationContext(), R.color.app_color_white))// 设置圆形裁剪边框色值
// .setCircleStrokeWidth(3)// 设置圆形裁剪边框粗细
;
configMaxNum(model, 1);
model.forResult(new UserIconSelectCallback(onPicSelectedListener));
}
bottomSheetDialog.dismiss();
}
};
bottomSheetDialog.setClickListener(listener);
bottomSheetDialog.show();
}
/***
* 跳出限制(动态外部处理)
* @param jumpLimit
* @return
*/
public PicSelectorHelper setJumpLimit(boolean jumpLimit) {
this.jumpLimit = jumpLimit;
return this;
}
/**
* 选择头像。
*/
public void selectUserIcon(final Activity activity,
final OnPicSelectedListener onPicSelectedListener) {
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(activity);
View.OnClickListener listener = new View.OnClickListener() {
@Override
public void onClick(View v) {
int id = v.getId();
if (R.id.btn_take_photo == id) {
onUserIconTakePhoto(activity, new UserIconSelectCallback(onPicSelectedListener));
} else if (R.id.btn_photo_album == id) {
onUserIconOpenAlbum(activity, new UserIconSelectCallback(onPicSelectedListener));
}
bottomSheetDialog.dismiss();
}
};
bottomSheetDialog.setClickListener(listener);
bottomSheetDialog.show();
}
private void onUserIconOpenAlbum(Activity activity,
UserIconSelectCallback userIconSelectCallback) {
PictureSelectionModel model = onOpenAlbum(activity);
configBase(model, activity);
configUserIcon(model);
configMaxNum(model, 1);
model.selectionMode(PictureConfig.SINGLE);//单选
model.forResult(userIconSelectCallback);
}
private void onUserIconTakePhoto(@NonNull Activity activity,
UserIconSelectCallback userIconSelectCallback) {
PictureSelectionModel model = onTakePhoto(activity);
configUserIcon(model);
configTakePhoto(model);
configMaxNum(model, 1);
model.selectionMode(PictureConfig.SINGLE);//单选
model.forResult(userIconSelectCallback);
}
/**
* 直接打开相册。
*/
public void openAlbum(@NonNull Activity activity, int maxSelectNum, OnPicSelectedListener onPicSelectedListener) {
PictureSelectionModel model = onOpenAlbum(activity);
configBase(model, activity);
configMaxNum(model, maxSelectNum);
model.forResult(new CommonSelectCallback(onPicSelectedListener));
}
/**
* 直接打开相机。
*/
public void takePhoto(@NonNull Activity activity, int maxSelectNum, OnPicSelectedListener onPicSelectedListener) {
PictureSelectionModel model = onTakePhoto(activity);
configTakePhoto(model);
configMaxNum(model, maxSelectNum);
model.forResult(new CommonSelectCallback(onPicSelectedListener));
}
/**
* dialog 样式的选择器。
*/
public void showPicSelectorDialog(@NonNull Activity activity, int maxSelectNum,
OnPicSelectedListener onPicSelectedListener) {
showPicSelectorDialogWithDismiss(activity,maxSelectNum,onPicSelectedListener,null);
}
public interface OnDialogListener{
void onDismiss();
}
public OnDialogListener mOnDialogListener;
/**
* dialog 样式的选择器。
*/
public void showPicSelectorDialogWithDismiss(@NonNull Activity activity, int maxSelectNum,
OnPicSelectedListener onPicSelectedListener,OnDialogListener onDialogListener) {
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(activity);
View.OnClickListener listener = new View.OnClickListener() {
@Override
public void onClick(View v) {
int id = v.getId();
if (R.id.btn_take_photo == id) {
takePhoto(activity, maxSelectNum, onPicSelectedListener);
} else if (R.id.btn_photo_album == id) {
openAlbum(activity, maxSelectNum, onPicSelectedListener);
}else {
if (onDialogListener!=null){
onDialogListener.onDismiss();
}
}
bottomSheetDialog.dismiss();
}
};
bottomSheetDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
if (onDialogListener!=null){
onDialogListener.onDismiss();
}
}
});
bottomSheetDialog.setClickListener(listener);
bottomSheetDialog.show();
}
@io.reactivex.annotations.NonNull
private PictureSelectionModel onOpenAlbum(Activity activity) {
return PictureSelector.create(activity).openGallery(chooseMode);
}
@io.reactivex.annotations.NonNull
private PictureSelectionModel onTakePhoto(Activity activity) {
return PictureSelector.create(activity).openCamera(chooseMode);
}
private void configMaxNum(PictureSelectionModel model, int maxNum) {
model.maxSelectNum(maxNum);
}
private void configUserIcon(PictureSelectionModel model) {
model.isEnableCrop(true)// 是否裁剪
.circleDimmedLayer(isCircleCrop)// 是否圆形裁剪
.cutOutQuality(90)// 裁剪输出质量 默认100
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽
.withAspectRatio(1, 1)// 裁剪比例 如16:9 3:2 3:4 1:1 可自定义
.showCropFrame(!isCircleCrop)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false
.showCropGrid(!isCircleCrop)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false
.rotateEnabled(false) // 裁剪是否可旋转图片
.scaleEnabled(true)// 裁剪是否可放大缩小图片
// .renameCropFileName(System.currentTimeMillis() + ".jpg")// 重命名裁剪文件名、 注意这个不要重复,只适用于单张图裁剪使用
.setCropDimmedColor(ResourcesUtils.getColor(R.color.transparent))// 设置裁剪背景色值
// .setCircleDimmedBorderColor(ContextCompat.getColor(getApplicationContext(), R.color.app_color_white))// 设置圆形裁剪边框色值
// .setCircleStrokeWidth(3)// 设置圆形裁剪边框粗细
;
}
private void configBase(PictureSelectionModel model, Context context) {
model.imageEngine(GlideEngine.createGlideEngine())// 外部传入图片加载引擎,必传项
.isMaxSelectEnabledMask(true)// 选择数到了最大阀值列表是否启用蒙层效果
.minSelectNum(1)// 最小选择数量
.setPictureStyle(getPictureParameterStyle(context))
.imageSpanCount(4)// 每行显示个数
.isReturnEmpty(false)// 未选择数据时点击按钮是否可以返回
.closeAndroidQChangeWH(true)//如果图片有旋转角度则对换宽高,默认为true
.closeAndroidQChangeVideoWH(!SdkVersionUtils.checkedAndroid_Q())// 如果视频有旋转角度则对换宽高,默认false
.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)// 设置相册Activity方向,不设置默认使用系统
.selectionMode(PictureConfig.MULTIPLE)// 多选 or 单选
.isPreviewImage(true)// 是否可预览图片
.isPreviewVideo(false)// 是否可预览视频
.isCamera(true)// 是否显示拍照按钮
.isZoomAnim(true)// 图片列表点击 缩放效果 默认true
.isCompress(true)// 是否压缩
.compressQuality(50)// 图片压缩后输出质量 0~ 100
.synOrAsy(false)//同步true或异步false 压缩 默认同步
// .queryMaxFileSize(videoMaxSize)// 只查多少M以内的图片、视频、音频 单位M
//.compressSavePath(getPath())//压缩图片保存地址
//.sizeMultiplier(0.5f)// glide 加载图片大小 0~1之间 如设置 .glideOverride()无效 注:已废弃
.isGif(false)// 是否显示gif图片
.minimumCompressSize(2048);// 小于多少kb的图片不压缩
configImageFormat(model);
}
private void configImageFormat(PictureSelectionModel model) {
String suffixType = PictureMimeType.PNG;
switch (selectorType) {
case PICTURE:
suffixType = SdkVersionUtils.checkedAndroid_Q() ? PictureMimeType.PNG_Q : PictureMimeType.PNG;
break;
case VIDEO:
suffixType = SdkVersionUtils.checkedAndroid_Q() ? PictureMimeType.MIME_TYPE_VIDEO : PictureMimeType.MIME_TYPE_VIDEO;
if (videoMinSecond != 0 || videoMaxSecond != 0) {
model.videoMinSecond(videoMinSecond);
model.recordVideoSecond(videoMaxSecond);
} else {
model.recordVideoSecond(30);//录制视频秒数 默认30s
}
break;
default:
Log.w(TAG, "PicSelectorHelper: 未匹配到 selector type");
break;
}
model.imageFormat(suffixType);
}
private void configTakePhoto(PictureSelectionModel model) {
model.imageEngine(GlideEngine.createGlideEngine())// 外部传入图片加载引擎,必传项
.isUseCustomCamera(false)// 是否使用自定义相机
//.setOutputCameraPath()// 自定义相机输出目录,只针对Android Q以下,例如 Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + File.separator + "Camera" + File.separator;
.minSelectNum(1)// 最小选择数量
.closeAndroidQChangeWH(true)//如果图片有旋转角度则对换宽高,默认为true
.closeAndroidQChangeVideoWH(!SdkVersionUtils.checkedAndroid_Q())// 如果视频有旋转角度则对换宽高,默认false
//.cameraFileName(System.currentTimeMillis() + ".jpg")// 使用相机时保存至本地的文件名称,注意这个只在拍照时可以使用
//.renameCompressFile(System.currentTimeMillis() + ".jpg")// 重命名压缩文件名、 注意这个不要重复,只适用于单张图压缩使用
// .renameCropFileName(System.currentTimeMillis() + ".jpg")// 重命名裁剪文件名、 注意这个不要重复,只适用于单张图裁剪使用
.loadCacheResourcesCallback(GlideCacheEngine.createCacheEngine())// 获取图片资源缓存,主要是解决华为10部分机型在拷贝文件过多时会出现卡的问题,这里可以判断只在会出现一直转圈问题机型上使用
.isCompress(true)// 是否压缩
//.videoQuality()// 视频录制质量 0 or 1
.minimumCompressSize(2048)// 小于100kb的图片不压缩
;
}
private static class UserIconSelectCallback implements OnResultCallbackListener<LocalMedia> {
private final OnPicSelectedListener onPicSelectedListener;
public UserIconSelectCallback(OnPicSelectedListener onPicSelectedListener) {
this.onPicSelectedListener = onPicSelectedListener;
}
@Override
public void onResult(List<LocalMedia> result) {
if (null == onPicSelectedListener) {
return;
}
if (null != result && result.size() != 0) {
List<String> compressPathList = new ArrayList<>();
for (LocalMedia localMedia : result) {
compressPathList.add(localMedia.getCutPath());
}
onPicSelectedListener.onSelected(compressPathList);
} else {
onPicSelectedListener.onError();
}
}
@Override
public void onCancel() {
Log.i(TAG, "PictureSelector Cancel");
if (null == onPicSelectedListener) {
return;
}
onPicSelectedListener.onCancel();
}
}
private static class CommonSelectCallback implements OnResultCallbackListener<LocalMedia> {
private final OnPicSelectedListener onPicSelectedListener;
public CommonSelectCallback(OnPicSelectedListener onPicSelectedListener) {
this.onPicSelectedListener = onPicSelectedListener;
}
@Override
public void onResult(List<LocalMedia> result) {
if (null == onPicSelectedListener) {
return;
}
if (null != result && result.size() != 0) {
List<String> compressPathList = new ArrayList<>();
for (LocalMedia localMedia : result) {
compressPathList.add(localMedia.getCompressPath());
}
onPicSelectedListener.onSelected(compressPathList);
} else {
onPicSelectedListener.onError();
}
}
@Override
public void onCancel() {
if (null == onPicSelectedListener) {
return;
}
Log.i(TAG, "PictureSelector Cancel");
onPicSelectedListener.onCancel();
}
}
/**
* 参考代码
* 代码设置肤色:https://github.com/LuckSiege/PictureSelector/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%8A%A8%E6%80%81%E4%B8%BB%E9%A2%98(%E5%8C%85%E5%90%AB%E8%A3%81%E5%89%AA%E3%80%81%E7%9B%B8%E5%86%8C%E5%90%AF%E5%8A%A8%E5%8A%A8%E7%94%BB)-Code%E6%96%B9%E5%BC%8F
* xml设置肤色:https://github.com/LuckSiege/PictureSelector/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%BB%E9%A2%98-Xml%E6%96%B9%E5%BC%8F
*
* @param context
* @return
*/
private PictureParameterStyle getPictureParameterStyle(Context context) {
// 相册主题
PictureParameterStyle mPictureParameterStyle = new PictureParameterStyle();
//相册父容器背景色
mPictureParameterStyle.pictureContainerBackgroundColor = ResourcesUtils.getColor(R.color.app_content_bg_color);
// 是否改变状态栏字体颜色(黑白切换)
mPictureParameterStyle.isChangeStatusBarFontColor = false;
// 是否开启右下角已完成(0/9)风格
mPictureParameterStyle.isOpenCompletedNumStyle = false;
// 是否开启类似QQ相册带数字选择风格
mPictureParameterStyle.isOpenCheckNumStyle = false;
// 相册状态栏背景色
mPictureParameterStyle.pictureStatusBarColor = ResourcesUtils.getColor(R.color.app_all_white);
// 相册列表标题栏背景色
mPictureParameterStyle.pictureTitleBarBackgroundColor = ResourcesUtils.getColor(R.color.app_all_white);
// TODO: 2021/9/23 替换为svg 图片变更颜色
// 相册列表标题栏右侧上拉箭头
mPictureParameterStyle.pictureTitleUpResId = R.drawable.shape_transparent;
// 相册列表标题栏右侧下拉箭头
mPictureParameterStyle.pictureTitleDownResId = R.drawable.shape_transparent;
// 相册文件夹列表选中圆点
mPictureParameterStyle.pictureFolderCheckedDotStyle = R.drawable.picture_orange_oval;
// 相册返回箭头
mPictureParameterStyle.pictureLeftBackIcon = R.drawable.picture_icon_back_arrow;
// 标题栏字体颜色
mPictureParameterStyle.pictureTitleTextColor = ResourcesUtils.getColor(R.color.app_com_text_2626);
// 相册右侧取消按钮字体颜色
mPictureParameterStyle.pictureCancelTextColor = ResourcesUtils.getColor(R.color.app_com_red_5257);
// 相册列表勾选图片样式
mPictureParameterStyle.pictureCheckedStyle = R.drawable.picture_checkbox_selector;
// 选择相册目录背景样式
// mPictureParameterStyle.pictureAlbumStyle = R.drawable.picture_new_item_select_bg;
// 相册列表底部背景色
mPictureParameterStyle.pictureBottomBgColor = ContextCompat.getColor(context, R.color.picture_color_fa);
// 已选数量圆点背景样式
mPictureParameterStyle.pictureCheckNumBgStyle = R.color.transparent;
// 相册列表底下预览文字色值(预览按钮可点击时的色值)
mPictureParameterStyle.picturePreviewTextColor = ResourcesUtils.getColor(context, R.color.app_com_text_2626);
// 相册列表底下不可预览文字色值(预览按钮不可点击时的色值)
mPictureParameterStyle.pictureUnPreviewTextColor = ResourcesUtils.getColor(context, R.color.picture_color_9b);
// 相册列表已完成色值(已完成 可点击色值)
mPictureParameterStyle.pictureCompleteTextColor = ResourcesUtils.getColor(R.color.app_com_blue);
// 相册列表未完成色值(请选择 不可点击色值)
mPictureParameterStyle.pictureUnCompleteTextColor = ContextCompat.getColor(context, R.color.picture_color_9b);
// 预览界面底部背景色
mPictureParameterStyle.picturePreviewBottomBgColor = ContextCompat.getColor(context, R.color.picture_color_grey_3e);
// 外部预览界面删除按钮样式
mPictureParameterStyle.pictureExternalPreviewDeleteStyle = R.drawable.picture_icon_delete;
// 外部预览界面是否显示删除按钮
mPictureParameterStyle.pictureExternalPreviewGonePreviewDelete = true;
// 相册右侧按钮背景样式,只针对isWeChatStyle 为true时有效果
mPictureParameterStyle.pictureUnCompleteBackgroundStyle = R.drawable.shape_com_wit_round_btn;
// 相册右侧按钮可点击背景样式,只针对isWeChatStyle 为true时有效果
mPictureParameterStyle.pictureCompleteBackgroundStyle = R.drawable.shape_com_wit_round_btn;
// 以下设置如果用不上则不要设置,使用默认即可
// 自定义相册右侧文本内容设置
mPictureParameterStyle.pictureRightDefaultText = " ";
// 自定义相册未完成文本内容
mPictureParameterStyle.pictureUnCompleteText = "请选择";
// 完成文案是否采用(%1$d/%2$d)的字符串,只允许两个占位符哟
mPictureParameterStyle.isCompleteReplaceNum = true;
// 自定义相册完成文本内容
mPictureParameterStyle.pictureCompleteText = "确定";
// 自定义相册列表不可预览文字
mPictureParameterStyle.pictureUnPreviewText = "预览";
// 自定义相册列表预览文字
mPictureParameterStyle.picturePreviewText = "预览";
// 自定义相册标题字体大小
mPictureParameterStyle.pictureTitleTextSize = 18;
// 自定义相册右侧文字大小
mPictureParameterStyle.pictureRightTextSize = 14;
// 自定义相册预览文字大小
mPictureParameterStyle.picturePreviewTextSize = 14;
// 自定义相册完成文字大小
mPictureParameterStyle.pictureCompleteTextSize = 14;
// 自定义原图文字大小
mPictureParameterStyle.pictureOriginalTextSize = 14;
return mPictureParameterStyle;
}
}
4.需要引用的图片选择库
implementation io.github.lucksiege:pictureselector:v2.7.3-rc09
|