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

Fixes for Forms presenter #2321

Merged
merged 6 commits into from
Oct 30, 2017
Merged

Conversation

martijn00
Copy link
Contributor

@martijn00 martijn00 commented Oct 30, 2017

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bug fixes

⤵️ What is the current behavior?

🆕 What is the new behavior (if this is a feature change)?

💥 Does this PR introduce a breaking change?

🐛 Recommendations for testing

📝 Links to relevant issues/docs

Fixes #2292
Fixes #2307
Fixes #2306

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated (docs style guide)
  • Nuspec files were updated (when applicable)
  • Rebased onto current develop

@martijn00 martijn00 added this to the 5.4.0 milestone Oct 30, 2017
{
try
{
CurrentFragmentManager.PopBackStackImmediate();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we run this code only if there are entries on the backstack instead of running it inside of a try/catch block?

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 too prevent AppCompat and normal fragment type exceptions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, I think that makes sense as long as we print the exception. Does it make sense to call base in this context, when base uses a different fragment manager @martijn00?
Sounds like in all cases two exceptions will be written in the output because of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is exactly why i call base, because base has a different manager which might be the correct type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for insisting but... When using the AppCompatViewPresenter there's no way to show a non-compat Fragment, ShowFragment does not call base in any case.

I think there are no scenarios where the base FragmentManager could resolve the request

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm yeah you are right with that. I would still leave the try catch but remove the base call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, good with me 👍

catch (Exception ex)
{
return base.CloseFragments();
MvxTrace.Trace("Cannot close any fragments", ex);
Copy link
Contributor

Choose a reason for hiding this comment

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

MvxTrace is obsolete now, should we use the new logging system here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used all over the code base. I think we need to see how we can replace it all.


public virtual bool ClosePlatformViews()
{
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

If the feature isn't implemented here can we leave a trace to make it easier to discover?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

/// Also, it exposes a method to be launched when this root page is activated due to navigation popping in Detail
///
/// </summary>
internal interface IMvxMasterDetailViewModel : IMvxViewModel
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this a breaking change? Same with MvxMasterDetailViewModel

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 already was removed in 5.3 but i forgot to remove the viewmodels.

{
try
{
CurrentFragmentManager.PopBackStackImmediate();
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here about running the code without try/catch

@martijn00 martijn00 merged commit 68585b3 into MvvmCross:develop Oct 30, 2017
@martijn00 martijn00 deleted the forms-masterdetail branch October 30, 2017 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants