Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
/pluginsPublic archive

[image_picker]Android update cache#4124

Merged
Changes from1 commit
Commits
Show all changes
35 commits
Select commitHold shift + click to select a range
df341db
Add multiRetrieve method call
ydagJun 30, 2021
2d1a871
Refactor finishWithSuccess to cache list of images
ydagJun 30, 2021
30a067f
Refactor retrieveLostImage method
ydagJun 30, 2021
01ad85e
Add new MAP_KEY_PATH_LIST key
ydagJun 30, 2021
5a9e99f
Refactor saveTypeWithMethodCallName
ydagJun 30, 2021
364c79d
Update saveResult method
ydagJun 30, 2021
757da4c
Update the getCacheMap method
ydagJun 30, 2021
3418641
Add statement to return null
ydagJun 30, 2021
74f3990
Merge branch 'master' into image_picker/android_update_cache
ydagJul 1, 2021
93de29f
Update CHANGELOG and version number
ydagJul 1, 2021
9264ad9
Revert "Refactor finishWithSuccess to cache list of images"
ydagJul 1, 2021
e585603
Refactor finishWithSuccess method
ydagJul 1, 2021
33fb183
Update dependency version
ydagJul 1, 2021
226ef21
Merge branch 'master' into image_picker/android_update_cache
ydagJul 16, 2021
ec4079e
Update version and CHANGELOG
ydagJul 16, 2021
a675352
Add unit tests
ydagJul 16, 2021
91fd73d
Update CHANGELOG
ydagJul 16, 2021
56c29b0
Update dependency version
ydagJul 17, 2021
156d845
Remove unused method call
ydagJul 21, 2021
c38ad2b
Remove unit tests from deprecated LostData
ydagAug 20, 2021
27f87ca
Remove redundant unit test
ydagAug 20, 2021
c567525
Refactor to assign the last item to path to avoid breaking change
ydagAug 20, 2021
0454d80
Refactor retrieveLostData multiple files unit test
ydagAug 20, 2021
db5d48e
Update the dependency version
ydagAug 20, 2021
ca9c5b2
Merge branch 'master' into image_picker/android_update_cache
ydagAug 23, 2021
e8d71e9
Fix the length call
ydagAug 26, 2021
a1555bb
Merge branch 'master' into image_picker/android_update_cache
ydagAug 26, 2021
933931b
Update the CHANGELOG
ydagAug 26, 2021
c08c461
Update CHANGELOG
ydagAug 26, 2021
a43ffeb
Add null check
ydagAug 27, 2021
ced68ec
Add unit test
ydagAug 27, 2021
0325f33
Update the example app
ydagAug 27, 2021
29d9e0e
Remove redundant comment
ydagAug 27, 2021
4ad0263
Refactor handleMultiImageResult
ydagAug 27, 2021
0764514
Variable rename
BeMacizedAug 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Refactor finishWithSuccess to cache list of images
I removed the finishWithListSuccess method since it was a temporary solution to save only the last image when multiple images are picked. With the new implementation of caching, finishWithSuccess method save always a list of images to the cache.
  • Loading branch information
@ydag
ydag committedJun 30, 2021
commit2d1a871eeaa277be7421b0846ba479c95ee9a167
Original file line numberDiff line numberDiff line change
Expand Up@@ -488,7 +488,7 @@ private void handleChooseImageResult(int resultCode, Intent data) {
}

// User cancelled choosing a picture.
finishWithSuccess(null);
finishWithSuccess(null, false);
}

private void handleChooseMultiImageResult(int resultCode, Intent intent) {
Expand All@@ -506,7 +506,7 @@ private void handleChooseMultiImageResult(int resultCode, Intent intent) {
}

// User cancelled choosing a picture.
finishWithSuccess(null);
finishWithSuccess(null, false);
}

private void handleChooseVideoResult(int resultCode, Intent data) {
Expand All@@ -517,7 +517,7 @@ private void handleChooseVideoResult(int resultCode, Intent data) {
}

// User cancelled choosing a picture.
finishWithSuccess(null);
finishWithSuccess(null, false);
}

private void handleCaptureImageResult(int resultCode) {
Expand All@@ -536,7 +536,7 @@ public void onPathReady(String path) {
}

// User cancelled taking a picture.
finishWithSuccess(null);
finishWithSuccess(null, false);
}

private void handleCaptureVideoResult(int resultCode) {
Expand All@@ -555,7 +555,7 @@ public void onPathReady(String path) {
}

// User cancelled taking a picture.
finishWithSuccess(null);
finishWithSuccess(null, false);
}

private void handleMultiImageResult(
Expand All@@ -572,21 +572,23 @@ private void handleMultiImageResult(
}
paths.set(i, finalImagePath);
}
finishWithListSuccess(paths);
finishWithSuccess(paths, true);
}
}

private void handleImageResult(String path, boolean shouldDeleteOriginalIfScaled) {
ArrayList<String> imageList = new ArrayList<String>();
if (methodCall != null) {
String finalImagePath = getResizedImagePath(path);
//delete original file if scaled
if (finalImagePath != null && !finalImagePath.equals(path) && shouldDeleteOriginalIfScaled) {
new File(path).delete();
}
finishWithSuccess(finalImagePath);
imageList.add(finalImagePath);
} else {
finishWithSuccess(path);
imageList.add(path);
}
finishWithSuccess(imageList, false);
}

private String getResizedImagePath(String path) {
Expand All@@ -598,7 +600,9 @@ private String getResizedImagePath(String path) {
}

private void handleVideoResult(String path) {
finishWithSuccess(path);
ArrayList<String> imageList = new ArrayList<String>();
imageList.add(path);
finishWithSuccess(imageList, false);
}

private boolean setPendingMethodCallAndResult(
Expand All@@ -616,23 +620,17 @@ private boolean setPendingMethodCallAndResult(
return true;
}

private void finishWithSuccess(String imagePath) {
private void finishWithSuccess(ArrayList<String> imagePath, boolean isMultiImage) {
if (pendingResult == null) {
cache.saveResult(imagePath, null, null);
return;
}
pendingResult.success(imagePath);
clearMethodCallAndResult();
}

private void finishWithListSuccess(ArrayList<String> imagePaths) {
if (pendingResult == null) {
for (String imagePath : imagePaths) {
cache.saveResult(imagePath, null, null);
}
return;
if (isMultiImage) {
pendingResult.success(imagePath);
} else {
pendingResult.success(imagePath.get(0));
}
pendingResult.success(imagePaths);
clearMethodCallAndResult();
}

Expand Down

[8]ページ先頭

©2009-2026 Movatter.jp