Skip to content

Commit

Permalink
v1.0.1 拍照后按返回键删除刚才拍摄的照片
Browse files Browse the repository at this point in the history
  • Loading branch information
bingoogolapple committed Jul 1, 2016
1 parent 14a5ca7 commit 66cf448
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {


// compile project(':library')
compile 'cn.bingoogolapple:bga-photopicker:1.0.0@aar'
compile 'cn.bingoogolapple:bga-photopicker:1.0.1@aar'


// 必须依赖下面四个图片加载库中的某一个
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ ANDROID_BUILD_TARGET_SDK_VERSION=24
ANDROID_BUILD_SDK_VERSION=24
ANDROID_BUILD_TOOLS_VERSION=24.0.0

VERSION_NAME=1.0.0
VERSION_CODE=100
VERSION_NAME=1.0.1
VERSION_CODE=101
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ dependencies {
}

// gradle uploadArchives
apply from: 'https://raw.githubusercontent.com/bingoogolapple/PublishAar/master/central-publish.gradle'
//apply from: 'https://raw.githubusercontent.com/bingoogolapple/PublishAar/master/central-publish.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,16 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
photos.add(mImageCaptureManager.getCurrentPhotoPath());
startActivityForResult(BGAPhotoPickerPreviewActivity.newIntent(this, 1, photos, photos, 0, true), REQUEST_CODE_PREVIEW);
} else if (requestCode == REQUEST_CODE_PREVIEW) {
if (BGAPhotoPickerPreviewActivity.getIsFromTakePhoto(data)) {
// 从拍照预览界面返回,刷新图库
mImageCaptureManager.refreshGallery();
}

returnSelectedImages(BGAPhotoPickerPreviewActivity.getSelectedImages(data));
}
} else if (resultCode == RESULT_CANCELED && requestCode == REQUEST_CODE_PREVIEW) {
if (BGAPhotoPickerPreviewActivity.getIsFromTakePhoto(data)) {
// 从拍照预览界面返回,删除之前拍的照片

mImageCaptureManager.deletePhotoFile();
} else {
mPicAdapter.setSelectedImages(BGAPhotoPickerPreviewActivity.getSelectedImages(data));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Intent getTakePictureIntent() throws IOException {
* 刷新图库
*/
public void refreshGallery() {
if (mCurrentPhotoPath != null) {
if (!TextUtils.isEmpty(mCurrentPhotoPath)) {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
mediaScanIntent.setData(Uri.fromFile(new File(mCurrentPhotoPath)));
mContext.sendBroadcast(mediaScanIntent);
Expand Down

0 comments on commit 66cf448

Please sign in to comment.