From 0a761bf57d725c064d4e96e4f73a1d81979f34f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=20=E5=AE=B6=20=E6=B5=A9?= <35959817+Jahhow@users.noreply.github.com> Date: Mon, 6 Apr 2020 02:00:18 +0800 Subject: [PATCH] V1 - Google Play Beta --- app/build.gradle | 2 +- app/src/debug/res/values/debug_strings.xml | 2 +- .../koller/cameraroll/ui/widget/CropImageView.java | 13 +++++-------- app/src/main/res/values/strings.xml | 2 +- .../labs/subscaleview/SubsamplingScaleImageView.kt | 2 ++ 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d44a3fe3..97000486 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 29 defaultConfig { - applicationId "Jahhow.Koller.CameraRoll" + applicationId "jahhow.koller.gallery" minSdkVersion 19 targetSdkVersion 29 versionCode 1 diff --git a/app/src/debug/res/values/debug_strings.xml b/app/src/debug/res/values/debug_strings.xml index 7e28689c..ced78b13 100644 --- a/app/src/debug/res/values/debug_strings.xml +++ b/app/src/debug/res/values/debug_strings.xml @@ -1,4 +1,4 @@ - Camera Roll Debug + Gallery Debug \ No newline at end of file diff --git a/app/src/main/java/us/koller/cameraroll/ui/widget/CropImageView.java b/app/src/main/java/us/koller/cameraroll/ui/widget/CropImageView.java index e540495c..f3a8be8e 100644 --- a/app/src/main/java/us/koller/cameraroll/ui/widget/CropImageView.java +++ b/app/src/main/java/us/koller/cameraroll/ui/widget/CropImageView.java @@ -28,7 +28,9 @@ import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; import us.koller.cameraroll.R; +import us.koller.cameraroll.imageDecoder.CustomImageDecoder; import us.koller.cameraroll.imageDecoder.CustomRegionDecoder; +import us.koller.cameraroll.imageDecoder.GlideImageDecoder; import us.koller.cameraroll.imageDecoder.RAWImageRegionDecoder; import us.koller.cameraroll.interpolator.MyInterpolator; import us.koller.cameraroll.util.MediaType; @@ -144,15 +146,7 @@ public CropImageView(Context context) { } private void init() { - //setZoomEnabled(false); - //setPanEnabled(false); - //setPanLimit(PAN_LIMIT_CENTER); - //setOrientationDegrees(0); - //setMinScale(0.01f); - //setMinimumScaleType(SCALE_TYPE_CUSTOM); - //setRotationEnabled(false); setRetainXSwipe(false); - setOnTouchListener(this); strokeWidth = Util.dpToPx(getContext(), STROKE_WIDTH_DP); @@ -202,9 +196,12 @@ public void loadImage(Uri uri, State state) { String mimeType = MediaType.getMimeType(getContext(), imageUri); if (MediaType.checkRAWMimeType(mimeType)) { setRegionDecoderFactory(RAWImageRegionDecoder::new); + setDecoderFactory(null); } else { setRegionDecoderFactory(CustomRegionDecoder::new); + setDecoderFactory(CustomImageDecoder::new); } + setPreviewDecoderFactory(GlideImageDecoder::new); if (state != null) { cropRect = state.getCropRect(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 402b189d..79f80380 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - Camera Roll + Gallery Camera Roll needs permission to access your Storage to be able to depict your pictures. Grant removable Storage Permission diff --git a/library/src/main/kotlin/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.kt b/library/src/main/kotlin/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.kt index 649b5cb7..b9e68a39 100644 --- a/library/src/main/kotlin/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.kt +++ b/library/src/main/kotlin/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.kt @@ -1356,6 +1356,8 @@ open class SubsamplingScaleImageView @JvmOverloads constructor(context: Context, view.onImageEventListener?.onImageLoadError(exception) else { view.bitmap = bitmap + view.checkReadyToDraw() + view.checkBaseLayerReady() view.invalidate() } }