Merge pull request #694 from LucasGGamerM/mastodon-android

fix(compose): fix photoPicker not popping up when there is less than 2 spaces available for media
This commit is contained in:
Gregory K 2023-09-20 14:10:26 +03:00 committed by GitHub
commit 90f84d628a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -839,6 +839,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
boolean usePhotoPicker=UiUtils.isPhotoPickerAvailable(); boolean usePhotoPicker=UiUtils.isPhotoPickerAvailable();
if(usePhotoPicker){ if(usePhotoPicker){
intent=new Intent(MediaStore.ACTION_PICK_IMAGES); intent=new Intent(MediaStore.ACTION_PICK_IMAGES);
if(mediaViewController.getMaxAttachments()-mediaViewController.getMediaAttachmentsCount()>1)
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, mediaViewController.getMaxAttachments()-mediaViewController.getMediaAttachmentsCount()); intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, mediaViewController.getMaxAttachments()-mediaViewController.getMediaAttachmentsCount());
}else{ }else{
intent=new Intent(Intent.ACTION_GET_CONTENT); intent=new Intent(Intent.ACTION_GET_CONTENT);