From 58f75531884f7f3cf94b700541609db81b14c03f Mon Sep 17 00:00:00 2001 From: static_coder <2223854654@qq.com> Date: Tue, 8 Dec 2020 18:21:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E7=AC=A6=E5=90=88=E6=97=B6=E9=95=BF=E8=A6=81?= =?UTF-8?q?=E6=B1=82=E7=9A=84=E8=A7=86=E9=A2=91=E7=9A=84=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/luck/picture/lib/PictureSelectionModel.java | 10 ++++++++++ .../picture/lib/config/PictureSelectionConfig.java | 4 ++++ .../com/luck/picture/lib/model/LocalMediaLoader.java | 7 ++++--- .../luck/picture/lib/model/LocalMediaPageLoader.java | 12 +++++++----- 4 files changed, 25 insertions(+), 8 deletions(-) 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 40ccb9714..35bad0334 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 @@ -1465,4 +1465,14 @@ public void externalPictureVideo(String path) { throw new NullPointerException("This PictureSelector is Null"); } } + + /** + * @param show whether to show too long and too short videos + * @return + */ + public PictureSelectionModel isShowOutLengthVideos(boolean show) { + selectionConfig.showOutLengthVideos = show; + return this; + } + } diff --git a/picture_library/src/main/java/com/luck/picture/lib/config/PictureSelectionConfig.java b/picture_library/src/main/java/com/luck/picture/lib/config/PictureSelectionConfig.java index 5756d9a15..9e86007bb 100644 --- a/picture_library/src/main/java/com/luck/picture/lib/config/PictureSelectionConfig.java +++ b/picture_library/src/main/java/com/luck/picture/lib/config/PictureSelectionConfig.java @@ -156,6 +156,7 @@ public final class PictureSelectionConfig implements Parcelable { public boolean isAndroidQChangeWH; public boolean isAndroidQChangeVideoWH; public boolean isQuickCapture; + public boolean showOutLengthVideos; /** * 内测专用########### */ @@ -265,6 +266,7 @@ protected void initDefaultValue() { isAndroidQChangeWH = true; isAndroidQChangeVideoWH = false; isQuickCapture = true; + showOutLengthVideos = false; } public static PictureSelectionConfig getInstance() { @@ -404,6 +406,7 @@ public void writeToParcel(Parcel dest, int flags) { dest.writeByte(this.isFallbackVersion ? (byte) 1 : (byte) 0); dest.writeByte(this.isFallbackVersion2 ? (byte) 1 : (byte) 0); dest.writeByte(this.isFallbackVersion3 ? (byte) 1 : (byte) 0); + dest.writeByte(this.showOutLengthVideos ? (byte) 1 : (byte) 0); } protected PictureSelectionConfig(Parcel in) { @@ -508,6 +511,7 @@ protected PictureSelectionConfig(Parcel in) { this.isFallbackVersion = in.readByte() != 0; this.isFallbackVersion2 = in.readByte() != 0; this.isFallbackVersion3 = in.readByte() != 0; + this.showOutLengthVideos = in.readByte() != 0; } public static final Creator CREATOR = new Creator() { diff --git a/picture_library/src/main/java/com/luck/picture/lib/model/LocalMediaLoader.java b/picture_library/src/main/java/com/luck/picture/lib/model/LocalMediaLoader.java index 0d7106042..d24a6d4c8 100644 --- a/picture_library/src/main/java/com/luck/picture/lib/model/LocalMediaLoader.java +++ b/picture_library/src/main/java/com/luck/picture/lib/model/LocalMediaLoader.java @@ -394,13 +394,14 @@ private LocalMediaFolder getImageFolder(String path, String folderName, List