diff --git a/README.md b/README.md index 6258129ba..04b8a1bca 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +# 수정사항 +1. Doctalk Service에 맞게 커스텀 +2. 디자인 수정 +3. 코드 정리 + # PictureSelector 2.0 A Picture Selector for Android platform, support from the album to obtain pictures, video, audio & photo, support crop (single picture or multi-picture crop), compression, theme custom configuration and other functions, support dynamic access & adapt to Android 5.0+ system of open source picture selection framework。
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1df413089..9eb7e76a5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,11 +6,8 @@ - - - diff --git a/app/src/main/java/com/luck/pictureselector/style/PictureUtils.java b/app/src/main/java/com/luck/pictureselector/style/PictureUtils.java new file mode 100644 index 000000000..a8f6770b9 --- /dev/null +++ b/app/src/main/java/com/luck/pictureselector/style/PictureUtils.java @@ -0,0 +1,140 @@ +package com.luck.pictureselector.style; + +import android.content.Context; +import android.graphics.Color; + +import androidx.core.content.ContextCompat; + +import com.luck.picture.lib.app.IApp; +import com.luck.picture.lib.app.PictureAppMaster; +import com.luck.picture.lib.style.PictureParameterStyle; +import com.luck.picture.lib.style.PictureSelectorUIStyle; +import com.luck.pictureselector.R; + +public class PictureUtils { + + public static PictureSelectorUIStyle ofDoctalkStyle () { + PictureSelectorUIStyle uiStyle = new PictureSelectorUIStyle(); + + IApp app = PictureAppMaster.getInstance().getApp(); + Context context = app.getAppContext(); + if (context != null) { + + uiStyle.picture_statusBarBackgroundColor = ContextCompat.getColor(context, R.color.colorAccentDark); + uiStyle.picture_container_backgroundColor = ContextCompat.getColor(context, R.color.background_white); + + // uiStyle.picture_navBarColor = ContextCompat.getColor(context, R.color.background_gray); + + uiStyle.picture_check_style = R.drawable.selector_check; + + uiStyle.picture_top_leftBack = R.drawable.ic_back_white_normal; + uiStyle.picture_top_titleRightTextColor = new int[]{ContextCompat.getColor(context, R.color.text_white), ContextCompat.getColor(context, R.color.text_white)}; + uiStyle.picture_top_titleRightTextSize = 15; + uiStyle.picture_top_titleTextSize = 19; + uiStyle.picture_top_titleArrowUpDrawable = R.drawable.picture_icon_arrow_up; + uiStyle.picture_top_titleArrowDownDrawable = R.drawable.picture_icon_arrow_down; + uiStyle.picture_top_titleTextColor = ContextCompat.getColor(context, R.color.text_white); + uiStyle.picture_top_titleBarBackgroundColor = ContextCompat.getColor(context, R.color.colorAccent); + + uiStyle.picture_album_textSize = 15; + uiStyle.picture_album_backgroundStyle = R.drawable.picture_item_select_bg; + uiStyle.picture_album_textColor = ContextCompat.getColor(context, R.color.text_black); + uiStyle.picture_album_checkDotStyle = R.drawable.shape_circle_select; + + uiStyle.picture_bottom_previewTextSize = 13; + uiStyle.picture_bottom_previewTextColor = new int[]{ContextCompat.getColor(context, R.color.text_gray), ContextCompat.getColor(context, R.color.text_black)}; + + uiStyle.picture_bottom_completeRedDotTextSize = 11; + uiStyle.picture_bottom_completeTextSize = 13; + uiStyle.picture_bottom_completeRedDotTextColor = ContextCompat.getColor(context, R.color.text_white); + uiStyle.picture_bottom_completeRedDotBackground = R.drawable.shape_circle_select; + uiStyle.picture_bottom_completeTextColor = new int[]{ContextCompat.getColor(context, R.color.text_gray), ContextCompat.getColor(context, R.color.text_black)}; + uiStyle.picture_bottom_barBackgroundColor = ContextCompat.getColor(context, R.color.background_white); + + uiStyle.picture_adapter_item_camera_backgroundColor = ContextCompat.getColor(context, R.color.background_gray); + uiStyle.picture_adapter_item_camera_textColor = ContextCompat.getColor(context, R.color.text_white); + uiStyle.picture_adapter_item_camera_textSize = 15; + uiStyle.picture_adapter_item_camera_textTopDrawable = R.drawable.ic_camera; + + uiStyle.picture_adapter_item_textSize = 13; + uiStyle.picture_adapter_item_textColor = ContextCompat.getColor(context, R.color.text_white); + uiStyle.picture_adapter_item_video_textLeftDrawable = R.drawable.picture_icon_video; + uiStyle.picture_adapter_item_audio_textLeftDrawable = R.drawable.picture_icon_audio; + + uiStyle.picture_bottom_originalPictureTextSize = 13; + uiStyle.picture_bottom_originalPictureCheckStyle = R.drawable.picture_original_wechat_checkbox; + uiStyle.picture_bottom_originalPictureTextColor = ContextCompat.getColor(context, R.color.text_white); + uiStyle.picture_bottom_previewNormalText = R.string.picture_preview_num; + uiStyle.picture_bottom_originalPictureText = R.string.picture_original_image; + uiStyle.picture_bottom_completeDefaultText = R.string.picture_please_select; + uiStyle.picture_bottom_completeNormalText = R.string.picture_completed; + uiStyle.picture_adapter_item_camera_text = R.string.picture_take_picture; + uiStyle.picture_top_titleRightDefaultText = R.string.picture_done; + uiStyle.picture_bottom_previewDefaultText = R.string.picture_preview; + + // 如果文本内容设置(%1$d/%2$d),请开启true + uiStyle.isCompleteReplaceNum = true; + } + return uiStyle; + } + + + private PictureParameterStyle getNumStyle () { + // 相册主题 + PictureParameterStyle pictureParameterStyle = new PictureParameterStyle(); + + IApp app = PictureAppMaster.getInstance().getApp(); + Context context = app.getAppContext(); + if (context != null) { + // 是否改变状态栏字体颜色(黑白切换) + pictureParameterStyle.isChangeStatusBarFontColor = false; + // 是否开启右下角已完成(0/9)风格 + pictureParameterStyle.isOpenCompletedNumStyle = false; + // 是否开启类似QQ相册带数字选择风格 + pictureParameterStyle.isOpenCheckNumStyle = true; + // 相册状态栏背景色 + pictureParameterStyle.pictureStatusBarColor = Color.parseColor("#7D7DFF"); + // 相册列表标题栏背景色 + pictureParameterStyle.pictureTitleBarBackgroundColor = Color.parseColor("#7D7DFF"); + // 相册列表标题栏右侧上拉箭头 + pictureParameterStyle.pictureTitleUpResId = R.drawable.picture_icon_arrow_up; + // 相册列表标题栏右侧下拉箭头 + pictureParameterStyle.pictureTitleDownResId = R.drawable.picture_icon_arrow_down; + // 相册文件夹列表选中圆点 + pictureParameterStyle.pictureFolderCheckedDotStyle = R.drawable.picture_orange_oval; + // 相册返回箭头 + pictureParameterStyle.pictureLeftBackIcon = R.drawable.picture_icon_back; + // 标题栏字体颜色 + pictureParameterStyle.pictureTitleTextColor = ContextCompat.getColor(context, R.color.app_color_white); + // 相册右侧取消按钮字体颜色 废弃 改用.pictureRightDefaultTextColor和.pictureRightDefaultTextColor + pictureParameterStyle.pictureCancelTextColor = ContextCompat.getColor(context, R.color.app_color_white); + // 选择相册目录背景样式 + pictureParameterStyle.pictureAlbumStyle = R.drawable.picture_new_item_select_bg; + // 相册列表勾选图片样式 + pictureParameterStyle.pictureCheckedStyle = R.drawable.picture_checkbox_num_selector; + // 相册列表底部背景色 + pictureParameterStyle.pictureBottomBgColor = ContextCompat.getColor(context, R.color.picture_color_fa); + // 已选数量圆点背景样式 + pictureParameterStyle.pictureCheckNumBgStyle = R.drawable.picture_num_oval_blue; + // 相册列表底下预览文字色值(预览按钮可点击时的色值) + pictureParameterStyle.picturePreviewTextColor = ContextCompat.getColor(context, R.color.picture_color_blue); + // 相册列表底下不可预览文字色值(预览按钮不可点击时的色值) + pictureParameterStyle.pictureUnPreviewTextColor = ContextCompat.getColor(context, R.color.app_color_blue); + // 相册列表已完成色值(已完成 可点击色值) + pictureParameterStyle.pictureCompleteTextColor = ContextCompat.getColor(context, R.color.app_color_blue); + // 相册列表未完成色值(请选择 不可点击色值) + pictureParameterStyle.pictureUnCompleteTextColor = ContextCompat.getColor(context, R.color.app_color_blue); + // 预览界面底部背景色 + pictureParameterStyle.picturePreviewBottomBgColor = ContextCompat.getColor(context, R.color.picture_color_fa); + // 原图按钮勾选样式 需设置.isOriginalImageControl(true); 才有效 + pictureParameterStyle.pictureOriginalControlStyle = R.drawable.picture_original_blue_checkbox; + // 原图文字颜色 需设置.isOriginalImageControl(true); 才有效 + pictureParameterStyle.pictureOriginalFontColor = ContextCompat.getColor(context, R.color.app_color_blue); + // 外部预览界面删除按钮样式 + pictureParameterStyle.pictureExternalPreviewDeleteStyle = R.drawable.picture_icon_delete; + // 外部预览界面是否显示删除按钮 + pictureParameterStyle.pictureExternalPreviewGonePreviewDelete = true; + } + return pictureParameterStyle; + } +} diff --git a/app/src/main/res/drawable/ic_back_white_normal.xml b/app/src/main/res/drawable/ic_back_white_normal.xml new file mode 100644 index 000000000..8c689c9a8 --- /dev/null +++ b/app/src/main/res/drawable/ic_back_white_normal.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_camera.xml b/app/src/main/res/drawable/ic_camera.xml new file mode 100644 index 000000000..9b87a0891 --- /dev/null +++ b/app/src/main/res/drawable/ic_camera.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/drawable/ic_check_normal.xml b/app/src/main/res/drawable/ic_check_normal.xml new file mode 100644 index 000000000..171302d87 --- /dev/null +++ b/app/src/main/res/drawable/ic_check_normal.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_check_selected.xml b/app/src/main/res/drawable/ic_check_selected.xml new file mode 100644 index 000000000..01b6802c9 --- /dev/null +++ b/app/src/main/res/drawable/ic_check_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/selector_check.xml b/app/src/main/res/drawable/selector_check.xml new file mode 100644 index 000000000..708693de2 --- /dev/null +++ b/app/src/main/res/drawable/selector_check.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_circle_select.xml b/app/src/main/res/drawable/shape_circle_select.xml new file mode 100644 index 000000000..352b4ce1f --- /dev/null +++ b/app/src/main/res/drawable/shape_circle_select.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 7f8604d60..e21c09cf6 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -15,4 +15,77 @@ #9b9b9b #E0FF6100 #FF0000 + + + #13bb00 + #0d8200 + #13bb00 + #13bb00 + #13bb00 + + #ff5edb + #84b000 + #00cd20 + #00cbcd + #2046e7 + #b612ea + #f88e06 + #ffc200 + + #F0F0F0 + #000000 + #AAAAAA + #FF4500 + + #FFFFFF + #000000 + #4a4a4a + #7A7A7A + #AAAAAA + #3e4759 + #647188 + #FFFFFF + #798bac + + #3F4558 + #FFFFFF + #f0f0f0 + #000000 + #647188 + #7A7A7A + #4a4a4a + #AAAAAA + #3e4759 + #FF4500 + #ff002c + + #f0f0f0 + + #FF7E00 + + #FFFFFF + #f0f0f0 + #d4dbe8 + #C6CFDF + #DADADA + #8f9fbf + #000000 + #FF5C78 + + #4460a0 + #13bb00 + #13bb00 + + #249676 + + #F8F8F8 + #5A5A5A + #2C2C2C + #7A7A7A + + #80000000 + #CABBBBBB + #80f2798d + #88000000 + #BBFFFFFF diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 376e359b8..fea2156a7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ - PictureSelector - 拖动到此处删除 - 松手即可删除 - 发送 - 发送(%1$d/%2$d) + PictureSelector + 삭제하려면 여기로 드래그 하세요 + 삭제하기 + 확인 + 확인(%1$d/%2$d) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index babd47a0b..f6d4cc062 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Tue Apr 27 15:06:02 CST 2021 +#Tue Mar 30 14:33:22 KST 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 000000000..46c852919 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk11 \ No newline at end of file diff --git a/picture_library/build.gradle b/picture_library/build.gradle index 6756e4d72..93f490222 100644 --- a/picture_library/build.gradle +++ b/picture_library/build.gradle @@ -27,11 +27,9 @@ android { abortOnError false } - resourcePrefix 'ucrop_' +// resourcePrefix 'ucrop_' } -apply from: '../publish.gradle' - dependencies { implementation "androidx.appcompat:appcompat:${cfgs.version_appcompat}" implementation "androidx.recyclerview:recyclerview:${cfgs.version_recyclerview}" diff --git a/picture_library/src/main/AndroidManifest.xml b/picture_library/src/main/AndroidManifest.xml index 352f48aa2..c10e4a115 100644 --- a/picture_library/src/main/AndroidManifest.xml +++ b/picture_library/src/main/AndroidManifest.xml @@ -9,43 +9,43 @@ androidx.camera.core" /> - - - - - - - - - - - - - + + + + + + + + + + + + + resultLauncher) { + Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); + if (cameraIntent.resolveActivity(getPackageManager()) != null) { + Uri imageUri; + String cameraFileName = null; + String imageFormat = TextUtils.isEmpty(config.cameraImageFormat) ? config.suffixType : config.cameraImageFormat; + int chooseMode = config.chooseMode == PictureConfig.TYPE_ALL ? PictureConfig.TYPE_IMAGE : config.chooseMode; + if (!TextUtils.isEmpty(config.cameraFileName)) { + boolean isSuffixOfImage = PictureMimeType.isSuffixOfImage(config.cameraFileName); + config.cameraFileName = !isSuffixOfImage ? StringUtils.renameSuffix(config.cameraFileName, PictureMimeType.JPG) : config.cameraFileName; + cameraFileName = config.camera ? config.cameraFileName : StringUtils.rename(config.cameraFileName); + } + if (SdkVersionUtils.checkedAndroid_Q()) { + if (TextUtils.isEmpty(config.outPutCameraPath)) { + imageUri = MediaUtils.createImageUri(this, config.cameraFileName, imageFormat); + } else { + File cameraFile = PictureFileUtils.createCameraFile(this, + chooseMode, cameraFileName, imageFormat, config.outPutCameraPath); + config.cameraPath = cameraFile.getAbsolutePath(); + imageUri = PictureFileUtils.parUri(this, cameraFile); + } + if (imageUri != null) { + config.cameraPath = imageUri.toString(); + } + } else { + File cameraFile = PictureFileUtils.createCameraFile(this, chooseMode, cameraFileName, imageFormat, config.outPutCameraPath); + config.cameraPath = cameraFile.getAbsolutePath(); + imageUri = PictureFileUtils.parUri(this, cameraFile); + } + if (imageUri == null) { + ToastUtils.s(getContext(), "open is camera error,the uri is empty "); + if (config.camera) { + exit(); + } + return; + } + config.cameraMimeType = PictureMimeType.ofImage(); + if (config.isCameraAroundState) { + cameraIntent.putExtra(PictureConfig.CAMERA_FACING, PictureConfig.CAMERA_BEFORE); + } + cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); + resultLauncher.launch(cameraIntent); + } + } /** * start to camera、video */ + @Deprecated(message = "startActivityForResult Deprecated") protected void startOpenCameraVideo() { Intent cameraIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); if (cameraIntent.resolveActivity(getPackageManager()) != null) { @@ -774,9 +822,60 @@ protected void startOpenCameraVideo() { } } + /** + * start to camera、video + */ + protected void startOpenCameraVideo(ActivityResultLauncher resultLauncher) { + Intent cameraIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); + if (cameraIntent.resolveActivity(getPackageManager()) != null) { + Uri videoUri; + String cameraFileName = null; + String videoFormat = TextUtils.isEmpty(config.cameraVideoFormat) ? config.suffixType : config.cameraVideoFormat; + int chooseMode = config.chooseMode == PictureConfig.TYPE_ALL ? PictureConfig.TYPE_VIDEO : config.chooseMode; + if (!TextUtils.isEmpty(config.cameraFileName)) { + boolean isSuffixOfImage = PictureMimeType.isSuffixOfImage(config.cameraFileName); + config.cameraFileName = isSuffixOfImage ? StringUtils.renameSuffix(config.cameraFileName, PictureMimeType.MP4) : config.cameraFileName; + cameraFileName = config.camera ? config.cameraFileName : StringUtils.rename(config.cameraFileName); + } + if (SdkVersionUtils.checkedAndroid_Q()) { + if (TextUtils.isEmpty(config.outPutCameraPath)) { + videoUri = MediaUtils.createVideoUri(this, config.cameraFileName, videoFormat); + } else { + File cameraFile = PictureFileUtils.createCameraFile(this, chooseMode, cameraFileName, videoFormat, config.outPutCameraPath); + config.cameraPath = cameraFile.getAbsolutePath(); + videoUri = PictureFileUtils.parUri(this, cameraFile); + } + if (videoUri != null) { + config.cameraPath = videoUri.toString(); + } + } else { + File cameraFile = PictureFileUtils.createCameraFile(this, chooseMode, cameraFileName, videoFormat, config.outPutCameraPath); + config.cameraPath = cameraFile.getAbsolutePath(); + videoUri = PictureFileUtils.parUri(this, cameraFile); + } + if (videoUri == null) { + ToastUtils.s(getContext(), "open is camera error,the uri is empty "); + if (config.camera) { + exit(); + } + return; + } + config.cameraMimeType = PictureMimeType.ofVideo(); + cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri); + if (config.isCameraAroundState) { + cameraIntent.putExtra(PictureConfig.CAMERA_FACING, PictureConfig.CAMERA_BEFORE); + } + cameraIntent.putExtra(PictureConfig.EXTRA_QUICK_CAPTURE, config.isQuickCapture); + cameraIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, config.recordVideoSecond); + cameraIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, config.videoQuality); + resultLauncher.launch(cameraIntent); + } + } + /** * start to camera audio */ + @Deprecated(message = "startActivityForResult Deprecated") public void startOpenCameraAudio() { try { if (PermissionChecker.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)) { @@ -808,7 +907,41 @@ public void startOpenCameraAudio() { e.printStackTrace(); ToastUtils.s(getContext(), e.getMessage()); } + } + /** + * start to camera audio + */ + public void startOpenCameraAudio(ActivityResultLauncher resultLauncher) { + try { + if (PermissionChecker.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)) { + Intent cameraIntent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION); + if (cameraIntent.resolveActivity(getPackageManager()) != null) { + config.cameraMimeType = PictureMimeType.ofAudio(); + String audioFormat = TextUtils.isEmpty(config.cameraAudioFormat) ? config.suffixType : config.cameraAudioFormat; + if (SdkVersionUtils.checkedAndroid_Q()) { + Uri audioUri = MediaUtils.createAudioUri(this, audioFormat); + if (audioUri == null) { + ToastUtils.s(getContext(), "open is audio error,the uri is empty "); + if (config.camera) { + exit(); + } + return; + } + config.cameraPath = audioUri.toString(); + cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, audioUri); + } + resultLauncher.launch(cameraIntent); + } else { + ToastUtils.s(getContext(), "System recording is not supported"); + } + } else { + PermissionChecker.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, PictureConfig.APPLY_AUDIO_PERMISSIONS_CODE); + } + } catch (Exception e) { + e.printStackTrace(); + ToastUtils.s(getContext(), e.getMessage()); + } } /** @@ -859,19 +992,11 @@ protected void showPromptDialog(String content) { if (PictureSelectionConfig.onChooseLimitCallback != null) { PictureSelectionConfig.onChooseLimitCallback.onChooseLimit(getContext(), content); } else { - PictureCustomDialog dialog = new PictureCustomDialog(getContext(), R.layout.picture_prompt_dialog); - TextView btnOk = dialog.findViewById(R.id.btnOk); - TextView tvContent = dialog.findViewById(R.id.tv_content); - tvContent.setText(content); - btnOk.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (!isFinishing()) { - dialog.dismiss(); - } - } - }); - dialog.show(); + new AlertDialog.Builder(getContext()) + .setMessage(content) + .setPositiveButton(R.string.picture_know, (dialog, which) -> { + }) + .show(); } } } @@ -880,7 +1005,7 @@ public void onClick(View v) { /** * sort * - * @param imageFolders + * @param imageFolders image folder list */ protected void sortFolder(List imageFolders) { Collections.sort(imageFolders, (lhs, rhs) -> { diff --git a/picture_library/src/main/java/com/luck/picture/lib/PictureSelectionModel.java b/picture_library/src/main/java/com/luck/picture/lib/PictureSelectionModel.java index bbc824e1d..10f9055db 100644 --- a/picture_library/src/main/java/com/luck/picture/lib/PictureSelectionModel.java +++ b/picture_library/src/main/java/com/luck/picture/lib/PictureSelectionModel.java @@ -1711,11 +1711,40 @@ public void forResult(OnResultCallbackListener listener) { } } + /** + * Doctalk 사용 + * @param intent + * @param listener + */ + public void forResult (Intent intent, OnResultCallbackListener listener) { + if (!DoubleUtils.isFastDoubleClick()) { + Activity activity = selector.getActivity(); + if (activity == null || selectionConfig == null) { + return; + } + if (PictureSelectionConfig.imageEngine == null){ + throw new NullPointerException("api imageEngine is null,Please implement ImageEngine"); + } + // 绑定回调监听 + PictureSelectionConfig.listener = new WeakReference<>(listener).get(); + selectionConfig.isCallbackMode = true; + Fragment fragment = selector.getFragment(); + if (fragment != null) { + fragment.startActivity(intent); + } + else { + activity.startActivity(intent); + } + PictureWindowAnimationStyle windowAnimationStyle = PictureSelectionConfig.windowAnimationStyle; + activity.overridePendingTransition( + windowAnimationStyle.activityEnterAnimation, R.anim.picture_anim_fade_in); + } + } + /** * Start to select media and wait for result. * - * @param launcher use {@link #registerForActivityResult(ActivityResultContract, ActivityResultCallback)} - * passing in a {@link StartActivityForResult} object for the {@link ActivityResultContract}. + * @param launcher */ public void forResult(ActivityResultLauncher launcher) { if (!DoubleUtils.isFastDoubleClick()) { @@ -1742,6 +1771,27 @@ public void forResult(ActivityResultLauncher launcher) { } } + /** + * Start to select media and wait for result. + * + * @param launcher + */ + public void forResult(Intent intent, ActivityResultLauncher launcher) { + if (!DoubleUtils.isFastDoubleClick()) { + Activity activity = selector.getActivity(); + if (launcher == null || activity == null || selectionConfig == null) { + return; + } + if (PictureSelectionConfig.imageEngine == null){ + throw new NullPointerException("api imageEngine is null,Please implement ImageEngine"); + } + selectionConfig.isCallbackMode = false; + launcher.launch(intent); + PictureWindowAnimationStyle windowAnimationStyle = PictureSelectionConfig.windowAnimationStyle; + activity.overridePendingTransition(windowAnimationStyle.activityEnterAnimation, R.anim.picture_anim_fade_in); + } + } + /** * Start to select media and wait for result. * diff --git a/picture_library/src/main/java/com/luck/picture/lib/adapter/PictureImageGridAdapter.java b/picture_library/src/main/java/com/luck/picture/lib/adapter/PictureImageGridAdapter.java index 4d3333881..2d673276f 100644 --- a/picture_library/src/main/java/com/luck/picture/lib/adapter/PictureImageGridAdapter.java +++ b/picture_library/src/main/java/com/luck/picture/lib/adapter/PictureImageGridAdapter.java @@ -3,7 +3,9 @@ import android.annotation.SuppressLint; import android.content.Context; import android.graphics.ColorFilter; +import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; +import android.net.Uri; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -12,6 +14,7 @@ import android.widget.ImageView; import android.widget.TextView; +import androidx.appcompat.app.AlertDialog; import androidx.core.content.ContextCompat; import androidx.core.graphics.BlendModeColorFilterCompat; import androidx.core.graphics.BlendModeCompat; @@ -21,7 +24,6 @@ import com.luck.picture.lib.config.PictureConfig; import com.luck.picture.lib.config.PictureMimeType; import com.luck.picture.lib.config.PictureSelectionConfig; -import com.luck.picture.lib.dialog.PictureCustomDialog; import com.luck.picture.lib.entity.LocalMedia; import com.luck.picture.lib.listener.OnPhotoSelectChangedListener; import com.luck.picture.lib.tools.AnimUtils; @@ -777,18 +779,14 @@ public void selectImage(ViewHolder holder, boolean isChecked) { private void showPromptDialog(String content) { if (PictureSelectionConfig.onChooseLimitCallback != null) { PictureSelectionConfig.onChooseLimitCallback.onChooseLimit(context, content); - } else { - PictureCustomDialog dialog = new PictureCustomDialog(context, R.layout.picture_prompt_dialog); - TextView btnOk = dialog.findViewById(R.id.btnOk); - TextView tvContent = dialog.findViewById(R.id.tv_content); - tvContent.setText(content); - btnOk.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - dialog.dismiss(); - } - }); - dialog.show(); + } + else { + + new AlertDialog.Builder(context) + .setMessage(content) + .setPositiveButton(R.string.picture_know, (dialog, which) -> { + }) + .show(); } } diff --git a/picture_library/src/main/java/com/luck/picture/lib/manager/UCropManager.java b/picture_library/src/main/java/com/luck/picture/lib/manager/UCropManager.java index 2bf7aacf8..7581c7bdd 100644 --- a/picture_library/src/main/java/com/luck/picture/lib/manager/UCropManager.java +++ b/picture_library/src/main/java/com/luck/picture/lib/manager/UCropManager.java @@ -2,10 +2,13 @@ import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.text.TextUtils; +import androidx.activity.result.ActivityResultLauncher; + import com.luck.picture.lib.R; import com.luck.picture.lib.config.PictureMimeType; import com.luck.picture.lib.config.PictureSelectionConfig; @@ -87,6 +90,33 @@ public static void ofCrop(Activity activity, String originalPath, String mimeTyp .startAnimationActivity(activity, PictureSelectionConfig.windowAnimationStyle.activityCropEnterAnimation); } + /** + * 裁剪 + * + * @param activity 上下文 + * @param originalPath 文件源路径 + * @param mimeType 文件类型 + */ + public static void ofCrop(Activity activity, String originalPath, String mimeType, ActivityResultLauncher launcher) { + if (DoubleUtils.isFastDoubleClick()) { + return; + } + if (TextUtils.isEmpty(originalPath)) { + ToastUtils.s(activity.getApplicationContext(), activity.getString(R.string.picture_not_crop_data)); + return; + } + PictureSelectionConfig config = PictureSelectionConfig.getInstance(); + boolean isHttp = PictureMimeType.isHasHttp(originalPath); + String suffix = mimeType.replace("image/", "."); + File file = new File(PictureFileUtils.getDiskCacheDir(activity.getApplicationContext()), + TextUtils.isEmpty(config.renameCropFileName) ? DateUtils.getCreateFileName("IMG_CROP_") + suffix : config.renameCropFileName); + Uri uri = isHttp || PictureMimeType.isContent(originalPath) ? Uri.parse(originalPath) : Uri.fromFile(new File(originalPath)); + UCrop.Options options = UCropManager.basicOptions(activity); + UCrop.of(uri, Uri.fromFile(file)) + .withOptions(options) + .startAnimationActivity(activity, launcher, PictureSelectionConfig.windowAnimationStyle.activityCropEnterAnimation); + } + /** * 裁剪 * @@ -132,6 +162,51 @@ public static void ofCrop(Activity activity, ArrayList list) { } } + /** + * 裁剪 + * + * @param activity 上下文 + * @param list 待裁剪图片集合 + */ + public static void ofCrop(Activity activity, ArrayList list, ActivityResultLauncher launcher) { + if (DoubleUtils.isFastDoubleClick()) { + return; + } + if (list == null || list.size() == 0) { + ToastUtils.s(activity.getApplicationContext(), activity.getString(R.string.picture_not_crop_data)); + return; + } + PictureSelectionConfig config = PictureSelectionConfig.getInstance(); + UCrop.Options options = UCropManager.basicOptions(activity); + options.setCutListData(list); + int size = list.size(); + int index = 0; + if (config.chooseMode == PictureMimeType.ofAll() && config.isWithVideoImage) { + String mimeType = size > 0 ? list.get(index).getMimeType() : ""; + boolean isHasVideo = PictureMimeType.isHasVideo(mimeType); + if (isHasVideo) { + for (int i = 0; i < size; i++) { + LocalMedia cutInfo = list.get(i); + if (cutInfo != null && PictureMimeType.isHasImage(cutInfo.getMimeType())) { + index = i; + break; + } + } + } + } + if (index < size) { + LocalMedia info = list.get(index); + boolean isHttp = PictureMimeType.isHasHttp(info.getPath()); + Uri uri = isHttp || PictureMimeType.isContent(info.getPath()) ? Uri.parse(info.getPath()) : Uri.fromFile(new File(info.getPath())); + String suffix = info.getMimeType().replace("image/", "."); + File file = new File(PictureFileUtils.getDiskCacheDir(activity), + TextUtils.isEmpty(config.renameCropFileName) ? DateUtils.getCreateFileName("IMG_CROP_") + + suffix : config.camera || size == 1 ? config.renameCropFileName : StringUtils.rename(config.renameCropFileName)); + UCrop.of(uri, Uri.fromFile(file)).withOptions(options) + .startAnimationMultipleCropActivity(activity, PictureSelectionConfig.windowAnimationStyle.activityCropEnterAnimation, launcher); + } + } + /** * basicOptions diff --git a/picture_library/src/main/java/com/yalantis/ucrop/UCrop.java b/picture_library/src/main/java/com/yalantis/ucrop/UCrop.java index 3922c6b46..e36a3c62c 100755 --- a/picture_library/src/main/java/com/yalantis/ucrop/UCrop.java +++ b/picture_library/src/main/java/com/yalantis/ucrop/UCrop.java @@ -8,6 +8,7 @@ import android.os.Bundle; import android.os.Parcelable; +import androidx.activity.result.ActivityResultLauncher; import androidx.annotation.AnimRes; import androidx.annotation.ColorInt; import androidx.annotation.DrawableRes; @@ -26,6 +27,8 @@ import java.util.Arrays; import java.util.Locale; +import kotlin.Deprecated; + /** * Created by Oleksii Shliama (https://github.com/shliama). *

@@ -137,27 +140,63 @@ public void startAnimationActivity(@NonNull Activity activity, @AnimRes int acti } } + /** + * Send the crop Intent from animation an Activity + * + * @param activity Activity to receive result + */ + public void startAnimationActivity(@NonNull Activity activity, ActivityResultLauncher launcher, @AnimRes int activityCropEnterAnimation) { + if (activityCropEnterAnimation != 0) { + start(activity, launcher, activityCropEnterAnimation); + } else { + start(activity, launcher); + } + } + /** * Send the crop Intent from an Activity with a custom request code or animation * * @param activity Activity to receive result * @param requestCode requestCode for result */ + @Deprecated(message = "startActivityForResult deprecated") public void start(@NonNull Activity activity, int requestCode, @AnimRes int activityCropEnterAnimation) { activity.startActivityForResult(getIntent(activity), requestCode); activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in); } + /** + * Send the crop Intent from an Activity with a custom request code or animation + * + * @param activity Activity to receive result + * @param launcher result launcher + */ + public void start(@NonNull Activity activity, ActivityResultLauncher launcher, @AnimRes int activityCropEnterAnimation) { + launcher.launch(getIntent(activity)); + activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in); + } + /** * Send the crop Intent from an Activity with a custom request code * * @param activity Activity to receive result * @param requestCode requestCode for result */ + @Deprecated(message = "startActivityForResult deprecated") public void start(@NonNull Activity activity, int requestCode) { activity.startActivityForResult(getIntent(activity), requestCode); } + /** + * Send the crop Intent from an Activity with a custom request code + * + * @param activity Activity to receive result + * @param launcher result launcher + */ + public void start(@NonNull Activity activity, ActivityResultLauncher launcher) { + launcher.launch(getIntent(activity)); + } + /** * Send the crop Intent from an Activity * @@ -173,27 +212,19 @@ public void start(@NonNull AppCompatActivity activity) { * @param activity Activity to receive result * @param requestCode requestCode for result */ + @Deprecated(message = "startActivityForResult deprecated") public void start(@NonNull AppCompatActivity activity, int requestCode) { activity.startActivityForResult(getIntent(activity), requestCode); } /** - * Send the crop Intent from a Fragment - * - * @param fragment Fragment to receive result - */ - public void start(@NonNull Context context, @NonNull Fragment fragment) { - start(context, fragment, REQUEST_CROP); - } - - /** - * Send the crop Intent with a custom request code + * Send the crop Intent from an Activity with a custom request code * - * @param fragment Fragment to receive result - * @param requestCode requestCode for result + * @param activity Activity to receive result + * @param launcher result launcher */ - public void start(@NonNull Context context, @NonNull Fragment fragment, int requestCode) { - fragment.startActivityForResult(getIntent(context), requestCode); + public void start(@NonNull AppCompatActivity activity, ActivityResultLauncher launcher) { + launcher.launch(getIntent(activity)); } @@ -244,6 +275,45 @@ public void startMultiple(@NonNull Activity activity, int requestCode) { activity.startActivityForResult(getMultipleIntent(activity), requestCode); } + + /** + * 多图裁剪 + */ + /** + * Send the crop Intent from animation an Multiple Activity + * + * @param activity Activity to receive result + */ + public void startAnimationMultipleCropActivity(@NonNull Activity activity, + @AnimRes int activityCropEnterAnimation, ActivityResultLauncher launcher) { + if (activityCropEnterAnimation != 0) { + startMultiple(activity, launcher, activityCropEnterAnimation); + } else { + startMultiple(activity, launcher); + } + } + + /** + * Send the crop Intent from an Activity with a custom request code or animation + * + * @param activity Activity to receive result + * @param launcher requestCode for result + */ + public void startMultiple(@NonNull Activity activity, ActivityResultLauncher launcher, @AnimRes int activityCropEnterAnimation) { + launcher.launch(getMultipleIntent(activity)); + activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in); + } + + /** + * Send the crop Intent from an Activity with a custom request code + * + * @param activity Activity to receive result + * @param launcher requestCode for result + */ + public void startMultiple(@NonNull Activity activity, ActivityResultLauncher launcher) { + launcher.launch(getMultipleIntent(activity)); + } + /** * Get Intent to start {@link PictureMultiCuttingActivity} * diff --git a/picture_library/src/main/res/layout/picture_album_folder_item.xml b/picture_library/src/main/res/layout/picture_album_folder_item.xml index a09f9872e..ed9017356 100644 --- a/picture_library/src/main/res/layout/picture_album_folder_item.xml +++ b/picture_library/src/main/res/layout/picture_album_folder_item.xml @@ -6,6 +6,7 @@ android:orientation="vertical" android:padding="6dp"> + @@ -25,11 +26,12 @@ android:id="@+id/tv_folder_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="10dp" + android:layout_marginLeft="10dp" android:layout_marginTop="5dp" - android:layout_toEndOf="@id/first_image" + android:layout_toRightOf="@id/first_image" android:text="@string/picture_camera_roll_num" android:textColor="@color/picture_color_4d" android:textSize="16sp" /> + \ No newline at end of file diff --git a/picture_library/src/main/res/layout/picture_title_bar.xml b/picture_library/src/main/res/layout/picture_title_bar.xml index e0a03b4ab..d60e20262 100644 --- a/picture_library/src/main/res/layout/picture_title_bar.xml +++ b/picture_library/src/main/res/layout/picture_title_bar.xml @@ -2,7 +2,7 @@ - Kamerafilm - %1$s (%2$d) - Abbrechen - Schießen - Es kann nicht gleichzeitig ein Bild oder Video ausgewählt werden - Sie können bis zu %1$s Bilder auswählen - Die minimale Videoauswahl darf %1$s nicht unterschreiten - Sie können bis zu %1$s Videos auswählen - Sie können bis zu %1$s Audio auswählen - Vorschau - Bitte warten… - %1$d/%2$d Vervollständigen - Abgeschlossen - Vollständig - Bitte wählen Sie - Keine Videos oder Fotos\n - Keine Audiodatei\n - Sie können mit Ihrer Kamera ein Foto oder Video aufnehmen - Sie können Audio mit der Systemaufzeichnung aufnehmen - Die Mindestauswahl an Bildern darf %1$s nicht unterschreiten - gif - webp - Leseberechtigungen für Speicherkarten verweigert - Systemkameraberechtigung verweigert - Holen Sie sich die Systemaufzeichnungsberechtigung verweigert - Das Video kann nicht in der Vorschau angezeigt werden - Video aufnehmen - Kamera - Langes Bild - Keine Mediendateien! - Aufforderung - Gibt an, ob das Bild auf dem Telefon gespeichert werden soll? - Bildspeicherung fehlgeschlagen - Bild erfolgreich gespeichert - Alles Audio - Aufnahme - Spielen - Halt an - Ausfahrt - Anhalten - Bild ist beschädigt - Das Video ist beschädigt - Audio ist fehlerhaft - Gut - %1$d/%2$d - Keine Erntedaten verfügbar - Original (%1$s) - Original - Vollständig - Vollständig(%1$d/%2$d) - Siehe(%1$d) - Auswahl - Ausnahme von Album-Daten… - Die Aufnahmezeit ist zu kurz - Machen Sie ein Foto - Nur Videos innerhalb von %1$ds können ausgewählt werden - Video nicht weniger als %1$ds auswählen - Nur Videos innerhalb von %1$ds bis %2$ds können ausgewählt werden - - Fotografie - Lange Presse Videoband - Set up - Das stimmt - Hier ist es leer… - Edit - - Foto editieren - Original - Zuschneiden - Bewegen - diff --git a/picture_library/src/main/res/values-en-rUS/string.xml b/picture_library/src/main/res/values-en-rUS/string.xml deleted file mode 100644 index bef6339e6..000000000 --- a/picture_library/src/main/res/values-en-rUS/string.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - CameraRoll - %1$s (%2$d) - Cancel - Shot - not pictures or video - Video Selection Cannot%1$sNumber - Select up to %1$s images - Select up to %1$s Audio - Select up to %1$s Video - Preview - Please later… - %1$d/%2$d Ok - Completed - Complete - Please Select - No video or photos\n - No audio file\n - You can use system recordings to record audio - you can use your camera to take photos or videos - Picture Selection Cannot%1$sNumber - gif - webp - Access to system recording permission denied - Read memory card access denied - Get system camera permission denied - Video not Preview - Record Video - Photograph - Long - No Media files! - Prompt - Do you want to save pictures to your phone? - Picture save failed - Save picture successfully until - All audio - Tape - Play - Stop - Quit - Pause - The picture is corrupted - The video is corrupted - The audio is corrupted - Confirm - %1$d/%2$d - No cropped data - Original (%1$s) - Original - Complete - Complete(%1$d/%2$d) - Preview(%1$d) - Choose - Get album data exception… - recording time is too short - Photograph, photograph - You can only select videos within %1$ds - You cannot select a video less than %1$ds - Only videos from %1$ds to %2$ds can be selected - - Take Picture - Long Press Camera - Go Setting - Ok - There no data here… - Editor - - - Original - Edit Photo - - Crop - - Rotate - Scale - Crop - - gif - \ No newline at end of file diff --git a/picture_library/src/main/res/values-es-rES/string.xml b/picture_library/src/main/res/values-es-rES/string.xml deleted file mode 100644 index ca2fa5e48..000000000 --- a/picture_library/src/main/res/values-es-rES/string.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - Todos los audios - Permiso de acceso al sistema de grabación denegado - Puedes utilizar el sistema de grabación para grabar audios - Audio corrupto - Permiso de acceso a la cámara denegado - Galería - %1$s (%2$d) - Cancelar - Únicamente pueden seleccionarse videos entre %1$ds y %2$ds - Puedes seleccionar videos de no más de %1$ds - No puedes seleccionar videos de menos de %1$ds - Completado - Confirmar - Error al obtener datos de galería… - No hay nada aquí… - Completar - %1$d/%2$d Ok - Puedes utilizar tu cámara para tomar fotos o videos - No hay audios\n - No hay fotos o videos\n - Foto corrupta - gif - webp - Configuración - Acceso a la tarjeta de memoria denegado - Entendido - Imagen larga - Seleccciona hasta %1$s audios - Selecciona hasta %1$s fotos - Selecciona %1$s videos - Las imágenes seleccionadas no deben ser menos de %1$s - Los videos seleccionados no deben ser menos de %1$s - No hay datos - Original (%1$s) - Original - Pausar - Foto con clic, foto con clic extendido - Tomar foto con clic - Tomar foto con clic extendido - Tomar foto - Reproducir - Espera un momento… - Seleccionar - Vista previa - %1$d/%2$d - Vista previa(%1$d) - Aviso - ¿Guardar las imágenes en tu teléfono? - Salir - Grabar video - Tiempo de grabación demasiado breve - No pueden seleccionarse fotos y videos simultáneamente - Guardado fallido - Foto guardada exitosamente en - Seleccionar - Completar - Completar(%1$d/%2$d) - Detener - Capturar - Grabar - Video corrupto - No hay vista previa del video - No hay ningún archivo - Editar - - gif - Editar foto - Original - Recortar - \ No newline at end of file diff --git a/picture_library/src/main/res/values-fr-rFR/strings.xml b/picture_library/src/main/res/values-fr-rFR/strings.xml deleted file mode 100644 index 87866a1c5..000000000 --- a/picture_library/src/main/res/values-fr-rFR/strings.xml +++ /dev/null @@ -1,71 +0,0 @@ - - l’album - %1$s (%2$d) - l’abandon - photo - Il n’est pas possible de sélectionner des images ou des vidéos en même temps - Vous pouvez choisir, au maximum, une image en %1$s - La sélection minimale des vidéos ne peut être inférieure à %1$s - Vous pouvez choisir au maximum %1$s de vidéos - Vous pouvez choisir au maximum %1$s audio - avant-première - attendez… - %1$d/%2$d L’achèvement - achevés - L’achèvement du - Le choix - Pas de vidéos ou de photos\n - Pas de fichier audio\n - Vous pouvez utiliser votre caméra pour prendre des photos ou des vidéos - Vous pouvez utiliser le système d’enregistrement pour enregistrer l’audio - La sélection minimale des images ne doit pas être inférieure à %1$s - gif - webp - L’autorisation de lire la carte de mémoire a été refusée - L’accès à la caméra du système a été refusé - L’accès au système d’enregistrement est refusé - Vidéo non disponible - Enregistrement vidéo - photo - Figure longue - Pas de documents pour les médias! - rappel - Conserver ou non une image sur un téléphone portable? - Défaut de conservation des images - Image conservée avec succès - Tous audio - Les transcriptions in extenso - diffusion - cessation - Le retrait - La suspension - Image endommagée - Vidéo endommagée - Audio endommagé - déterminer - %1$d/%2$d - Pas de données recadrées - Original (%1$s) - Original - Finir - Finir(%1$d/%2$d) - voir(%1$d) - Le choix - Anomalie des données de l’album… - La durée d’enregistrement est trop courte - Prendre des photos, filmer - Vous pouvez sélectionner la vidéo dans un maximum de %1$ds - Impossible de sélectionner une vidéo en dessous de %1$ds - Vous ne pouvez sélectionner que les vidéos dans les %1$ds à %2$ds - - Clic photo - Imagerie - Je sais - Pas de données… - Édition - - Original - Modifier la photo - Recadrer - Bouge fig - diff --git a/picture_library/src/main/res/values-ja-rJP/strings.xml b/picture_library/src/main/res/values-ja-rJP/strings.xml deleted file mode 100644 index 779c5977d..000000000 --- a/picture_library/src/main/res/values-ja-rJP/strings.xml +++ /dev/null @@ -1,72 +0,0 @@ - - カメラ - %1$s (%2$d) - キャンセル - カメラ - 画像や動画を同時に選択することはできない - 最大で %1$s 枚の画像を選択することができます - ビデオの最低選択数は %1$s 個までである - 最大で %1$s のビデオを選択できます - 最大で %1$s の音声を選択することができます - プレビュー - ちょっと待ってください… - %1$d/%2$d 選べた - 選べた - 選べた - 選んでください - ビデオや写真はない\n - オーディオなし\n - カメラを使って写真やビデオを撮ることができます - システムを使って音声を録音することができます - 画像の最低値は %1$s 枚までとする - 动図 - webp - メモリーカードの読み取り権限が拒否された - システムカメラの取得権限は拒否される - システムの録音権の取得は拒否される - ビデオプレビュー不可 - 録画ビデオ - 撮影 - 長い図 - メディアファイル! - 提示 - 画像を携帯電話に保存します? - 画像の保存に失敗 - 写真保存に成功まで - 全てのオーディオ - 録音 - 放送 - 停止 - 退出 - 暂停 - 画像が破損した - 映像が壊れた - オーディオが破損した - 確定 - %1$d/%2$d - トリミングされたデータはありません - 原図 (%1$s) - 原図 - を選択します - を選択します(%1$d/%2$d) - プレビュー(%1$d) - 選択 - アルバムデータ取得異常... - 収録時間が短すぎる - 写真を撮る - 最大 %1$ds 以内のビデオしか選択できません - %1$ds 以下のビデオは選択できません - %1$ds sから %2$ds までのビデオしか選択できません - 写真を撮る - 長押しする - 設定 - はい - データがありません… - 編集 - - 元の比率 - 切り取り - - 切り取り - gif図 - diff --git a/picture_library/src/main/res/values-ko-rKR/strings.xml b/picture_library/src/main/res/values-ko-rKR/strings.xml deleted file mode 100644 index 0d02216d5..000000000 --- a/picture_library/src/main/res/values-ko-rKR/strings.xml +++ /dev/null @@ -1,71 +0,0 @@ - - 카메라 필름 - %1$s (%2$d) - 취소 - 촬영 - 사진이나 비디오를 동시에 선택할 수 없습니다. - 최대 %1$s 달러 자 그림 선택 - 최소한 비디오 선택은 %1$s 달러 자 이상이어야 합니다. - 최대 %1$s 달러 개의 동영상을 선택할 수 있습니다. - 최대 %1$s 달러 개의 오디오를 선택할 수 있습니다. - 미리 보기 - 잠시만 기다려 주십시오.... - %1$d/%2$d 완료 - 완료됨 - 완료 - 선택하십시오 - 비디오나 사진 없음\n - 오디오 파일 없음\n - 사진을 찍거나 동영상을 찍을 수 있습니다 - 시스템으로 오디오 녹음 작업을 할 수 있습니다 - 그림 선택 최소 %1$s 달러 장 이상 - gif - webp - 메모리 카드 읽기 권한이 거부됨 - 시스템 카메라 가져오기 권한이 거부됨 - 시스템 녹음 권한 가져오기 거부됨 - 미리 볼 수 없는 동영상 - 비디오 녹화 - 촬영 - 투 생 - 미디어 파일 없음! - 제시 - 그림을 휴대 전화에 저장할지 여부? - 그림 저장 실패 - 그림 저장 성공 - 모든 오디오 - 녹음 - 재생 - 중지 - 출구 - 일시 정지 - 이미지 손상됨 - 비디오가 손상되었습니다 - 오디오가 손상됨 - 확정 - %1$d/%2$d - 자른 데이터가 없습니다 - 원본 이미지 (%1$s) - 원본 이미지 - 완성 - 완성(%1$d/%2$d) - 미리보기(%1$d) - 선택 - 앨범 정보 이상 가져오기… - 녹화 시간이 너무 짧다 - 사진 찍기 - 최대 %1$ds 초 이내의 영상을 선택할 수 있습니다 - %1$ds 내의 영상을 선택할 수 없습니다 - %1$ds~%2$ds 내의 영상만 선택할 수 있습니다 - 사진 찍기 클릭 - 카메라 - 설치 - 알 겠 습 니 다 - 데이터 없 음… - 편집 하 다 - - 사진 편집 - 원본 - 확인 - 움직이 - diff --git a/picture_library/src/main/res/values-pt-rPT/strings.xml b/picture_library/src/main/res/values-pt-rPT/strings.xml deleted file mode 100644 index a01560beb..000000000 --- a/picture_library/src/main/res/values-pt-rPT/strings.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - Todos - %1$s (%2$d) - Cancelar - Fotografia - Não é possível selecionar imagens ou vídeos ao mesmo tempo - Você pode escolher um máximo de %1$s foto - Os vídeos não podem ser menos de %1$s - Você pode escolher um máximo de %1$s vídeo - Você pode escolher um máximo de %1$s áudio - Antevisão - Espera… - %1$d/%2$d Terminar - Terminar - Terminar - Escolha - Não há arquivos de vídeo ou imagem\n - Não há ficheiros de áudio\n - Você pode usar a câmera para tirar fotos ou vídeos - Você pode gravar o áudio usando o sistema de gravação - Não pode haver menos de %1$s imagens - gif - webp - A permissão para ler o cartão de memória foi negada - Acesso à câmera do sistema negado - Acesso ao sistema de gravação negado - A visualização do vídeo não é suportada - Gravem video - Tirar fotos - Figura muito - Não há documentos! - Dica - Salve a imagem para o telemóvel? - Falha em salvar a imagem - A imagem foi salva com sucesso - Todos os áudios - Gravação - Play - Parar - Desistir - Pausa - imagem está danificada - vídeo está danificada - áudio está danificada - Certeza - %1$d/%2$d - Recursos sem cortes - Original (%1$s) - Original - Terminar - Terminar(%1$d/%2$d) - Antevisão(%1$d) - Escolha - Obter uma exceção para os dados do álbum… - Tempo de gravação é muito curto - Tirar fotos,Câmara - Tirar fotos - Câmara - Até um máximo de %1$ds vídeos podem ser selecionados - No mínimo, só podem ser selecionados vídeos de %1$ds segundos - Só podem ser selecionados vídeos de %1$ds a %2$ds segundos - As configurações - Entendo - Dados em branco… - Editar - - Rotação - Proporção - Recorte - - Proporção inicial - Recorte - - Recorte - Gif - diff --git a/picture_library/src/main/res/values-vi-rVN/string.xml b/picture_library/src/main/res/values-vi-rVN/string.xml deleted file mode 100644 index 78db5d60a..000000000 --- a/picture_library/src/main/res/values-vi-rVN/string.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - Camera cuộn - %1$s (%2$d) - Hủy bỏ - Bắn - Không thể chọn hình ảnh hoặc video cùng một lúc - Bạn có thể chọn tối đa%1$shình ảnh - Lựa chọn video tối thiểu phải có ít nhất%1$s - Bạn có thể chọn tối đa%1$s video - Bạn có thể chọn tối đa%1$sâm thanh - Xem trước - Xin vui lòng chờ… - %1$d/%2$d Hoàn thành - Đã hoàn thành - Hoàn thành - Vui lòng chọn - Không có video hoặc hình ảnh\n - Không có tập tin âm thanh\n - Bạn có thể sử dụng máy ảnh để chụp ảnh hoặc quay video - Bạn có thể ghi lại âm thanh bằng cách ghi hệ thống - Lựa chọn tối thiểu của hình ảnh không được ít hơn%1$s - gif - webp - Đọc thẻ nhớ bị từ chối - Nhận được sự cho phép của hệ thống camera - Nhận quyền ghi lại hệ thống bị từ chối - Video không thể xem trước - Quay video - Chụp ảnh - Hình dài - Không có tập tin phương tiện! - Gợi ý - Có lưu ảnh vào điện thoại không? - Lưu ảnh thất bại - Hình ảnh được lưu vào - Tất cả âm thanh - Ghi âm - Chơi - Dừng lại - Thoát - Tạm dừng - Hình ảnh bị hỏng - Video bị hỏng - Âm thanh bị hỏng - Được rồi - %1$d/%2$d - Không có dữ liệu cây trồng - Ảnh gốc (%1$s) - Ảnh gốc - Hoàn - Hoàn(%1$d/%2$d) - Xem trước(%1$d) - Chọn - Lấy ngoại lệ dữ liệu album… - Thời gian ghi âm quá ngắn - Chụp ảnh đi - Bạn chỉ có thể chọn ảnh trong vòng %1$ds nhất - Không thể chọn video dưới %1$ds giây - Chỉ có thể chọn ảnh giữa %1$ds và %2$ds giây - Ảnh - Máy ảnh dài - Chuẩn bị - Được rồi - không có dữ liệu… - Soạnthảo - - gif - Editar foto - Original - Recortar - \ No newline at end of file diff --git a/picture_library/src/main/res/values-zh-rCN/strings.xml b/picture_library/src/main/res/values-zh-rCN/strings.xml deleted file mode 100644 index e3e501e15..000000000 --- a/picture_library/src/main/res/values-zh-rCN/strings.xml +++ /dev/null @@ -1,77 +0,0 @@ - - 相机胶卷 - %1$s (%2$d) - 取消 - 拍摄 - 不能同时选择图片或视频 - 你最多只能选择%1$s张照片 - 视频最低选择不能少于%1$s个 - 你最多只能选择%1$s个视频 - 你最多只能选择%1$s个音频 - 预览 - 请稍候… - %1$d/%2$d 完成 - 已完成 - 完 成 - 请选择 - 无视频或照片\n - 无音频文件\n - 你可以使用相机拍摄照片或视频 - 你可以使用系统录音录制音频 - 图片最低选择不能少于%1$s张 - 动图 - 读取内存卡权限被拒绝 - 获取系统相机权限被拒绝 - 获取系统录音权限被拒绝 - 视频不可预览 - 录视频 - 拍照 - 长图 - 暂无媒体文件! - 提示 - 是否保存图片至手机? - 图片保存失败 - 图片保存成功至 - 所有音频 - 录音 - 播放 - 停止 - 退出 - 暂停 - 图片已损坏 - 视频已损坏 - 音频已损坏 - 确定 - %1$d/%2$d - 无可用裁剪数据 - 原图 (%1$s) - 原图 - 完成 - 完成(%1$d/%2$d) - 预览(%1$d) - 选择 - 获取相册数据异常… - 录制时间过短 - 单击拍照,长按摄像 - 单击拍照 - 长按摄像 - 最大只能选择 %1$ds 以内的视频 - 不能选择低于 %1$ds 内的视频 - 只能选择 %1$ds 至 %2$ds内的视频 - 去设置 - 我知道了 - 这里空空如也… - 编辑 - webp - - 旋转 - 比例 - 裁剪 - - 原始比例 - 裁剪 - - 裁剪 - 动图 - - diff --git a/picture_library/src/main/res/values-zh-rTW/strings.xml b/picture_library/src/main/res/values-zh-rTW/strings.xml deleted file mode 100644 index a80a7c6d7..000000000 --- a/picture_library/src/main/res/values-zh-rTW/strings.xml +++ /dev/null @@ -1,73 +0,0 @@ - - 相機膠卷 - %1$s (%2$d) - 取消 - 拍攝 - 不能同時選擇圖片或視頻 - 妳最多只能選擇%1$s張照片 - 視頻最低選擇不能少於%1$s個 - 妳最多只能選擇%1$s個視頻 - 妳最多只能選擇%1$s個音頻 - 預覽 - 請稍候… - %1$d/%2$d 完成 - 已完成 - 完 成 - 請選擇 - 無視頻或照片\n - 無音頻文件\n - 妳可以使用相機拍攝照片或視頻 - 妳可以使用系統錄音錄制音頻 - 圖片最低選擇不能少於%1$s張 - 動圖 - webp - 讀取內存卡權限被拒絕 - 獲取系統相機權限被拒絕 - 獲取系統錄音權限被拒絕 - 視頻不可預覽 - 錄視頻 - 拍照 - 長圖 - 暫無媒體文件! - 提示 - 是否保存圖片至手機? - 圖片保存失敗 - 圖片保存成功至 - 所有音頻 - 錄音 - 播放 - 停止 - 退出 - 暫停 - 圖片已損壞 - 視頻已損壞 - 音頻已損壞 - 確定 - %1$d/%2$d - 無可用裁剪數據 - 原圖 (%1$s) - 原圖 - 完成 - 完成(%1$d/%2$d) - 預覽(%1$d) - 選擇 - 獲取相冊數據異常... - 錄制時間過短 - 单击拍照,長按攝像 - 點擊拍照 - 長按攝像 - 最大只能選擇 %1$ds 以內的視頻 - 不能選擇低於 %1$ds 內的視頻 - 只能選擇 %1$ds 至 %2$ds內的視頻 - 去設置 - 我知道了 - 這裏空空如也… - 編輯 - - 原始比例 - 裁切 - - 裁切 - - 動圖 - diff --git a/picture_library/src/main/res/values/strings.xml b/picture_library/src/main/res/values/strings.xml index ee7c5d275..7bd2e6484 100644 --- a/picture_library/src/main/res/values/strings.xml +++ b/picture_library/src/main/res/values/strings.xml @@ -1,76 +1,77 @@ - 相机胶卷 + 카메라 필름 %1$s (%2$d) - 取消 - 拍摄 - 不能同时选择图片或视频 - 你最多只能选择%1$s张照片 - 视频最低选择不能少于%1$s个 - 你最多只能选择%1$s个视频 - 你最多只能选择%1$s个音频 - 预览 - 请稍候… - %1$d/%2$d 完成 - 已完成 - 完 成 - 请选择 - 无视频或照片\n - 无音频文件\n - 你可以使用相机拍摄照片或视频 - 你可以使用系统录音录制音频 - 图片最低选择不能少于%1$s张 - 动图 - 读取内存卡权限被拒绝 - 获取系统相机权限被拒绝 - 获取系统录音权限被拒绝 - 视频不可预览 - 录视频 - 拍照 - 长图 - 暂无媒体文件! - 提示 - 是否保存图片至手机? - 图片保存失败 - 图片保存成功至 - 所有音频 - 录音 - 播放 - 停止 - 退出 - 暂停 - 图片已损坏 - 视频已损坏 - 音频已损坏 - 确定 + 취소 + 촬영 + 사진과 동영상를 동시에 선택할 수 없습니다 + 최대 %1$d장 사진 선택이 가능합니다 + 최소한 동영상 선택은 %1$d장 이상이어야 합니다 + 최대 %1$d개의 동영상을 선택할 수 있습니다 + 최대 %1$d개의 오디오를 선택할 수 있습니다 + 미리보기 + 잠시 기다려 주세요 + %1$d/%2$d 완료 + 완료 + 완료 + 완료(%1$d) + 선택하십시오 + 사진과 동영상이 없음\n + 오디오 파일 없음\n + 사진을 찍거나 동영상을 찍을 수 있습니다 + 시스템으로 오디오 녹음을 할 수 있습니다 + 사진은 최소 %1$d장 이상이어야 합니다 + GIF + 저장소 읽기 권한이 거부되었습니다 + 시스템 카메라 가져오기 권한이 거부되었습니다 + 시스템 녹음 권한 가져오기 거부되었습니다 + 동영상 녹화 + 촬영 + 세로형 + 미디어 파일 없음! + 확인 + 사진을 핸드폰에 저장히시겠습니까? + 사진 저장 실패 + 사진 저장 성공 + 모든 오디오 + 녹음 + 재생 + 중지 + 나가기 + 일시 정지 + 이미지가 손상되었습니다 + 동영상이 손상되었습니다 + 오디오가 손상되었습니다 + 확정 %1$d/%2$d - 无可用裁剪数据 - 原图 (%1$s) - 原图 - 完成 - 完成(%1$d/%2$d) - 预览(%1$d) - 选择 - 获取相册数据异常… - 录制时间过短 - 单击拍照,长按摄像 - 单击拍照 - 长按摄像 - 最大只能选择 %1$ds 以内的视频 - 不能选择低于 %1$ds 内的视频 - 只能选择 %1$ds 至 %2$ds内的视频 - 去设置 - 我知道了 - 这里空空如也… - 编辑 - webp + 자른 데이터가 없습니다 + 원본 이미지 (%1$s) + 원본 이미지 + 완성 + 완성(%1$d/%2$d) + 미리보기(%1$d) + 선택 + 앨범 정보 불러오기 실패 + 녹화 시간이 너무 짧습니다 + 사진 찍기 + 최대 %1$d초 이내의 영상을 선택할 수 있습니다 + %1$d내의 영상을 선택할 수 없습니다 + %1$d~%2$d 내의 영상만 선택할 수 있습니다 + 사진 찍기 + 카메라 + 설정 + 확인 + 데이터 없음 + 편집 + WebP - 旋转 - 比例 - 裁剪 + 원본 + 사진 편집 + 확인 + GIF + 회전 + 크기 + 자르기 - 原始比例 - 裁剪 - - 裁剪 - 动图 + 일시적인 오류가 발생했습니다.(CROP_URI_ERROR) + 일시적인 오류가 발생했습니다.(CROP_TOOLBAR_WIDGET) diff --git a/publish.gradle b/publish.gradle deleted file mode 100644 index 3fd69daa2..000000000 --- a/publish.gradle +++ /dev/null @@ -1,155 +0,0 @@ -apply plugin: 'maven-publish' -apply plugin: 'signing' - -Properties localProperties = new Properties() -localProperties.load(project.rootProject.file('local.properties').newDataInputStream()) -localProperties.each { name, value -> - project.ext[name] = value -} - -def mavenUsername = localProperties.getProperty("sonatype.username") -def mavenPassword = localProperties.getProperty("sonatype.password") -def projectGroupId = localProperties.getProperty("groupId") -def projectArtifactId = localProperties.getProperty("artifactId") -def projectVersionName = cfgs.versionName -def projectDescription = localProperties.getProperty("description") -def projectGitUrl = localProperties.getProperty("gitUrl") -def projectLicense = localProperties.getProperty("license") -def projectLicenseUrl = projectLicense ? "https://opensource.org/licenses/${projectLicense.toString().replace(" ", "-")} " : null -def developerAuthorEmail = localProperties.getProperty("email") - -def developerAuthorId = mavenUsername -def developerAuthorName = mavenUsername - - -println("${mavenUsername} ${mavenPassword} - ${projectGroupId}:${projectArtifactId}:${projectVersionName}") -println("${projectLicense} - ${projectLicenseUrl}") - -if (!mavenUsername || !mavenPassword || !projectGroupId || !projectArtifactId || !projectVersionName) { - println('Error:缺少参数') - return -} -if (!projectDescription || !projectGitUrl || !projectLicense || !projectLicenseUrl || !developerAuthorId || !developerAuthorName || !developerAuthorEmail) { - println('Warning:缺少可选信息') -} - -def isAndroidProject = project.hasProperty('android') -if (isAndroidProject) { - println("使用Android工程方式发布") - task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - } - task javadocsJar(type: Jar, dependsOn: androidJavadocs) { - archiveClassifier.set("javadoc") - from androidJavadocs.destinationDir - } - task sourcesJar(type: Jar) { - archiveClassifier.set("sources") - from android.sourceSets.main.java.srcDirs - } -} else { - println("使用Java工程方式发布") - task javadocsJar(type: Jar, dependsOn: javadoc) { - archiveClassifier.set("javadoc") - from javadoc.destinationDir - } - task sourcesJar(type: Jar) { - archiveClassifier.set("sources") - from sourceSets.main.allJava - } -} - -tasks.withType(Javadoc).all { - options { - encoding "UTF-8" - charSet 'UTF-8' - author true - version true - links "http://docs.oracle.com/javase/8/docs/api" - if (isAndroidProject) { - linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference" - } - failOnError = false - } - enabled = false -} - -artifacts { - archives javadocsJar, sourcesJar -} - -publishing { - publications { - aar(MavenPublication) { - groupId = projectGroupId - artifactId = projectArtifactId - version = projectVersionName - // Tell maven to prepare the generated "*.aar" file for publishing - if (isAndroidProject) { - artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") - } else { - artifact("$buildDir/libs/${project.getName()}.jar") - } - artifact javadocsJar - artifact sourcesJar - - pom { - name = projectArtifactId - description = projectDescription - // If your project has a dedicated site, use its URL here - url = projectGitUrl - licenses { - license { - name = projectLicense - url = projectLicenseUrl - } - } - developers { - developer { - id = developerAuthorId - name = developerAuthorName - email = developerAuthorEmail - } - } - // Version control info, if you're using GitHub, follow the format as seen here - scm { - connection = "scm:git:${projectGitUrl}" - developerConnection = "scm:git:${projectGitUrl}" - url = projectGitUrl - } - withXml { - def dependenciesNode = asNode().appendNode('dependencies') - project.configurations.implementation.allDependencies.each { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', it.group) - dependencyNode.appendNode('artifactId', it.name) - dependencyNode.appendNode('version', it.version) - } - } - } - } - } - - repositories { - maven { - name = projectArtifactId - - def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" - // You only need this if you want to publish snapshots, otherwise just set the URL - // to the release repo directly - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - - // The username and password we've fetched earlier - credentials { - username mavenUsername - password mavenPassword - } - } - } -} - -signing { - sign publishing.publications -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 49f7e9e90..45124f509 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':picture_library', ':ucrop' \ No newline at end of file +include ':app', ':picture_library' \ No newline at end of file