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] Page.IsBusy activity indicators gets stuck/causes multiple to be displayed #23745

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void ResetBusyCount()
void OnPageBusy(IView sender, bool enabled)
{
// Verify that the page making the request is part of this activity
if (!PageIsInThisContext(sender))
if (!PageIsInThisContext(sender) && enabled)
{
return;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue23674.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 23674, "Page.IsBusy activity indicators gets stuck/causes multiple to be displayed", PlatformAffected.Android)]
public class Issue23674 : NavigationPage
{
public Issue23674() : base(new Issue23674Page1()){ }

class Issue23674Page1 : ContentPage
{
public Issue23674Page1()
{
Content = new Button()
{
AutomationId = "button1",
VerticalOptions = LayoutOptions.Start,
Text = "Navigate to page 1",
HeightRequest = 100,
Command = new Command(async ()=>
{
await Navigation.PushAsync(new Issue23674Page2());
})
};
}
}

class Issue23674Page2 : ContentPage
{
public Issue23674Page2()
{
IsBusy = true;
Content = new Button()
{
AutomationId = "button2",
VerticalOptions = LayoutOptions.Start,
Text = "Navigate to page 2",
HeightRequest = 100,
Command = new Command(() =>
{
Navigation.PopAsync();
})
};
IsBusy = true;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue23674 : _IssuesUITest
{
public override string Issue => "Page.IsBusy activity indicators gets stuck/causes multiple to be displayed";

public Issue23674(TestDevice device) : base(device) { }

[Test]
[Category(UITestCategories.Page)]
public void Issue23674Test()
{
App.WaitForElement("button1");
App.Click("button1");
App.WaitForElement("button2");
App.Click("button2");
App.WaitForElement("button1");

// The test passes if activity indicator is not visible
VerifyScreenshot();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading