Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for Intent.CreateChooser #61

Merged
merged 15 commits into from
Sep 15, 2021

Conversation

andrk0p
Copy link
Contributor

@andrk0p andrk0p commented Sep 3, 2021

Description

I found that the selection of photos or videos does not work on all devices.

Actual Behavior

photo_2021-09-03_19-03-29 (2)

Expected behavior

photo_2021-09-03_19-03-29

The chooserIntent object in all testing cases returns Android.App.Result.Canceled in the onActivityResult method.

I couldn't find a way to get chooserIntent to work correctly on my device, so I added a check for the operating system version to rule out this problem on similar devices.

  • Fixed the PickAsync method for devices with Android 11

API Changes

Added:

public bool UseCreateChooser { get; set; } = true;

Configuration

  • Device: Xiaomi Redmi Note 8 Pro
  • OS Version: MIUI Global 12.5.1 Android 11 RP1A
  • Plugin Version: 1.0.2.1

PR Checklist

  • All projects build
  • Has samples
  • Rebased onto current main

@dimonovdd dimonovdd added android bug Something isn't working PickMedia labels Sep 3, 2021
@dimonovdd
Copy link
Owner

@andrk0p I was able to test this on a device like yours but with 12.5.2 version of MIUI. I can't reproduce this problem. Do you have any ideas?

@andrk0p
Copy link
Contributor Author

andrk0p commented Sep 8, 2021

@andrk0p I was able to test this on a device like yours but with 12.5.2 version of MIUI. I can't reproduce this problem. Do you have any ideas?

I don't have any ideas. Maybe the problem is in MAUI 12.5.1

@dimonovdd
Copy link
Owner

@andrk0p Maybe, can we add a new parameter for determining use of Intent.CreateChooser?

@andrk0p
Copy link
Contributor Author

andrk0p commented Sep 8, 2021

@andrk0p Maybe, can we add a new parameter for determining use of Intent.CreateChooser?

I added the UseCreateChooser parameter and updated the usage example

@dimonovdd dimonovdd added the enhancement New feature or request label Sep 14, 2021
Copy link
Owner

@dimonovdd dimonovdd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I added a few minor edits:

README.md Outdated Show resolved Hide resolved
MediaGallery/MediaGallery/PickMedia.android.cs Outdated Show resolved Hide resolved
MediaGallery/MediaGallery/PickMedia.android.cs Outdated Show resolved Hide resolved
MediaGallery/MediaPickRequest/MediaPickRequest.shared.cs Outdated Show resolved Hide resolved
@dimonovdd dimonovdd changed the title Fixed the PickAsync method for devices with Android 11 Improvements for Intent.CreateChooser Sep 14, 2021
Andrey Kopylov and others added 4 commits September 15, 2021 11:43
Co-authored-by: Dima Dimov <dimovde@yandex.ru>
Co-authored-by: Dima Dimov <dimovde@yandex.ru>
Co-authored-by: Dima Dimov <dimovde@yandex.ru>
Co-authored-by: Dima Dimov <dimovde@yandex.ru>
@dimonovdd dimonovdd merged commit 9432429 into dimonovdd:main Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working enhancement New feature or request PickMedia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants