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

[Legacy] Bagde icon does not work when the tabbed page is not the first page (main page) #43

Open
viviFrom13 opened this issue Mar 27, 2018 · 5 comments

Comments

@viviFrom13
Copy link

I have modify your sample to first start on a page with a button.
When we click on the bouton it launches the tabbed page

In this case, the tab badge are not visibles.

In this case, the _tabLinearLayout have not children.

I am using the case legacy because my application is inherit form FormsApplicationActivity. and launch the projet Plugin.Badge.Sample.Droid.Legacy

How can we resolve it ?

I have debugged a little and the issue seems to be in

_tabLinearLayout = _tabLinearLayout ?? (rootGroup.GetChildAt(i) as ViewGroup)?.FindChildOfType()?.FindChildOfType();

the _tabLinearLayout never has children !! Why ???

Thank for your anser .

I have attached the sample android i have modified and snapshots of the screens

Sample.zip

screenshot_20180327-090111
screenshot_20180327-090207

@viviFrom13
Copy link
Author

I have continued to debugged 👍
this problème comes from the ActionBarContainer.

When, the tabbedPage is the main page :

  • the ActionBarContainer has 3 childs ( ActionBarView, ActionBarContextView and the ScollingTabContainerView)

When the TabbedPage is in the secondpage :

  • the ActionBarContainer has 2 childs only ( ActionBarView, ActionBarContextView )
    the ScollingTabContainerView is not Present !!!

Why ?

@viviFrom13
Copy link
Author

I have found. the ScollingTabContainerView is not here because the tabbedPage is not visible.
So during, the navigation in the hierachy we are in the tree of the first page ( main page) not in the tree of the second page.
So we have to wait a little before adding the bagdes

i have juste add a delay on the LegacyBadgedTabbedRenderer class
private async void OnAppearing(object sender, EventArgs e)
{
Element.Appearing -= OnAppearing;
await Task.Delay(1000);
IViewParent root = ViewGroup;

@xabre
Copy link
Owner

xabre commented Mar 27, 2018

@viviFrom13 Nice find, could you check if a shorter delay works (200ms)? Or maybe another page lifecycle event which can be used?

@viviFrom13
Copy link
Author

The delay depends of the loading time of the window. For my own application i need a delay of 3000 :(

If i tried to use another event like focused by i never found someting that working.

Do you have another idea ?

@xabre
Copy link
Owner

xabre commented Apr 11, 2019

@viviFrom13 is this still an issue?

@xabre xabre added the wontfix label Apr 11, 2019
@xabre xabre changed the title Bagde icon does not work when the tabbed page is not the first page (main page) [Legacy] Bagde icon does not work when the tabbed page is not the first page (main page) Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants