ionic-team / capacitor-plugins

Official plugins for Capacitor āš”ļø
529 stars 594 forks source link

Inconsistent behaviour on different Android versions when using Camera.pickImages() including some devices not able to select multiple images at once #2199

Open webfletch opened 1 month ago

webfletch commented 1 month ago

Bug Report

Plugin(s)

@capacitor/camera 6.0.0 @capacitor/camera 6.0.1 @capacitor/camera 6.0.2

Capacitor Version

 Capacitor Doctor   

Latest Dependencies:

  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2
  @capacitor/android: 6.1.2
  @capacitor/ios: 6.1.2

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2
  @capacitor/android: 6.1.2

[success] Android looking great! šŸ‘Œ

Platform(s)

Android. Tested on Android 12 emulator, Android 14 emulator and Android 9 physical device.

Current Behavior

Inconsistent behaviour between Android versions when trying to select multiple images using "Camera.pickImages()".

On Android 9 (physical device) and Android 14 (emulator) the screen for selecting images looks similar but on Android 9 it only allows you to select a single image whereas on Android 14 you can select multiple images (i.e. the correct behaviour). Notice on screenshots below the Android 14 version has little checkboxes in top left hand corner of each image but the Android 9 version does not.

Android 12 (emulator) the screen for selecting images looks completely different and although you can select more than one image, this has to be done by holding down on an image, or holding down and dragging across multiple images, if you use a single tap/click then it just selects 1 image and closes the dialog. This behaviour would be confusing and not obvious to anyone that was used to previously just tapping each image they want to add (so that it selects the checkbox on each image).

With Capacitor 5 on Android 9 (physical device), the image picker works fine selecting multiple images and looks different to all the examples mentioned above (see 1st screenshot below).

Expected Behavior

The screen for picking images should be consistent across different Android versions or at least offer similar functionality such as a single click on an image should select that image and then allow you to still select others (i.e. not select and close the image picker dialog), also the ability to select multiple images should be possible on older Android versions such as Android 9.

Code Reproduction

https://github.com/webfletch/Capacitor.Camera.Issues

Screenshots

Capacitor 5 - Android 9 - Samsung S8 physical device

Able to select multiple images.

Capacitor 6 - Android 9 - Samsung S8 physical device

Not able to select multiple images.

Capacitor 6 - Android 12 - Pixel 4 emulator

Only able to select multiple images by holding finger down on an image.

Capacitor 6 - Android 14 - Pixel 7 emulator

Able to select multiple images.