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

Changed order of calls to properly close MediaPicker Activity / ViewController and set the picker result #21998

Conversation

Alex-Dobrynin
Copy link
Contributor

@Alex-Dobrynin Alex-Dobrynin commented Apr 23, 2024

Fixes this issue Alex-Dobrynin/Xamarin.Controls.ImageCropper#8

Shortly, at the moment of getting the result of mediapicker, the activity or viewcontroller remains opened. And if open another activity or viewcontroller right after the result of mediapicker you will not see any new activity/viewcontroller opened. So to fix this we need to change the order of calls:

  1. we need to close activity/viewcontroller
  2. we need to set the result of mediapicker

Actual result: we need to put some Task.Delay after mediapicker result to be able open new activity/viewcontroller
Expected result: we able to open new activity/viewcontroller right after getting the picker result.

To reproduce it, you can try open new activity or viewcontroller from the topmost one (which is still mediapicker's activity/viewcontrolelr) right after the mediapicker result.

Affects only android/ios

@Alex-Dobrynin Alex-Dobrynin requested a review from a team as a code owner April 23, 2024 09:39
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 23, 2024
Copy link
Contributor

Hey there @Alex-Dobrynin! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@jsuarezruiz jsuarezruiz added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Apr 23, 2024
@jsuarezruiz jsuarezruiz requested a review from mattleibow April 23, 2024 09:43
@Alex-Dobrynin
Copy link
Contributor Author

@dotnet-policy-service agree

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Alex-Dobrynin
Copy link
Contributor Author

will this be reviewed some day?

Copy link

Commenter does not have sufficient privileges for PR 21998 in repo dotnet/maui

@Alex-Dobrynin
Copy link
Contributor Author

Somebody will review this?

@Axemasta
Copy link
Contributor

Axemasta commented Sep 9, 2024

I've just run into this issue, its really painful since you have to wait out the result with a Task.Delay and have to set that delay to be high to prevent the race condition kicking in....

Would love to see this in soon!

@Alex-Dobrynin
Copy link
Contributor Author

Alex-Dobrynin commented Sep 9, 2024

@Axemasta for now you may use this package MPowerKit.MediaPlugin, you will not have this issue there. It is a port of James Montemagno's MediaPlugin, but with some fixes

@mattleibow mattleibow merged commit 79bef03 into dotnet:main Sep 9, 2024
49 checks passed
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Oct 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info community ✨ Community Contribution fixed-in-net9.0-nightly This may be available in a nightly release! platform/android 🤖 platform/iOS 🍎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants