Skip to content

Commit a53416f

Browse files
author
duyu
committed
修复配置显示原图按钮问题
1 parent bc67c10 commit a53416f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

library/src/main/java/com/rain/library/ui/PhotoPreviewActivity.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,16 @@ public void onPageSelected(int position) {
192192
} else {
193193
checkbox.setChecked(false);
194194
}
195+
if (!originalPicture) {
196+
radioButton.setVisibility(View.GONE);
197+
return;
198+
}
195199

196200
if (originalPicture && radioButton.isChecked()) {
197201
radioButton.setText(getString(R.string.image_size, UtilsHelper.formatFileSize(photos.get(pos).getOriginalSize())));
198202
} else {
199203
radioButton.setText(getString(R.string.original_image));
200204
}
201-
202205
if (MimeType.isPictureType(photos.get(position).getImageType()) == MimeType.ofVideo()) {
203206
radioButton.setVisibility(View.GONE);
204207
} else {
@@ -277,7 +280,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
277280
private void sendImage() {
278281
if (callback != null) {
279282
callback.selectResult(selectPhotosInfo);
280-
} else{
283+
setResult(RESULT_OK, new Intent());
284+
} else {
281285
Intent intent = new Intent();
282286
intent.putParcelableArrayListExtra(PhotoPickConfig.EXTRA_SELECT_PHOTOS, selectPhotosInfo);
283287
setResult(Activity.RESULT_OK, intent);
@@ -346,7 +350,6 @@ public void onSuccess(File file, boolean success) {
346350
};
347351

348352

349-
350353
private void backTo() {
351354
if (isChecked) {
352355
PhotoPickConfig.getInstance().setStartCompression(false);

0 commit comments

Comments
 (0)