Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Apply fading effect on DetailPage for MasterDetailPage on iOS #7437

Merged
merged 4 commits into from
Jan 30, 2020

Conversation

akamud
Copy link
Contributor

@akamud akamud commented Sep 8, 2019

Description of Change

Something that bugs me is the fact that iOS's MasterDetailPage doesn't fade the Detail page when opening the Menu. This leads to a bad UX, since both the menu and the detail are shown at the same z-axis level, with no "background feel" applied to the Detail page.
Android's implementation doesn't suffer from this, neither does iOS Shell implementation.

Once I noticed Shell "fixed" this behavior, I wanted to do the same for the MasterDetailPage on Xamarin.Forms for iOS.

So this PR pretty much uses the same logic used in iOS Shell to fade the Detail page when MasterDetail menu is opened.

Platforms Affected

  • iOS

Behavioral/Visual Changes

The visual rendering for MasterDetailPage would change for every Xamarin.Forms application.

I have 2 specific points that I would like to get a review:

  • Since this would be a visual breaking change, maybe we could hide this behind a PlatformSpecific?
  • If no background color is provided for the detail page, a white background is used, this gives the impression that the detail page is clearing instead of going to the background. Because of this I am forcing a "black fade", this could cause problems if someone is changing the background color of the Detail page for some reason. Should we suggest on documentation that people can put a black background color if they want this behavior? Maybe we can expose a way of customizing this specific color with another property?

Before/After Screenshots

Before

before

After

after

Testing Procedure

Open any MasterDetailPage (like the ControlGallery) and play with the Menu.

Not sure how I could write an automated test for this.

PR Checklist

  • Has automated tests
  • Rebased on top of the target branch at time of PR
  • Changes adhere to coding standard

@VladislavAntonyuk
Copy link
Contributor

I think it should be controlled by flag IsFadingEffectEnabled or we should have a possibility to set Opacity

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Hi, thanks for your contribution.

This could be an Effect, our a Platform specific property. But never the way it's done in this PR because it's a breaking change for everyone.
Maybe add a PlatformSpecific for this .

@akamud
Copy link
Contributor Author

akamud commented Sep 12, 2019

Totally agree that this needs a PlatformSpecific because of the breaking change. I had an implementation using an effect and one using a custom renderer, but I couldn't attach myself in the middle of animations to provide a fluid experience every time, I was stuck with some visual glitches because of that, that's why I decided to send the PR.

I thought Xamarin's team had to define the name of the PlatformSpecific because of the impact of this. Can I just push changes using a name I pick?

@rmarinho
Copy link
Member

Yeah sure, naming is hard, we will validade your name makes sense when you do the pr. :)

@samhouts samhouts added in-progress This issue has an associated pull request that may resolve it! and removed in-progress This issue has an associated pull request that may resolve it! labels Oct 2, 2019
@rmarinho
Copy link
Member

rmarinho commented Nov 5, 2019

@akamud did you got some time to get this as a PS ?

@akamud
Copy link
Contributor Author

akamud commented Nov 5, 2019

Sorry for taking so long. I'll work on this over the weekend.

@rmarinho
Copy link
Member

ping @akamud :)

@akamud
Copy link
Contributor Author

akamud commented Jan 5, 2020

I apologize for the delay, I finally had the time to make the changes proposed. Pushed new changes using a Platform specific and added a sample in the MasterDetailPageiOS from the gallery.

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Works fine, just a little comment.

@akamud akamud requested a review from rmarinho January 7, 2020 18:05
@akamud
Copy link
Contributor Author

akamud commented Jan 29, 2020

Is there anything else I must do on this?

@rmarinho
Copy link
Member

@akamud needs rebase, it's failing build on OSX

@samhouts samhouts added a/mdp breaking Changes behavior or appearance labels Jan 29, 2020
@samhouts samhouts self-assigned this Jan 29, 2020
@samhouts samhouts added platform-specifics t/enhancement ➕ and removed breaking Changes behavior or appearance labels Jan 29, 2020
@akamud
Copy link
Contributor Author

akamud commented Jan 30, 2020

Done.

@akamud
Copy link
Contributor Author

akamud commented Jan 30, 2020

I see the Windows step is failing. Is there something I should do?

@rmarinho
Copy link
Member

rmarinho commented Jan 30, 2020

@akamud do you mind rebase again, i think it's a issue we found that is nos fixed since i merged the branches up this morning . Sorry

@rmarinho rmarinho merged commit e6a90a4 into xamarin:master Jan 30, 2020
@samhouts samhouts added the approved Has two approvals, no pending reviews, and no changes requested label Jan 31, 2020
@samhouts samhouts added this to the 4.6.0 milestone Feb 28, 2020
@akamud
Copy link
Contributor Author

akamud commented Apr 24, 2020

Is this going to be added to the documentation?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/mdp approved Has two approvals, no pending reviews, and no changes requested ControlGallery p/iOS 🍎 platform-specifics t/enhancement ➕
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants