From 2dd983c80372fc044bb13295c239a0724eade7d1 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Wed, 20 Sep 2023 07:46:39 -0300 Subject: [PATCH] fix(compose): fix photoPicker not popping up when there is less than 2 spaces available for media --- .../org/joinmastodon/android/fragments/ComposeFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index 98018edbf2..cf9f6709ee 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -1419,7 +1419,8 @@ private void openFilePicker(boolean photoPicker){ boolean usePhotoPicker=photoPicker && UiUtils.isPhotoPickerAvailable(); if(usePhotoPicker){ intent=new Intent(MediaStore.ACTION_PICK_IMAGES); - intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, mediaViewController.getMaxAttachments()-mediaViewController.getMediaAttachmentsCount()); + if(mediaViewController.getMaxAttachments()-mediaViewController.getMediaAttachmentsCount()>1) + intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, mediaViewController.getMaxAttachments()-mediaViewController.getMediaAttachmentsCount()); }else{ intent=new Intent(Intent.ACTION_GET_CONTENT); intent.addCategory(Intent.CATEGORY_OPENABLE);