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

fix: Fix android crashing on text binding #2390

Merged
merged 1 commit into from
Apr 25, 2020

Conversation

glennawatson
Copy link
Contributor

What kind of change does this PR introduce?

This fixes a bug where android text binding would crash.

It fixes #2170

What is the current behavior?

It crashes on binding.

What is the new behavior?

It doesn't crash.

@glennawatson glennawatson requested review from a team April 25, 2020 08:27
@@ -142,10 +142,14 @@ private static DispatchItem CreateTimePickerMinuteFromWidget()
{
var view = (TView)x;

return Observable.FromEvent<EventHandler<TEventArgs>, TEventArgs>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the cause of the error. The event handlers weren't being set properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Essentially, there was a mismatch between the EventHandler and Rx would cause an exception.

Now we are explicitly specifying the event handler method which is more efficient since it avoids reflection anyway.

}

return Tuple.Create((object)vmAsView, isVm);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just syntactic sugar to remove a Tuple instance for the more efficient ValueTuple.

@codecov
Copy link

codecov bot commented Apr 25, 2020

Codecov Report

Merging #2390 into master will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2390      +/-   ##
==========================================
+ Coverage   54.66%   54.69%   +0.03%     
==========================================
  Files         114      114              
  Lines        4341     4344       +3     
  Branches      663      663              
==========================================
+ Hits         2373     2376       +3     
  Misses       1801     1801              
  Partials      167      167              
Impacted Files Coverage Δ
.../Bindings/Property/PropertyBinderImplementation.cs 77.06% <100.00%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2430a46...1e80877. Read the comment docs.

@glennawatson glennawatson merged commit 2e469f6 into master Apr 25, 2020
@glennawatson glennawatson deleted the glennawatson/fix-gh2170 branch April 25, 2020 08:48
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] PropertyBindingMixins.Bind crashes
2 participants