fix SystemMediaSelector

androidx
Ztiany 5 years ago
parent 2c66651ed2
commit 30a0e1ecc9
  1. 2
      lib_media_selector/src/main/java/com/android/sdk/mediaselector/SystemMediaSelector.java
  2. 3
      lib_media_selector/src/main/java/com/android/sdk/mediaselector/Utils.java

@ -238,9 +238,11 @@ public class SystemMediaSelector {
private void processUCropResult(Intent data) { private void processUCropResult(Intent data) {
Uri uCropResult = Utils.getUCropResult(data); Uri uCropResult = Utils.getUCropResult(data);
Log.d(TAG, "processCameraResult() called with: resultCode = [" + "], data = [" + uCropResult + "]");
if (uCropResult == null) { if (uCropResult == null) {
mMediaSelectorCallback.onTakeFail(); mMediaSelectorCallback.onTakeFail();
} else { } else {
Log.d(TAG, "processCameraResult() called with: resultCode = [" + "], data = [" + Utils.getAbsolutePath(getContext(), uCropResult) + "]");
mMediaSelectorCallback.onTakeSuccess(Utils.getAbsolutePath(getContext(), uCropResult)); mMediaSelectorCallback.onTakeSuccess(Utils.getAbsolutePath(getContext(), uCropResult));
} }
} }

@ -185,6 +185,8 @@ final class Utils {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
static void toUCrop(Context context, Fragment fragment, String srcPath, String targetPath, CropOptions cropConfig, int requestCode) { static void toUCrop(Context context, Fragment fragment, String srcPath, String targetPath, CropOptions cropConfig, int requestCode) {
makeFilePath(new File(targetPath));
Uri srcUri = new Uri.Builder() Uri srcUri = new Uri.Builder()
.scheme("file") .scheme("file")
.appendPath(srcPath) .appendPath(srcPath)
@ -227,6 +229,7 @@ final class Utils {
} }
Throwable throwable = UCrop.getError(data); Throwable throwable = UCrop.getError(data);
if (throwable != null) { if (throwable != null) {
throwable.printStackTrace();
return null; return null;
} }
return UCrop.getOutput(data); return UCrop.getOutput(data);

Loading…
Cancel
Save