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

[Android] Redraw NavigationPage upon TabbedPage's tab visibility change #999

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@adrianknight89
Copy link
Contributor

adrianknight89 commented Jun 17, 2017

Description of Change

#365 accounted for the visibility state of TabLayout in a TabbedPage during initialization, but setting tabsHeight to 0 during runtime does not seem to trigger re-draw of a NavigationPage.

OnLayout seems to be measuring and laying out TabLayout and ViewPager fields. For NavigationPage, it was setting ContainerPadding to the appropriate number. By invalidating and requesting layout, NavigationPage can be redrawn based on the new container padding.

Please see user sample in the bug description.

Bugs Fixed

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
@@ -236,9 +236,12 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)
if (child == null)
continue;
IVisualElementRenderer renderer = Android.Platform.GetRenderer(child);
var navigationRenderer = renderer as NavigationPageRenderer;
if (navigationRenderer != null)
if (renderer is NavigationPageRenderer navigationRenderer)

This comment has been minimized.

@rmarinho

rmarinho Jun 22, 2017

Member

i think this isn't building..

This comment has been minimized.

@rmarinho

rmarinho Jun 22, 2017

Member

can't use c#7 yet

This comment has been minimized.

@adrianknight89

adrianknight89 Jun 22, 2017

Author Contributor

switched to older c#

@Paul-Brenner-Tangoe

This comment has been minimized.

Copy link

Paul-Brenner-Tangoe commented Jul 20, 2017

Will this PR make it into the stable release of 2.3.5?

@rmarinho

This comment has been minimized.

Copy link
Member

rmarinho commented Aug 18, 2017

Failing UITests

Bugzilla41153.Bugzilla41153Test_lg_nexus_5-6_0_1
Bugzilla52419.Bugzilla52419Test_lg_nexus_5-6_0_1

@Paul-Brenner-Tangoe

This comment has been minimized.

Copy link

Paul-Brenner-Tangoe commented Aug 31, 2017

@adrianknight89 I just wanted to make sure you saw rmarinho's comment

@adrianknight89

This comment has been minimized.

Copy link
Contributor Author

adrianknight89 commented Aug 31, 2017

@Paul-Brenner-Tangoe Hi, I'm aware of the comment. I just got back from vacation. At the moment, I'm having issues compiling the UI test project for Android. It might be because of the latest VS 2017 Preview I installed (with the latest Xamarin preview release). I will try installing the original release branch and see if that works. I'm not sure why those UI tests are failing.

@rmarinho

This comment has been minimized.

Copy link
Member

rmarinho commented Aug 31, 2017

yeah we are still on vs2015 to develop with Forms.

@adrianknight89

This comment has been minimized.

Copy link
Contributor Author

adrianknight89 commented Sep 1, 2017

@rmarinho When do you expect to move to 2017?

@rmarinho

This comment has been minimized.

Copy link
Member

rmarinho commented Sep 6, 2017

@adrianknight89 hard to say.. we need netstandard 2.0 and uwp to work first

@rmarinho

This comment has been minimized.

Copy link
Member

rmarinho commented Dec 5, 2017

@adrianknight89 we are there now :) please rebase to re-run tests

@adrianknight89

This comment has been minimized.

Copy link
Contributor Author

adrianknight89 commented Dec 8, 2017

Unfortunately, I don't have an idea why the ToolbarItem is disappearing in the UI test. It seems to be due to requesting layout on the navigation renderer - not the invalidation part.

@rmarinho
Copy link
Member

rmarinho left a comment

It's failing tests on Android 41113 and 52419

@adrianknight89

This comment has been minimized.

Copy link
Contributor Author

adrianknight89 commented Dec 12, 2017

Rui, as I said before, unfortunately, I do not know why those tests are failing. It seems to be due to requesting layout on the navigation renderer which is fixing the issue reported here. I'll let one of you guys take a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.