-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] 28+ Make non-visible pickers work again #7289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like android is failing this one
Xamarin.Forms.Controls.Issues.Issue530.Issue530TestsLoadAsync_lg_nexus_5-4_4_4
iOS
OpeningPickerPressingBackButtonTwiceShouldNotOpenPickerAgain_apple_iphone_xs
Moved the iOS one behind the For the other failing test, not sure what the cause might be. I've added a little code to hide the picker dialog again after the test is done. Don't see how that should be the problem, but let's see. It seems the app crashes for some reason after the last "picker test" and before the next test which is the failing one you pointed out. It's way too coincidental that this happens now, so my tests are probably the cause, but not sure why. |
Any unhandled exceptions in the device logs? |
Besides some exceptions (916 times) that do not seem to have to do anything with this, I do see this one:
But not sure what that is supposed to mean. And clearly this doesn't happen all the time. Seeing some other issues with similar error messages (#2444, #6550) it might have something to do with some value being null? With the objects named in the exception I traced it back to here in
I will try to reproduce it and from there see to fix it. The only other thing I can think of is to just put this full of null checks. @PureWeen any thoughts? |
Means that a Renderer or View has been disposed but then some action/event is trying to reuse that View or Renderer. For example
So it sounds like something with your changes isn't unwiring an event. This Listenerer probably needs to be removed inside dispose?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, Android documentation states that a non-visible view cannot be focused and when a XF user calls Focus()
on such a view (in 9.0) it will not focus the view.
With this change we will pop up the DateTime
picker dialog before the underlying OS has decided if the DateTime
EditText
will gain focus. And we're gonna push that behavior across all the picker views, not just revert the DateTime
behavior?
@kingces95 We do have problems with As it turns out, the dialogs popping up on I agree with the strategy that you and I have discussed. We should fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So be it.
@PureWeen I think the test run for the latest change is here: https://appcenter.ms/orgs/xtc-Xamarin-Forms/apps/AndroidControlGallery-1/test/series/pull-7289/runs/543e63f2-0253-4194-8c76-ad1568555b81 And seems all green? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we dispose of this _dialog as well?
_dialog?.Dispose()
_dialog = null
Description of Change
Checks if the TextView control is clickable, if not, takes a different route but still shows the picker dialog.
As a bonus I added the fix for #7311. The back button will not open the Picker again when it is still focused.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
PR Checklist